我的服务器有以下规格
CPU: 6 Cores Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz RAM: 32 GB
我有一个nginx + php-fpm的问题。 由于不明原因,他们占用了太多的资源。 即使我重新启动nginx + php-fpm启动过程将使用许多资源。
我的nginxconfiguration如下:
user nginx; worker_processes auto; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; worker_rlimit_nofile 300000; events { worker_connections 6000; use epoll; } 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; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf;
}
我的php-fpm池configuration如下
[www] user = nginx group = nginx listen = /var/run/php5-fpm.sock listen.owner = nginx listen.group = nginx listen.allowed_clients = 127.0.0.1 pm = ondemand pm.max_children = 1500; pm.process_idle_timeout = 5; chdir = / security.limit_extensions = .php
我正在使用pm.ondemand,因为我的网站必须同时支持多个并发连接,而我无法通过dynamic/静态连接。
我猜这不是问题,因为正如我之前说的,当我重新启动nginx + php-fpm的时候,他们在没有任何请求的情况下占用了太多的资源。
以下是CPU使用情况的截图
http://s28.postimg.org/v54q25zod/Untitled.png