![]() ![]() Here are the lines you’ll want to add at the end of your /etc/nf file: vm.vfs_cache_pressure=500 ![]() However, swap will now be stored via much faster ZRAM! Start preparing for being out of memory sooner by increasing the tendency of your Raspberry Pi to swap.This is done by increasing the kernel’s cache pressure. Delay the inevitable, running out of memory.Now, rather than leaving swapping till the last minute, which often brings the Raspberry Pi to a crippling halt, i’ve added the following lines to /etc/nf and rebooted. Once installed, you can see the stats of ZRAM storage using the following command: sudo cat /proc/swapsĪdd Kernel Parameters to make better use of ZRAM #Nxfilter upgrade script install#If you use this method, be sure to edit the config located in /etc/default/zramswap and setup around 1GB of ZRAM: sudo apt install zram-tools Optional, if you would like to edit config: vi /etc/default/zram-swapĪlternatively, you can enable ZRAM by installing zram-tools. The instructions are listed on that page. I ended up using this zram-swap script to install and auto-configure. With 1GB of ZRAM, the default /swapfile (slow!) will be the last resort. This requires some adjustments depending on your use case. The Raspberry Pi 4 has a max memory of 1GB, 2GB, 4GB or 8GB of RAM. This allows for very fast I/O and the compression savings provide additional memory. Pages written there are compressed and stored in memory. ZRAM creates RAM based block storage named /dev/zram0 (or 1, 2, 3, etc). To help address this, I added ZRAM and made a few changes to kernel parameters. I wanted to share these tweaks and hopefully find out if you also experience the same improvements to performance.Īfter adding a Raspberry Pi to my Homelab, at times when memory was low, it became very unresponsive and would even freeze. With good results, I’ve applied some of the optimizations mentioned in that previous article to the Raspberry Pi 4. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |