Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11746

Wrong swappiness configuration recommendation

      I have found today that the official recommendation is to set vm.swappiness to 1.

      I do believe this is a serious misunderstanding of the purpose of the swap space. Apparently, the documentation was worse (set to 0) as I can see on DOCS-10405.

      From the official Linux documentation you can read the following:

      The casual reader^1^ may think that with a sufficient amount of memory, swap is unnecessary but this brings us to the second reason. A significant number of the pages referenced by a process early in its life may only be used for initialisation and then never used again. It is better to swap out those pages and create more disk buffers than leave them resident and unused.

      The swap usage is not a problem by itself. The only problem which may affect performance is if the operating system is actively paging in and out which can be tracked using vmstat.

      You can find many articles in relation to this subject:

      https://chrisdown.name/2018/01/02/in-defence-of-swap.html

      In the previous documentation ticket, the value of 10 was suggested which is better than 1. However, I would not recommend changing anything unless you really know what you are doing and you have the tools to observe the behavior and the impact.

       

      Scope

      Based on internal discussions, we're going to remove this recommendation until performance testing completes and we have more data to back any recommendations in one direction or another. We will backport this removal to 3.6.

            Assignee:
            ravind.kumar Ravind Kumar (Inactive)
            Reporter:
            ricardo.lorenzo Ricardo Lorenzo
            Votes:
            1 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              1 year, 25 weeks, 3 days ago