Replies: 0
I am running 12 WordPress sites and a Postfix mailserver on an Amazon t2.medium EC2 instance. The WordPress MySql databases are running on a separate Amazon db.t2.medium RDS instance. The EC2 instance is configured with a 512MB swapfile. Around every 3-4 days the EC2 crashes which requires BOTH the EC2 and the RDS to be re-booted. The syslog always indicates the EC2 reached an Out of Memory state. The log also showed that the Out of Memory killer process was invoked which invariable chose to kill an Apache httpd process although on occasions it chose a spamd process. As part of the kill process the kernel dumps a list of active processes into the syslog which always contains around 60 httpd processes. At the time of the crash the RDS usually shows around 80 concurrent connections whereas under normal running conditions I have observed to be around 10.
At first I suspected that it could be due to Brute Force Attacks that I had observed in the Apache access logs so I placed Wordfence plugins into each of the sites which are supposed to prevent such attacks. I have not touched the default Apache configuration. Is there something in the configuration that maybe I can alter to prevent the Out of Memory problem I am experiencing. Or can it be something not related to Apache at all. Any help would be appreciated.