小编Jul*_*tto的帖子

优化NGinx + PHP-FPM

我目前正在我的服务器中为我的网站运行 Nginx + PHP-FPM。今天,当我运行 Apache “ab” 工具时,我注意到响应时间很糟糕,平均 5595 毫秒和最大 17415 毫秒的响应时间。

我的 Nginx 配置文件:

worker_processes  4;
error_log  /var/log/nginx/error.log info;
events {
 worker_connections 1024;
 use epoll;
 multi_accept on;
}
http {
 server_name_in_redirect off;
 server_names_hash_max_size 10240;
 server_names_hash_bucket_size 1024;
 include    mime.types;
 default_type  application/octet-stream;
index index.html index.htm index.php;
 server_tokens off;
 sendfile on;
 tcp_nopush on;
 tcp_nodelay on;
 keepalive_timeout  15;
 gzip on;
 gzip_vary on;
 gzip_disable "MSIE [1-6]\.";
 gzip_proxied any;
 gzip_http_version 1.1;
 gzip_min_length  1400;
 gzip_comp_level  9;
 gzip_buffers  16 8k;
 gzip_types    text/plain text/xml text/css application/x-javascript application/xml image/png image/x-icon …
Run Code Online (Sandbox Code Playgroud)

php nginx php-fpm

3
推荐指数
1
解决办法
2777
查看次数

标签 统计

nginx ×1

php ×1

php-fpm ×1