Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My Server has the following Specs

CPU: 6 Cores Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
RAM: 32 GB

I have a problem with nginx+php-fpm. They are taking too many resources for an unknown reason. Even if i restart the nginx + php-fpm the start up processes will use many resources.

My nginx Config is the following:

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/;

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;


My php-fpm pool config is the following

user = nginx
group = nginx
listen = /var/run/php5-fpm.sock
listen.owner = nginx = nginx
listen.allowed_clients =
pm = ondemand
pm.max_children = 1500;
pm.process_idle_timeout = 5;
chdir = /
security.limit_extensions = .php

I'm using on pm.ondemand since my website has to support many concurrent connections at the same time and i was unable to to it with dynamic/static.

I guess this isnt the problem because as i said earlier when i restart nginx+php-fpm at the same time, they are taking too much resources without any request.

Here is the screenshot with the CPU Usage
share|improve this question
What do you mean by "too many resources"? –  Michael Hampton Jun 8 '14 at 12:18
Look the image. it uses a lot of CPU –  user3393046 Jun 8 '14 at 13:35
I didn't see a lot of CPU being used in your image. Please be more specific. –  Michael Hampton Jun 8 '14 at 13:37
Mate, its 33.0% and 34.6% for just 2 php-fpm processes! And the normal is 1% or less. I have some other servers that uses only 0-1% and 0% memory. Here my CPU Is full due to these processes –  user3393046 Jun 8 '14 at 13:55
OK, then you need to look at your application. –  Michael Hampton Jun 8 '14 at 14:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.