High PHP-FPM CPU usage bringing site down - Drupal Nginx PHP5

June 12, 2018 160 views
Nginx PHP Drupal Ubuntu

Hi
I am running drupal with Nginx on ubuntu 14.04, 4gb memory DO plan. and PHP5 and on htop i notice that the CPU usage is 100%,
In htop the top processes are

www-data (virt 56680, res 4540, command php-fpm: pool drupal)
There are a number of the above pool drupal php-fpm processes taking up lots of CPU.

I have enabled opcache in php.ini (not cli)

Does anyone know how I can get the CPU down? Its strange as it started happening for no apparent reason.

1 comment
  • Also here is a snippet from my error log, something seems to think its wordpress when its actually drupal?

    2018/06/12 08:04:35 [error] 1487#0: *905 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/wp-login.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , re$
    2018/06/12 08:07:04 [error] 1487#0: *924 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/wp-login.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , re$
    2018/06/12 08:09:51 [error] 1487#0: *935 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/wp-login.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , re$
    2018/06/12 08:19:33 [error] 1487#0: *982 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/wp-login.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , re$
    2018/06/12 08:20:26 [error] 1487#0: *982 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/wp-login.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , re$
    2018/06/12 08:23:41 [error] 1487#0: *1006 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/wp-login.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , r$
    2018/06/12 08:26:12 [error] 1487#0: *1006 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/wp-login.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , r$
    2018/06/12 08:27:11 [error] 1487#0: *1006 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/wp-login.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , r$
    2018/06/12 08:30:07 [error] 1487#0: *1034 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/wp-login.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , r$
    2018/06/12 08:59:30 [error] 1487#0: *1198 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/d7.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , request$
    2018/06/12 08:59:35 [error] 1487#0: *1198 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/d8.php.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , req$
    2018/06/12 09:00:30 [error] 1487#0: *1220 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/drupal/wp-login.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: , r$
    2018/06/12 09:12:40 [error] 1487#0: *1341 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /?q=user HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5$
    2018/06/12 09:14:02 [error] 1487#0: *1347 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /?q=user HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5$

Be the first one to answer this question.