当我testing每秒200次点击时,我在我的网站上堆积了以下错误。
首先我收到了499个错误
2017-04-09 03:22:45错误162.158.79.219 499 GET / HTTP / 1.1 0 nginx访问
2017-04-09 03:22:45错误162.158.79.87 499 GET / HTTP / 1.1 0 nginx访问
- Openldap设置olcOverlay:ppolicy
- LXC客户操作系统安装
- 奇怪的错误与CentOS 7上的Apache
- 无法启用mysqld服务,但在重新启动服务运行在centos 7上
- 当从CentOS上的NFS v4读取时,是什么原因导致input/输出错误?
2017-04-09 03:22:45错误162.158.78.170 499 GET / HTTP / 1.1 0 nginx访问
2017-04-09 03:22:45错误162.158.78.68 499 GET / HTTP / 1.1 0 nginx访问
第二个错误开始显示502
2017-04-09 03:22:45错误162.158.79.135 502 GET / HTTP / 1.1 166 nginx访问
2017-04-09 03:22:45错误162.158.79.225 502 GET / HTTP / 1.1 166 nginx访问
2017-04-09 03:22:45错误162.158.78.110 502 GET / HTTP / 1.1 166 nginx访问
2017-04-09 03:22:45错误162.158.79.225 502 GET / HTTP / 1.1 166 nginx访问
最后我开始接收php-fpm.sock failed错误
2017-04-09 03:22:45错误162.158.79.207 20699#0:* 3826365连接()到unix:///var/www/vhosts/system/playhdpk.top/php-fpm.sock失败(11:资源暂时不可用),同时连接到上游的nginx错误
2017-04-09 03:22:45错误162.158.79.207 20695#0:* 3826367 connect()unix:///var/www/vhosts/system/playhdpk.top/php-fpm.sock失败(11:资源暂时不可用),同时连接到上游的nginx错误
2017-04-09 03:22:45错误162.158.79.207 20697#0:* 3826369 connect()unix:///var/www/vhosts/system/playhdpk.top/php-fpm.sock失败(11:资源暂时不可用),同时连接到上游的nginx错误
我的php-fpm-pool-settings在下面,我相信这个正在产生错误,可能是我错了
listen.backlog = 65535 ;[php-fpm-pool-settings] pm = dynamic pm.max_children = 5000 pm.start_servers = 50 pm.min_spare_servers = 20 pm.max_spare_servers = 70 pm.max_requests = 2000
我的nginx conf在下面
user nginx; worker_processes 8; # number of file descriptors used for nginx # the limit for the maximum FDs on the server is usually set by the OS. # if you don't set FD's then OS settings will be used which is by default 2000 worker_rlimit_nofile 99999; error_log /var/log/nginx/error.log crit; include /etc/nginx/modules.conf.d/*.conf; events { worker_connections 16192; use epoll; multi_accept on; } http { include mime.types; default_type application/octet-stream; open_file_cache max=2048 inactive=20s; open_file_cache_valid 30s; open_file_cache_min_uses 5; open_file_cache_errors off; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_requests 100000; reset_timedout_connection on; client_body_timeout 30; send_timeout 15; client_header_timeout 12; proxy_connect_timeout 600s; proxy_send_timeout 600s; proxy_read_timeout 600s; fastcgi_buffers 8 128k; fastcgi_buffer_size 256k; fastcgi_send_timeout 600s; fastcgi_read_timeout 600s; types_hash_max_size 2048; gzip on; gzip_min_length 1000; gzip_proxied expired no-cache no-store private auth; gzip_types application/x-javascript text/css application/javascript text/javascript text/plain text/xml application/json application/v$ gzip_disable "MSIE [1-6]\.(?!.*SV1)"; server_tokens off; include /etc/nginx/conf.d/*.conf; }
注意 :服务器规格如下
OS CentOS 7.3
处理器:Intel Xeon E5-1620v2 – 4c / 8t – 3.7 GHz / 3.9 GH
Sever Ram:64GB DDR3
不要限制请求给他们工作免费)
pm = ondemand pm.max_children = 4000 pm.start_servers = 10 pm.min_spare_servers = 10 pm.max_requests = 0