Load: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 12: | Line 12: | ||
=== Prevent OOM Killer from killing MySQL === | === Prevent OOM Killer from killing MySQL === | ||
You can create a cron job to keep the PID for MySQL updated in the OOM Killer exclusion list: | |||
<code>*/1 * * * * root pgrep -f "/usr/bin/mysql" | while read PID; do echo -1000 > /proc/$PID/oom_score_adj; done</code> | |||
== References == | == References == |
Latest revision as of 17:09, 14 August 2017
MySQL
OOM Killer
OOM Killer kills the process with the highest memory usage to prevent the system from running out of memory. It often triggers due to memory load.
Prevent OOM Killer from killing MySQL
You can create a cron job to keep the PID for MySQL updated in the OOM Killer exclusion list:
*/1 * * * * root pgrep -f "/usr/bin/mysql" | while read PID; do echo -1000 > /proc/$PID/oom_score_adj; done