Complexity of nginx

Mizan mizanniit at gmail.com
Sat Feb 18 12:04:15 UTC 2012


Hello,
Would tell me how to reduce the number of spawned php-fpm processes in
order to reduce the load in your server? Results are given below:
==================
root at server [~]# top -c
top - 10:56:37 up 6 days,  2:51,  1 user,  load average: 11.07, 10.88, 11.74
Tasks: 420 total,   1 running, 419 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.1%us,  0.3%sy,  0.9%ni, 85.8%id, 12.2%wa,  0.1%hi,  0.6%si,  0.0%st
Mem:  12289752k total,  4846176k used,  7443576k free,   267356k buffers
Swap: 14352376k total,        0k used, 14352376k free,  3884864k cached

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 8656 root      33  18 37388 6052 1364 D  1.0  0.0   0:00.03
cpanellogd - updating bandwidth
10457 nobody    25  10  136m 9.8m 7128 S  0.7  0.1   0:02.25
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
10855 nobody    15   0 46000 4324  916 D  0.7  0.0   0:07.40 nginx:
worker process
10856 nobody    16   0 46140 4432  916 D  0.7  0.0   0:07.63 nginx:
worker process
10857 nobody    15   0 45472 3800  916 S  0.7  0.0   0:07.47 nginx:
worker process
10861 nobody    15   0 45968 4192  916 D  0.7  0.0   0:06.86 nginx:
worker process
12656 nobody    25  10  136m  11m 8328 S  0.7  0.1   0:06.60
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12697 nobody    25  10  136m  11m 8508 S  0.7  0.1   0:06.57
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
19281 root      15   0 13024 1404  820 R  0.7  0.0   0:10.74 top -c
 1116 root      10  -5     0    0    0 S  0.3  0.0   3:54.81 [kjournald]
 2841 nobody    25  10  136m  10m 7772 S  0.3  0.1   0:02.82
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
 3256 nobody    25  10  136m  10m 8000 S  0.3  0.1   0:04.98
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
10452 nobody    26  10  136m  10m 7092 S  0.3  0.1   0:02.23
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
10453 nobody    25  10  136m  10m 7344 S  0.3  0.1   0:02.32
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
10460 nobody    25  10  136m 9.9m 7164 S  0.3  0.1   0:02.28
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
10461 nobody    25  10  136m   9m 7260 S  0.3  0.1   0:02.48
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
10466 nobody    25  10  136m  10m 7400 S  0.3  0.1   0:02.30
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
10831 nobody    26  10  136m  10m 8032 S  0.3  0.1   0:05.07
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
10848 nobody    16   0 45376 3664  916 D  0.3  0.0   0:07.18 nginx:
worker process
10850 nobody    15   0 45568 3828  916 S  0.3  0.0   0:07.08 nginx:
worker process
10851 nobody    15   0 45796 4068  916 S  0.3  0.0   0:07.18 nginx:
worker process
10853 nobody    15   0 46192 4524  916 S  0.3  0.0   0:07.30 nginx:
worker process
10854 nobody    15   0 45688 3888  916 S  0.3  0.0   0:07.13 nginx:
worker process
10859 nobody    15   0 46076 4468  916 D  0.3  0.0   0:07.65 nginx:
worker process
12633 nobody    25  10  136m  11m 8372 S  0.3  0.1   0:06.57
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12635 nobody    25  10  136m  11m 8656 S  0.3  0.1   0:06.65
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12637 nobody    25  10  136m  10m 7904 S  0.3  0.1   0:06.47
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12638 nobody    25  10  136m  10m 8088 S  0.3  0.1   0:06.45
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12641 nobody    25  10  136m  10m 8260 S  0.3  0.1   0:06.75
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12648 nobody    25  10  136m  11m 8272 S  0.3  0.1   0:06.44
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12650 nobody    25  10  136m  11m 8148 S  0.3  0.1   0:06.44
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12651 nobody    25  10  136m  11m 8268 S  0.3  0.1   0:06.55
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12652 nobody    25  10  136m  10m 8260 S  0.3  0.1   0:06.60
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12653 nobody    25  10  137m  11m 8380 S  0.3  0.1   0:06.49
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12654 nobody    25  10  136m  10m 7992 S  0.3  0.1   0:06.59
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12658 nobody    25  10  136m  11m 8640 S  0.3  0.1   0:06.74
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12663 nobody    25  10  136m  11m 8128 S  0.3  0.1   0:06.33
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12668 nobody    26  10  137m  11m 8600 S  0.3  0.1   0:06.76
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12669 nobody    25  10  136m  10m 8332 S  0.3  0.1   0:06.42
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12671 nobody    25  10  136m  10m 8216 S  0.3  0.1   0:06.63
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12674 nobody    25  10  136m  11m 8264 S  0.3  0.1   0:06.72
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
12676 nobody    25  10  136m  11m 8460 S  0.3  0.1   0:06.39
/usr/local/nginx-php/bin/php-cgi --fpm --fpm-config
/usr/local/nginx-php/etc/php-fpm.conf
root at server [~]#
==================

Which variables can be optimized to make the server stable. Also,
domains usually have high hits.

So far as above circumstances I ask for your co-operation.

Thank you
Mizanur Rahman



More information about the nginx mailing list