Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Dan's avatar
Level 11

Forge + DO server = High CPU

Hey guys,

Having big problems currently with a website I'm hosting on a Digital Ocean server. For some reason php5-fpm is eating up all of the CPU. Please take a look at this image to see a screenshot of the 'top'.

http://postimg.org/image/js4cpk585/

I'm completely at a loss as to trying to diagnose what is causing it to suck up so much of the CPU. It's especially bad when considering I've got the server running on the 80 buck a month plan.

Any help is massively appreciated.

0 likes
8 replies
ohffs's avatar

Are you getting a lot of traffic? The logs might help - try tail -fing the files in /var/log/nginx/ to see what's happening.

Dan's avatar
Level 11

Not at all, talking about 50 people on at once. Thanks for tip, giving it a go now.

ohffs's avatar

Maybe also tail your laravel log in storage/logs and see what it's saying.

MaxMatteo's avatar

try sudo -s before...to get admin rights for accessing log file

Dan's avatar
Level 11

Seeing a lot of these types of errors in nginx log:

2015/09/22 20:35:57 [error] 1319#0: *5366 FastCGI sent in stderr: "PHP message: PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0" while reading response header from upstream, client: 111.111.11.11, server: hegartymaths.net, request: "POST /skill/related-calculations-1/assessment HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "hegartymaths.net", referrer: "http://hegartymaths.net/related-calculations-1"

Could this have something to do with it?

bashy's avatar

That's just a deprecated message. Nothing related but in some weird way it could well be :P

Disable that via php.ini always_populate_raw_post_data to -1

Look into php5-fpm logs to see any obvious issues. If you don't see anything, can you post your www.conf setup as it could be spawning too many child processes and thus using a lot of CPU %. You're also using 5.00 load so unless it's a powerful CPU, you will be eating into CPU time there :P

hint: use htop instead of top

Dan's avatar
Level 11

Hey @bashy thanks for the reply. I've disabled that via the method you mentioned, however doesn't seem to have fixed it. Something's definitely up big time behind the scenes - We're know on the $640 p/month (yes 6-4-0) and it's still ridiculously slow.

Here are my conf files: https://gist.github.com/anonymous/dd17b1b96347a16178f0

Thanks again.

bashy's avatar

Okay thanks for that. You will need to check your php5-fpm settings though. Normally if php5-fpm is under stress, it will show you in the php5-fpm.log files about child processes running out.

Please or to participate in this conversation.