Overcommit and added memory

from the Artful MySQL Tips List

The Linux kernel can overcommit memory much the way an airline overcommits airplane passenger seats; proc/sys/vm/overcommit_memory controls this behaviour: 0: (default) the kernel is free to overcommit, uses an optimising algorithn 1: always overcommit, good for high loads but risks a crash 2: only commit this much memory: swap space + RAM * (/proc/sys/vm/overcommit_ratio / 100). But /proc/sys/vm/overcommit_ratio defaults to 50, so if you just added RAM and proc/sys/vm/overcommit_memory=2, InnoDB's mmap() may fail at levels near half of RAM. So if you are adding RAM under Linux, remember to adjust /proc/sys/vm/overcommit_ratio. More at http://engineering.pivotal.io/post/virtual_memory_settings_in_linux_-_the_problem_with_overcommit/

Last updated 7 Oct 2018

Return to the Artful MySQL Tips page