Php-fpm high cpu usage :(


#1

I am new to running my own droplet, but am thankful EE exists. Any help would be appreciated. I am stumped as to why php-fpm is maxing out CPU usage. I have read everything I can on adjusting www.conf and have tried a number of things. Here is my setup:

  • 512mb droplet with digitalocean
  • small traffic on a wordpress site with around 400 posts and lots of pictures
  • (from ee site info) WPSINGLE FAST CGI (Enable)
  • followed these instructions
  • www.conf is set to pm = ondemand and pm.process_idle_timeout = 10s;
  • nginx helper plugin has purge archives turned off
  • link to website donnanphoto.com/blog

I receive this error when restarting/testing nginx:

Reloading nginx configuration: nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2014/10/10 11:30:55 [warn] 9744#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2014/10/10 11:30:55 [emerg] 9744#0: open() "/var/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed

This is my setup within fastcgi.conf

fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:50m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header updating http_500 http_503;
fastcgi_cache_valid any 1h;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SERVER_NAME $http_host;
fastcgi_ignore_headers  Cache-Control Expires Set-Cookie;

The result of running “df -h /var/run”

Filesystem      Size  Used Avail Use% Mounted on
tmpfs            50M  444K   49M   1% /run

#2

Install/setup swap

Refer: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-12-04

Seems like you are reload/restart nginx as non-sudoer user Run following command to reload/restart nginx

sudo nginx -t && sudo service nginx restart

#3

Swap is already up and running:

sudo swapon -s
Filename				Type		Size	Used	Priority
/swapfile                               file		1048572	110040	-1

HTOP screenshot


#4