title: High traffic in Wordpress causing "Error Establishing A Database Connection"
body: <p>I have a site hosted on an EC2 instance which I am able to crash by simply clicking the home button very fast very quickly (essentially a small scale DoS attack). The system log gives the following error:</p>
  
  <pre><code>Out of memory: Kill process 7744 (httpd) score 20 or sacrifice child
  </code></pre>
  
  <p>I've gone through all the usual steps and the problem persists. The steps I've taken so far include:</p>
  
  <ul>
  <li>Upgrading PHP from 5.3.29 to 5.4.45</li>
  <li>Setting up browser caching and server side caching</li>
  <li>Setting up GZIP</li>
  <li>Increasing the hosting instance to 2gb of RAM</li>
  <li>Reducing plugins and compressing all images on the site. Also compressing CSS and JS.</li>
  </ul>
  
  <p>The PHP memory is set to 128mb and of that each session uses approximately 38mb which isn't overly high.</p>
  
  <p>I don't think it's anything to do with wp-config.php or a corrupt database. The file (wp-config) seems fine and the site is only effected when handling lots of simultaneous requests. </p>