Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-10739

Document Linux kernel parameter tunable min_free_kbytes



    • Task
    • Resolution: Unresolved
    • Major
    • None
    • None
    • core-server
    • None
    • 0


      The Magma dev team would like to provide customers a recommendation for tuning a Linux kernel parameter `min_free_kbytes` when required. 

      "When Linux's free memory is really low and rate of page allocations is high, it could result in direct page reclaims. This involves memcached process spending time to free up pages. The time spent could be in order of tens or hundreds of milliseconds on systems with large RAM capacities.

      The symptoms are all of the following together: high CPU utilisation in kernel mode, increase in read latency, increase in allocstalls (stat in /proc/vmstat). Depending on how frequently this happens and the latency impact one may want to increase kernel parameter min_free_kbytes. This will result in kernel daemon kswapd waking up much earlier to reclaim pages and keeping that amount of memory free hence reducing the chances of direct reclaims. The suitable value depends on the workload and memory pressure. One could start off by setting it to 512MB.

      To temporarily change it to 512MB (setting not persisted across reboots):

      echo 524288 > /proc/sys/vm/min_free_kbytes

      To permanently change it, add an entry to /etc/sysctl.conf file.

      echo "vm.min_free_kbytes=524288" >> /etc/sysctl.conf


      I'm not sure which is the best place to document this.


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            rohan.suri Rohan Suri
            rohan.suri Rohan Suri
            0 Vote for this issue
            2 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes