OOM issues - Apache and MySQL

I’m hosting three Wordpress sites on my Nanode. Lately it has been running slow, I’m even having some trouble with SSH. When I open the Lish console I see “Out of memory” messages related to Apache and MySQL. Everything was working fine before, so why is this happening now and how do I resolve it?

mysqld invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
[<ffffffff8adba4e4>] oom_kill_process+0x254/0x3d0
Out of memory: Kill process 4171 (mysqld) score 169 or sacrifice child
Killed process 4171 (mysqld) total-vm:1158912kB, anon-rss:111456kB, file-rss:0kB, shmem-rss:0kB
apache2 invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
[<ffffffff8adba4e4>] oom_kill_process+0x254/0x3d0
Out of memory: Kill process 29224 (mysqld) score 265 or sacrifice child
Killed process 29224 (mysqld) total-vm:1161836kB, anon-rss:326820kB, file-rss:0kB, shmem-rss:0kB
httpd invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
[<ffffffff8adba4e4>] oom_kill_process+0x254/0x3d0
Out of memory: Kill process 29534 (mysqld) score 198 or sacrifice child
Killed process 29534 (mysqld) total-vm:1166244kB, anon-rss:184668kB, file-rss:0kB, shmem-rss:0kB
httpd invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
[<ffffffff8adba4e4>] oom_kill_process+0x254/0x3d0

1 Reply

The Linux kernel invokes the OOM (Out of Memory) Killer to keep the system from crashing when critically low on memory. It does this by locating and killing the largest in-memory, non-system processes, which are commonly Apache and MySQL.

Without tuning, these services can start hogging resources, especially when hosting multiple Wordpress sites on smaller Linodes. This may have an impact on other running processes such as sshd. A reboot sometimes resolves the immediate problem, but that’s just a temporary fix. I recommend either resizing to a larger plan with the capacity to handle your load, or tuning your configurations for lower memory.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct