CPU / Memory Usage Skyrocketing

Posted April 4, 2018 2.8k views
NginxPHPUbuntu 16.04

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!

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.

Submit an Answer
1 answer

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: