CPU / Memory Usage Skyrocketing

Can someone point me in the right direction to figuring out what is going on with this? My server will skyrocket (seemingly) randomly in terms of CPU / Memory usage. Seems mysqld and php-fpm will cause the usage to go crazy. It only happens for a short time, and then things go back to normal.

This is what my graph looks like:

This causes my PHP based sites (Wordpress) to crash.


Thanks in advance!

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

You’ve narrowed the issue down to mysql/php and since you are running WordPress my guess would be that you have a plugin or theme that is doing something to max out your resource usage.

Do these spikes occur only when someone is viewing the site or randomly even when there is no traffic? If it’s the later I would recommend checking any cron jobs (scheduled tasks) that your plugins may be using. A plugin designed to back up your WP site could potentially cause a spike like this when it dumps the whole database through php to a file.

If you are running 3rd party plugins the best way to determine the source of the issue would be to disable these plugins and re-enable them one at a time to see if the issue recurs after a particular one is running. You can also check your access and error logs during the times of the spikes to see if anything is recorded.

Nginx access/error logs are in:


PHP-fpm logs can be found in: