Applies to:
Linux OS - Version Oracle Linux 6.0 and laterOracle Cloud Infrastructure - Version N/A and later
Linux x86-64
Goal
Calculate a recommended value of the vm.min_free_kbytes kernel tuning control.
Solution
/proc/sys/vm/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).
Setting
vm.min_free_kbytes too low prevents the system from reclaiming memory.
This can result in system hangs and OOM-killing multiple processes.
However,
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. Linux is designed to use all available RAM to cache file
system data. Setting a high min_free_kbytes value results in the system
spending too much time reclaiming memory.
From the O/S
perspective, the parameter vm.min_free_kbytes should be initially set in
the order of 0.5% of total physical memory. Refer to the MemTotal line
in the /proc/meminfo report as one place to find this value.
This value needs adjusting for every server, there is not a default
value. Avoid attempting a setting that exceeds 5% of physical memory,
which can trigger immediate out-of-memory conditions.
The new value should be added as follows:
- Open the file /etc/sysctl.conf
# vi /etc/sysctl.conf
- Add/modify the following line:
vm.min_free_kbytes = <value>
<value> should be replaced by the actual computed value.
- Save the file and run the following command to load the changes:
# sysctl -p /etc/sysctl.conf
Note: Before applying vm.min_free_kbytes tweak in Exadata, refer Oracle Exadata Database Machine Setup/Configuration Best Practices (Doc ID 1274318.1)
References
NOTE:401749.1 - Oracle Linux: Shell Script to Calculate Values Recommended Linux HugePages / HugeTLB ConfigurationNOTE:361323.1 - HugePages on Linux: What It Is... and What It Is Not...