[Users] OOM and /etc/vz/oom-groups.conf

Mark J. mjohanson at a2hosting.com
Tue Oct 1 11:45:58 PDT 2013


Hello,

I have been trying to tweak the OOM killer to prevent some database corruption thats been happening in the VM's when the oom killer kills off mysql. Based on what i have read online and in the conf file itself I am a bit confused on why its not killing other things off before mysql.

Based on the following (taken directly form the conf file):

OOM-score adjustment, a number from -1000 to 1000. A positive number increases the chances of killing, while a negative number decreases it (more protection). -1000 makes a process unkillable till any other process exists.

I made the following changes to the conf file:

mysqld          init            -500    -1000
httpd           init            -500    100
httpsd          init            -500    100
apache          init            -500    100
php             init            -500    100


Saved and then made the changes live:

cat /etc/vz/oom-groups.conf > /proc/vz/oom_score_adj


Verified the changes were in fact live:

root ~ #cat /proc/vz/oom_score_adj | grep mysql
mysqld init -500 -1000
root ~ #cat /proc/vz/oom_score_adj | grep http
httpd init -500 100
httpsd init -500 100


However I am still watching mysql get killed off before anything else:

Oct  1 14:38:18 server kernel: [2456651.082410] >>> 3679 oom generation 62 starts
Oct  1 14:38:18 server kernel: [2456651.082418] 133199 (mysqld) invoked loc oom-killer: gfp 0x200da order 0 oomkilladj=0
Oct  1 14:38:18 server kernel: [2456651.084483] Out of memory in UB: Kill process 126607 (mysqld) score -903 or sacrifice child
Oct  1 14:38:18 server kernel: [2456651.084772] OOM killed process 126607 (mysqld) vm:3829812kB, rss:166344kB, swap:36760kB
Oct  1 14:38:18 server kernel: [2456651.115460] OOM killed process mysqld (pid=157305, ve=3679) exited, free=519316.
Oct  1 14:38:18 server kernel: [2456651.115465] <<< 3679 oom generation 62 ends (task died)

Anyone have any suggestions or been able to make these adjustments that worked? Any help would be of great assistance.


More information about the Users mailing list