Friday, February 12, 2016

A note of kernel parameter min_free_kbytes


min_free_kbytes

- This controls the amount of memory that is kept free for use by special reserves including “atomic” allocations (those which cannot wait for reclaim)
- The minimum number of kilobytes to keep free across the system
- Default is min_free_kbytes = 4 * sqrt(lowmem_kbytes)
- kernel use all available RAM to cache but RAM equal to min_free_kbytes will not be used for cache
- Be cautious when setting this parameter, as both too-low and too-high values can be damaging. [1]
- setting this parameter to a value that is too high (5-10% of total system memory) will cause your system to become out-of-memory immediately. [3]
- Setting this too high will OOM your machine instantly.[2]
- lowmem_kbytes is complicated. Take it as size of RAM for approximation [4]


[1] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/s-memory-tunables.html
[2] https://www.kernel.org/doc/Documentation/sysctl/vm.txt
[3] https://access.redhat.com/solutions/336033
[4] http://www.codeskulptor.org/#user41_u8JqnFK759_0.py