【发布时间】:2014-09-30 10:19:26
【问题描述】:
我在 2GB ram/2x CPU digitalocean vps 上运行 wordpress 3.9.1,在 debian 7 x64 下使用 nginx 和 php5-fpm 在 tcp/ip 127.0.0.1:9000 上。我遇到大量 504 网关超时。 nginx 日志输出为: 上游超时(110:连接超时)同时连接到上游或 从上游读取响应头时上游超时(110:连接超时)
www.conf:
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 25
pm.start_servers = 4
pm.min_spare_servers = 4
pm.max_spare_servers = 8
pm.max_requests = 200
listen_backlog = 65536
request_terminate_timeout = 30
php.ini:
max_execution_time = 30
nginx.conf:
worker_processes 2;
worker_connections 1024;
client_max_body_size 10M;
fastcgi_read_timeout 30s;
client_header_timeout 30s;
client_body_timeout 30s;
fastcgi_send_timeout 30s;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
keepalive_timeout 65;
gzip on;
The recommended settings of DO for the sysctl.conf are:
# Digital Ocean Recommended Settings:
net.core.wmem_max=12582912
net.core.rmem_max=12582912
net.ipv4.tcp_rmem= 10240 87380 12582912
net.ipv4.tcp_wmem= 10240 87380 12582912
the following was removed completely:
php5-fpm.conf (/etc/nginx/conf.d/):
upstream php5-fpm-sock {
server unix:/var/run/php5-fpm.sock;
}
我还尝试禁用我的插件,但没有成功。当 wordpress 仪表板显示“连接丢失”消息并最终出现 504 网关超时时,网站变得无响应。
有类似经历的人吗? 任何建议,将不胜感激。 谢谢。
【问题讨论】: