By rwdev
My Wordpress blog has been getting 504 errors practically every time I try to load a page in the admin panel or on the site. I used to get those occasionally but now it’s happening all the time.
My plan has 1 CPU and 1GB memory. I’m running the blog on an Ubuntu 14.04 server with nginx, mysql, and php5-fpm.
The nginx error logs show:
[error] 4405#0: *191 upstream timed out (110: Connection timed out) while reading response header from upstream, client: w.x.y.z, server: a.b.c.d, request: "GET /page-name/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "my.domain", referrer: "http://my.domain/blog/"
This is my site’s nginx conf file:
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
root /var/www/html;
index index.php index.html index.htm;
server_name w.x.y.z;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
This is my php5 pool.d/www.conf file:
[www]
user = www-data
group = www-data
listen = 127.0.0.1:9000
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 200
request_terminate_timeout = 30s
chdir = /
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @rwdev,
Your issue is related to a FastCGI problem. To resolve it please follow these steps:
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
reload Nginx configuration with the command: service nginx reload (or equivalently, run the command: nginx -s reload)
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
as this is related to one of the error messages in the log output that you provided.
Regards, KDSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.