Forum
Swappiness needs to be reduced and zram swap added - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: Swappiness needs to be reduced and zram swap added (/thread-2883.html)



Swappiness needs to be reduced and zram swap added - jbruchon - 23rd Mar, 2015 10:03 PM

I am using the RPi model B (512MB) for which 'free' reports 366012 KB of total available memory. I have experienced occasional problems with audio/video freezing and stuttering on Xbian (particularly on 1080p streams) and I have determined that this is due to aggressive swapping the SD card and the swap thrashing that results. I reduced swappiness in /etc/sysctl.d/00-xbian to 'vm.swappiness = 20' and most of the video problems went away. It also seems as if apt occasionally starts to check for updated software (because of cron?) and gets stuck, never terminating.

Also, to minimize swaps to the slow SD card, the zram module needs to be added to the system and a small zram-based swap should be set up with a higher priority than the SD card. Combining these two changes will eliminate most of the unnecessary swapping overhead and improve the system's overall responsiveness. Unfortunately, the kernel in Xbian doesn't have zram available, preventing me from easily adding it to my own installation.


RE: Swappiness needs to be reduced and zram swap added - f1vefour - 26th Mar, 2015 09:39 AM

Zram swap is enabled by default, or at least it was.


RE: Swappiness needs to be reduced and zram swap added - Fabio72 - 26th Mar, 2015 07:20 PM

Zswap is enabled, zram is no more supported on raspi kernel


RE: Swappiness needs to be reduced and zram swap added - narotic - 10th Apr, 2015 08:45 AM

Are you completely sure that swapping is the culprit? I ask because there recently have been some problems with stuttering in some x264 files. This has already been fixed upstream in the latest raspberry pi firmware, but that hasn't found its way yet to xbian stable. More info: http://forum.kodi.tv/showthread.php?tid=215399

If it really is a lack of memory, then it might be easiest to just remove xbian-package-splash. That should free more than 25MB (RSS!) at the cost of some eyecandy:
Code:
1697 root      20   0 38160  28m  596 S   0.0  7.6   0:00.81 splash-daemon

Apt will complain that it's an essential package, so do it at your own risk. Personally I haven't noticed any side-effects yet other than that the Dim screensaver actually shows the terminal as background rather than a solid black.


RE: Swappiness needs to be reduced and zram swap added - narotic - 10th Apr, 2015 08:47 AM

* double post *


RE: Swappiness needs to be reduced and zram swap added - Fabio72 - 11th Apr, 2015 05:39 AM

I'd like to check zswap behaviour but debugfs seem not supported in kernel and, as I undestood, it's necessary to examine zswap