1

I recently upgraded my VPS from 1 GB RAM to 2 GB because MYSQL kept crashing due to low memory. The server has been running fine for 3 weeks until now. The following is logged to /var/log/syslog

Mar 14 17:38:15 u1905598-01 kernel: [2798798.833096] Out of memory: Kill process 1247 (apache2) score 27 or sacrifice child
Mar 14 17:38:15 u1905598-01 kernel: [2798798.834657] Killed process 1247 (apache2) total-vm:455756kB, anon-rss:33872kB, file-rss:21060kB
Mar 14 17:38:15 u1905598-01 kernel: [2798799.084554] init: mysql post-start process (1913) terminated with status 1
Mar 14 17:38:15 u1905598-01 kernel: [2798799.173575] type=1400 audit(1457973495.804:37): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/mysqld" pid=1935 comm="apparmor_parser"
Mar 14 17:38:15 u1905598-01 kernel: [2798799.351381] init: mysql main process (1947) terminated with status 1
Mar 14 17:38:15 u1905598-01 kernel: [2798799.351397] init: mysql respawning too fast, stopped

I'm planing on upgrading to 4 GB RAM but before I do that I would like to know if there are other ways of solving this. Is there a way for me to limit apache's child processes? How would that affect the rest of the site?

UPDATE:

I have lowered apache's MaxClients value from 150 to 75 and the MaxKeepAliveRequests from 100 to 75.

I calculated the new MaxClients value based on these instructions: https://stackoverflow.com/a/25021700/3067688

This has actually fixed the server crashes. The problem now though, is that the server is extremely slow. It takes roughly 25 seconds to load every single page!

If someone could point me in the right direction I would be deeply grateful!

FIXED: Turned out that my server was receiving a massive amount of POST request through xmlrpc. Disallowing access to Wordpress's xmlrpc.php file fixed everything.

Thanks

virttop
  • 21

1 Answers1

1

Turned out that my server was receiving a massive amount of POST request through xmlrpc. Disallowing access to Wordpress's xmlrpc.php file fixed everything.

virttop
  • 21