Question

CPU running at constant 30%. Three php5-fpm processes. Why?

DO sent me a CPU alert. I checked top and I see this for about 45 minutes now:

PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
18460 www-data  20   0  365576  81912  46836 S 21.2  8.0   2:35.30 php5-fpm
17378 www-data  20   0  347680  70084  52800 S 11.0  6.9  10:53.50 php5-fpm
18210 www-data  20   0  352256  72728  50884 S 10.0  7.1  10:14.65 php5-fpm

This is a web server running a few WordPress and Drupal sites.

I’ve checked Google Analytics and my visitors are not high for any site, there is never more than 1 or 2 online at a time according to Google Analytics Real Time reporting. Usually there are 0 users at any given time.

What should I do?

Is there any way I can see what is causing these specific PHP processes? Like which script or site somehow? I’m not sure how to diagnose this. My server has been running for 3 years, I always keep it updated, I’ve never had this happen and nothing out of the ordinary appears to be going on.

EDIT: I just updated a few plugins that had recent new versions on my 3 WordPress sites and the CPU usage immediately dropped to 0% or 0.3% as it is usually. Does it make sense that somehow a pending update would cause the CPU usage to spike for over an hour?

Subscribe
Share

Unfortunately I have not found the solution. I still have 25% CPU for about an hour or two each day and I don’t know what is causing it.

Hi Jasonrj. I’ve recently been having the same problem. Is there anything you found that can help me as well?

Cheers!

CPU spikes have happened again for an hour+ today. I’m still not sure why.


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

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.

I have the same issue… I ran diognostics on the vm where the site is and the only thing sucking spu for a few hours a day is the site. I am thinking it has to be a wordpress problem.

Hi @Jasonrj,

The php5-fpm processes are most probably connected to connections to your websites. Most probably these connections happen because there are people browsing your websites.

You can of course track this by using the netstat command

netstat -punta

This will show you all current IP addresses connected, on which port and what type of a request they are actually doing.

Additionally, the CPU load being 20% or 30% is actually pretty okay if you are running an application on it.

Regards, KDSys

This comment has been deleted