swappiness = 100 or why he start so fast to swap


snakekick
 Share

2 2

Recommended Posts

hello, 
while i am copy files on my server and start 1 or 2 torrent i see that my memory gett less. 

Yes thats only buffer and caches but he eat faster then he get free so that he starts swapping (what cost cpu and speed)

a litte search and i see that 

cat > /proc/sys/vm/swappiness  is 100 and look on my other systems it is set to 60

now woth change this value he dont start swapping and free up faster the memory.

can someone explane me why this here is set to 100?

thank you

Link to post
Share on other sites

Donate and support the project!

If you do swapon you will notice that the used swap is zram. By default halt of the available memory is compressed via zram as swap and the system shall use it.

Link to post
Share on other sites

@snakekick, having the kernel swappiness set to 100 on systems where the swap is implemented as compresses RAM is normal.

You want the pages that have been swapped out to be compressed and stored in RAM to make the swap-in operation as fast as possible (decompressing the page is faster than reading it first from disk). Since the storage for some of these devices is on the slow side (microSD, eMMC) - having the swap on RAM tends to speed up the memory operations (swap-in & swap-out), while at the same time helping to avoid unnecessary wear on your flash storage.

Link to post
Share on other sites

 Share

2 2