Getting regular "Out of memory: Kill process". How to resolve this isse?

July 30, 2013 28.5k views
Regularly I got the following message in syslog file: "Out of memory: Kill process 837 (mysqld) score 59 or sacrifice child". This is really annoying. I already created a swapfile using this tutorial "https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04" but I still get error. Could you please tell me how to fix this issue? My droplet is a $5 one with 512Mb RAM. THe distro is Ubuntu 13.04 x64. (the funny thing is that default mysql configuration worked perfectly on my previous server (VPS Gandi with only 256Mb RAM)
1 comment
  • I'm getting the same thing on $10 plan for apache2 (running wordpress and have basically zero traffic except for myself.

27 Answers

Try to use a swap file.
Getting this error with a nodejs process et resolved since using a swap

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.
You can try tweaking /etc/mysql/my.cnf or resizing your droplet to a larger plan.
It might not necessarily be a MySQL problem. Sometimes, other programs hog a server's memory - leaving MySQL too little memory to work with.

Are you running Apache? If so, you should fine-tune Apache2 and MySQL memory usage.

Is it too late for you to copy the config from VPS Gandi, so you can compare it to the config on your droplet?

Guys, I have the same problem.
"You can try tweaking /etc/mysql/my.cnf"
"You should fine-tune Apache2 and MySQL memory usage"

  • is there any step by step explanation of these two?

Thank you!

Same problem here. on $20 per month plan and zero traffic, mysql (on wordpress) keeps stopping (out of memory).

I have the same issue... Really annoying.

I have the same issue... Really annoying. on $10 per month plan

I am facing same issue with $5 plan. My website is not working even. Can anyone from digital ocean helps us here.

I guess this has something to do with DO infra. My Server was running for 2 years with no prob and since last week it is having the same issue. I upgraded to $10 and things are the same

Been fine for the last one year, but got this same issue since last week, plan to upgrade, but it seems will cancel it if has the same issue with @revel .

Any further update?

Thank you.

Same issue...very annoying...can we get something to work [while I migrate everything to AWS]?

Same issue here...

If I use the terminal, I get this error:
"sshexchangeidentification: Connection closed by remote host"

If I try to use the Online Console, every command gets an error like:
"Out of Memory: Kill process ... or sacrifice child ... "

What should I do? My server is offline for 3 days and I can't get it working!
Any help?? Thanks!

Same problem. Have to do "shutdown -r now" several times per day as MySQL seems to get killed often. I considered upgrading to a larger plan but see others are having the same problem with larger plans. I'm surprised there's no solutions since the months this has been an issue.

Same Issue here!, new website on DO, worked for a month or so then started crashing every day, move it to a new droplets, was fine again for a week now the problem has returned.

Tried to upgrade to a better spec, did not make a difference.

This seem to be a common issue, no response from DO? time to move to another host?

Also getting this, wordpress on 10$,

I am also getting the same thing with the $10 Wordpress plan. Seriously considering moving to a different host.

same here, digging around for answers and I see there has been none given to this question yet...

I too have the same problem, Is there an answer from support team..? It was working fine till last couple of months. What is going on..?

It's a problem with the servers cgroup configuration.
Disabling cgroups would solve the problem.

Facing the same issue :/

@digitalocean are you going to help your clients or just keep ignoring them ?!

I am facing same issue with $5 plan. My one-click owncloud is not working fine. Very disappointed things.

Same issue here. It's causing issues with supervisor and database queues, need to be manually restarted daily. I am very surprised DO support has not responded. I may consider migrating to Vultr if I cannot find a solution soon.

Didnt knew about Vultr, I'm opening an account right now there to check it.

The apparent solution is to make a swap file, but the tutorial indicates that a swap file will degrade the SSD drives over time and they dont recommend doing it anywhere and just "upgrade" to fix whatever problem you have.

Looks to me that DO just want people to pay more or cutoff many $5 plans to get bigger customers.

The same problem, just want use wordpress with apache and mysql for my blog. Using droplet for $5
No solutions?

After a bit of digging with information from crash logs and internal mail, I came across this:
http://www.porotal.org/fixing-daily-cron-db-update-failed-database-locked-error-in-ubuntu/

Follow the swap tutorial. It solved it for me. I have the 5$ droplet and it works fine now :)

https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.
Have another answer? Share your knowledge.