Recently I saw a box (actually, web server VM) that has exact 0 (zero) bytes unused in its swap, while available ram (which is not free, but the sum of free+buffers+cache) is at 60% of total VM ram. Never seen that before, so wondered if this is good config (for the box and applications).
The admin of the VM told me he treat that as perfectly normal and that’s his ordinary way of tuning boxes up.
His idea was that if box has a lot of cold ram pages the kernel will seap it out to free up “real” ram pages so it can used to cache data.
As for me, I used to know the swap if the last thing to use if we like to have fast box. So, I used to set swappiness to lower values (so kernel won’t like to swap pages out), but this person approach was it is good to swap out as much data as we have swap space, thus having more cache. And yes, he said, the kernel can cache swapped pages, too, so there is no good in keep swap free.
Please easy my mind on that: is the VM seap should be used at its best, and ram be freed this way so kernel disk cache can be used more effectively?
To be exact, there was at the moment: 1 Gb of swap space (used at 100%), VM has 32 Gb of ram, and available ram was of 13 Gb.