kernel tuning

From Noah.org
Revision as of 04:58, 18 May 2010 by Root (Talk | contribs) (Created page with 'Category:Engineering # '''overcommit''' -- the optimistic memory allocation strategy. By default malloc() returns non-NULL no matter how much memory you ask for. There is n…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


  1. overcommit -- the optimistic memory allocation strategy. By default malloc() returns non-NULL no matter how much memory you ask for. There is no guarantee that the memory is really available. The idea is that most applications will not use all the memory they ask for at the same time. This temporarily turns off overcommit: echo 2 > /proc/sys/vm/overcommit_memory. For more information, see kernel documentation files vm/overcommit-accounting and sysctl/vm.txt.
  2. Reliable and consistent filesystem. Prevent drive and kernel caching problems on write. Try mounting filesystem with I/O barrier turned on. Example '/etc/fstab':/dev/sda1 / ext4 defaults,barrier=1 1 1
  3. Setting swappiness to 0 (avoid swapping). See `sysctl -w vm.swappiness=0`. Add to '/etc/sysctl.conf': vm.swappiness=0.
  4. Swap vs. OOM Killer. Current strategy: 1. never swap. 2. Out of Memory and Out of Swap are CRITICAL conditions. 3. Reboot kernel on OOM. Set vm.panic_on_oom=1 and kernel.panic=3. Lots of stuff in cat /proc/sys/vm/. See vm.overcommit_memory. For more ideas see Linux Memory Management. Always fun: awk '{printf "%5d MB %s\n", $3*$4/(1024*1024), $1}' < /proc/slabinfo | sort -n