Deployment guideline - Swappiness 0?

Hi, I would like some help with understanding the rationale behind the system tuning deployment guidance of setting swappiness to zero.

In my understanding, the default distro swappiness value helps to ensure that more memory is available for file system cache rather than being occupied by something not currently in use.

I see that when I leave the value as is, it doesn’t take long for Graphhopper to fill the swap partition despite plenty of available memory.

The deployment guide refers to this SO thread, where @karussell responds to a seemingly deleted reply that apparently had a convincing argument for setting swappiness to zero.

If I had to make an argument for setting swappiness to zero, I would say that:

Due to the nature of Graphhoppper to load the entire graph into memory, even though clients will seldomly be reading from more than a small percentage of the graph, the kernel will recognize a large percentage of the graph as unused memory space and decide that it would be better for file system cache to occupy the memory.
But one might not be interested in this for two reasons: because it will potentially slow down routing requests, seeing as portions of the graph will have to be paged in upon request - and because a filled swap is in general an “operations smell” and limits the wiggle room before OOM killer kicks in.

I hope that somebody can help elucidate this deployment guidance for me and correct my understanding of its rationale. I’m not very used to dealing with virtual memory, so it’s entirely possible that the above makes no sense except in my misconfigured mental model. In other words, I’m confused, so please have patience with me :smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.