FYI: how to prevent mysql from oom-killer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the following may be useful for most server systems

OOM-killer acts if some process reclaims more and more
memory and the kernel randomly kills unimportant tasks
using hughe memory

in case of a running mysqld the classification "unimportant"
is nearly all time wrong and can cause hughe damage and work
in other words: you really never want killed a database server
randomly instead "dbmail-imapd" which can be restarted via
systemd without pain and may be the root-cause of OOM
_________________________________________

with one single command you can protect processes from get killed
i started to run this every 15 minutes to make sure it is also
active after restarts

i am considering include this in "mysqld.service" as
"ExecStartPost=-/usr/local/bin/mysql-no-oom.sh" in our
internal mysqld-packages and include also the script
_________________________________________

[root@mail:~]$ cat /etc/crontab | grep oom
0,15,30,45 * * * * root bash /usr/local/bin/mysql-no-oom.sh

[root@mail:~]$ cat /usr/local/bin/mysql-no-oom.sh
#!/bin/bash
pgrep -f "/usr/libexec/mysqld" | while read PID; do echo -1000 > /proc/$PID/oom_score_adj; done

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux