Restart Mysql automatically when ubuntu on EC2 micro instance kills it when running out of memory
问题 When the system runs out of memory, ubuntu 12.04 kills the mysql process: Out of memory: Kill process 17074 (mysqld) score 146 or sacrifice child So the process ends up killed. This happens at peaks of server load and mainly because of apache getting wild and eating the remaining available memory. Possible approaches could be: Change somewhere somehow the priority of mysql, so it's not killed (probably a bad fix as something else will be killed) Monitor the status of mysql and restart