CPU load to hight causing 502 error

Posted June 10, 2016 3.1k views
NginxPHPServer OptimizationUbuntu 16.04

Hi There,

Since this morning I am experiencing high CPU loads which is causing my site to go up and down. Since I am hosting real-time football data (which is collected on a different droplet) this is a big issue since the EURO starts within 2 hours.

I already pinned up a new droplet which gives me the same problem. The CPU load is between 1.19 and 3.5 currently.

I have really no clue what to do about or were to look why this is happening. My site worked fine for over 2 months and all of a sudden this problem occurs.

Is there anyone that can help me with this? I have sinned up the server using travel forge BTW.


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

Run the command “top” from console and it will show you what process is using CPU. That would at least be the best place to start. It could be a number of different things.

when I do that i see the following

16490 forge 20 0 467620 32056 20628 R 96.3 0.4 0:48.13 php-fpm7.0
16501 forge 20 0 471260 29384 18180 R 95.7 0.4 0:40.78 php-fpm7.0
16499 forge 20 0 463880 31520 20220 R 93.0 0.4 0:48.09 php-fpm7.0
16500 forge 20 0 477912 29804 18628 R 49.8 0.4 0:39.94 php-fpm7.0
16491 forge 20 0 477284 31952 20400 R 47.2 0.4 0:45.50 php-fpm7.0

  • Your PHP usage is too high. There must be a php script that is in a loop or somehow running too much. Try restarting your http service and see if the cpu decreases (check it right away, it may go back up again)