我想问一下nginx web服务器,当访问网络很多时,然后服务器关闭并得到错误代码502/504,我在网络服务器中使用varnish 4和端口8000,物理服务器有以下规格:
8个CPU内核 16GB RAM
对于nginx配置如下:
user nginx;
worker_processes 8;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
fastcgi_buffers 256 16k;
fastcgi_buffer_size 256k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_max_temp_file_size 0;
......
}
虽然在php-fpm中如下:
pm = dynamic
pm.max_children = 246
pm.start_servers = 32
pm.min_spare_servers = 32
pm.max_spare_servers = 64
请帮助我感到困惑,我按照我从几个来源找到的一些建议,但仍然失败了,谢谢
此致 Janitra Panji
答案 0 :(得分:1)
您询问的HTTP状态代码都是在related Wikipedia page
上定义的全部表明您的Nginx反向代理服务器背后的服务由于某种原因而停止运行。您应该研究后端服务器的调优。很可能存在这个问题,而不是Nginx。