Question

Server Crashes With spikes in CPU and Disk IO

Posted February 15, 2018 1k views
Server Optimization Ubuntu 16.04

Hi, yesterday I set up a WordPress server with 1GB Droplet for WordPress with 1GB separate droplet for Mysql Database.
Today I after I logged in to control panel I saw a sudden Spike in CPU and Disk IO and A sudden Fall in Ram after that. I checked my website its down server was frozen, I tried to ssh to the server and tried to restart the apache, nothing worked so I had to restart the server from control panel

this is the apache /var/log/apache2/error.log ->https://pastebin.com/7ZFx2d3T
and this is the screenshot of the graphs -> https://drive.google.com/open?id=1ALH9rSALrfHD_gP48P248AXKUGFxt6Vi

(Logs time zone and graph time zones are different )

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

Hello,

It looks like that there was a spike in your traffic which caused the sudden CPU load. What I could suggest is:

  • Make sure to add enough resources to your Droplet, you could run a stress test in order to be able to determine how many visitors your site could handle at once:

https://www.digitalocean.com/community/tutorials/an-introduction-to-load-testing

  • Also make sure to optimize your Wordpress website, for example, delete all plugins that are not absolutely necessary, install a caching plugin and maybe enable a CDN

  • Check your logs and make sure that there was no malicious traffic towards your site, you could, for example, use this script here to summarize your access logs.

Regards,
Bobby

by Brian Boucheron
In this article, we'll talk about the server side of web performance optimization: how fast can your server respond to your user's requests? We'll review the general landscape of load testing, step through a plan to find your server's maximum practical response rate, and discuss some options for open source load testing software.
Submit an Answer