<div dir="ltr"><div><div><div><div><div><div>Hello,<br><br></div>     We're using nginx + php-fpm. Please check the following configurations in php-fpm and sysctl in order to handle large amount of php-fpm request, but still 1000+ requests are getting into queue every 15min.<br>
<br></div>php-fpm.d/stats.conf<br><br>[stats]<br>listen = <a href="http://127.0.0.1:9000">127.0.0.1:9000</a><br>user = apache<br>group = apache<br>request_slowlog_timeout = 5s<br>slowlog = /var/log/php-fpm/stats-slow.log<br>
listen.allowed_clients = 127.0.0.1<br>pm = dynamic<br>pm.max_children = 250<br>pm.start_servers = 40<br>pm.min_spare_servers = 20<br>pm.max_spare_servers = 40<br>pm.max_requests = 40000<br>listen.backlog = -1<br>request_terminate_timeout = 300s<br>
rlimit_files = 13107200<br>rlimit_core = unlimited<br>env[HOSTNAME] = $HOSTNAME<br>env[TMP] = /tmp<br>env[TMPDIR] = /tmp<br>env[TEMP] = /tmp<br>pm.status_path = /status</div><div><br></div>The main config parameters of sysctl.conf :<br>
<br>vm.overcommit_memory = 1<br>fs.file-max = 7000000<br>net.ipv4.tcp_max_syn_backlog = 70000<br>net.core.netdev_max_backlog = 4096<br>net.core.somaxconn=65535<br>net.ipv4.tcp_tw_reuse = 1<br>net.ipv4.tcp_tw_recycle = 1<br>
net.ipv4.ip_local_port_range = 1024 65000<br>net.ipv4.tcp_tw_reuse = 1<br><br></div>/etc/security/limits.conf<br>root soft nofile 700000<br>root hard nofile 700000<br><br><br>We've 72G of Ram and also writing on disk is 100+MB/s on Sas drives which makes high io util% most of the time.<br>
<br></div>Any clue why requests are still getting into php-fpm  queue and max children also reached errors occuring, even max_children are 250 * 40000. ??<br><br></div><div>Php-fpm status :<br><br><pre>pool:                 stats
process manager:      dynamic
start time:           22/May/2014:12:17:39 +0500
start since:          1140
accepted conn:        228244
listen queue:         579
max listen queue:     1970
listen queue len:     65535
idle processes:       167
active processes:     9
total processes:      176
max active processes: 250
max children reached: 1</pre><br></div><div><br></div><div>Regards.<br>Shahzaib<br></div><div><div><div><br><br></div></div></div></div>