High CPU usage PHP-FPM

Posted May 28, 2017 71.6k views
DigitalOceanApplicationsUbuntu 16.04

Hi all,

Perhaps this is a silly question but I’ve recently migrated a Wordpress website ( from another hosting provider to Digital Ocean. I used ServerPilot to config the LEMP/LAMP stack and successfully migrated my website.

I’m really new to all this but I see a strange trend: while mi CPU load goes to the roof when getting close to 1000 active concurrent visitors, my RAM stays flat (around 10% usage). CPU top process graph says that all the load comes from php-fpm and mysql

Do you think this is expected behavior? Do you have any recommendations for this?

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
13 answers

Hi, @carlosv, did you get your CPU load fixed? My problem is very similar: I am using WP Rocket, ServerPilot and 32 gb RAM, 8core CPU. When I get more than 1000 active concurrent visitors my php-fmp goes to the roof and my TTFB gets very high.


As traffic grows, so will resource usage.

One way to reduce usage is to implement caching so that each page load doesn’t hit the database. There are a number of caching plugins available, though WP Super Cache and W3 Total Cache are probably the most popular.

WP Super Cache is a bit easier to setup and works with very little configuration. On the other hand, if you need something more advanced and you plan on using Redis or Memcached to cache (instead of using the disk), W3 Total Cache would be a better, but more complex option.

Personally, I much prefer simple caching using Redis, though it’s a bit more of a manual setup than it would be with the two plugins above. This is a rather simple plugin, but you’ll need to install Redis, and then do some configuration in wp-config.php to get it working as expected.

Caching alone, however, isn’t a magic fix-all. Last I recall, the configuration for MySQL and PHP that ServerPilot uses is either the defaults or pretty close to it, so it’s most likely not tuned for higher than average traffic (and by average, I mean very low to low).

Caching works as another layer to improve performance, but you also need to work on tweaking and tuning the stack itself (NGINX/Apache, MySQL, PHP-FPM, etc) to get the most out of what you’ve got.

Upgrading to a higher plan with more CPU might help, though ultimately, with the same configuration and no caching, you’d likely end up as you are now with higher CPU usage due to so much needing to be processed.


Thank you very much for replying!

Perhaps I failed to provide details required to better assess this scenario: :

  • I’m using WP Rocket plugin for caching.
  • the application is currently in a 32 gb RAM, 12 core CPU, 320 GB droplet

I didn’t use Redis because it was not provided by ServerPilot, but I’ll take a look at it.

As per fine tuning the stack I do not have any experience at all in doing so. Do you provide consulting services? Or do you happen to know someone that might help me with this?


I’d also strongly recommend ensuring you’re using PHP 7.0 with Opcache, implementing proper database tuning, and as mentioned earlier, implementing WP Super Cache/Total Cache.

The first 2 should have a huge impact, with database tuning allowing you to store more in memory for considerably faster query execution times.

I’m getting to same issue. Suddenly mysqld and php through the roof.

Hi @jtittle1
I’m having same issue and would love to get your help on how to optimize the stack with my site.
I have 8 GB
4 vCPUs
30 GB
Droplet and I can see the php-fpm reaches 300% when I hit 3000 concurrent users.
I couldnt find a way to send you a message…

@jtittle1 @jtittle can you help me as well as i’m also facing the same issue on my droplet.

Hi am having the same problem with my website. When I run the top command I can see that this website is using around 80%-90% and the website with just 100 concurrent user goes slow. I am running a droplet with 8GB of RAM on CentOS

edited by AHA

Anyone have the solution? I have the same problem a few days ago till now. I am using WP- Rocket and Nginx Cache… Using top command and saw php7.3-fpm using too much CPU with about 400M RAM for each process… It make my site too slow…

I really like to know also.

Basically when it is really busy you would expect high CPU usage. Except when i restart the fpm service its all calm after s when its really busy you would see the same spike back again.

Previous 1 2 Next