9使用nginx和php-fpm。
一切正常,直到今天注意到与php有关的一切都非常缓慢。
有时我会收到错误
“504 Gateway Time-Out”
我想知道是否有办法扫描导致这种情况的原因。
谢谢
我已经完成了OPcache设置:
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
Nginx如下:
worker_processes 6;
events {
worker_connections 8096;
multi_accept on;
use kqueue;
}
worker_rlimit_nofile 40000;
http {
.....
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
client_body_buffer_size 10K;
client_header_buffer_size 1k;
client_max_body_size 8m;
large_client_header_buffers 2 1k;
gzip on;
gzip_comp_level 2;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/x-javascript text/xml text/css application/xml;
server_tokens off;
......
}
像这样的php-fpm:
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
request_terminate_timeout = 30s
request_slowlog_timeout = 10s
slowlog = /var/log/php-fpm/default/slow.log
php_admin_flag[log_errors] = on
和php.ini是这样的:
max_execution_time = 300
request_terminate_timeout = 300
全部谢谢