Php-fpm requests eventually goes to queue !!

shahzaib shahzaib shahzaib.cb at gmail.com
Thu May 22 08:31:55 UTC 2014


Following is the nginx config :

user  nginx;
# no need for more workers in the proxy mode
worker_processes  16;
error_log  /var/log/nginx/error.log crit;
worker_rlimit_nofile 409600;
events {
 worker_connections 10240; # increase for busier servers
 use epoll; # you should use epoll here for Linux kernels 2.6.x
}
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;
 server_tokens off;
 sendfile on;
 tcp_nopush on;
 tcp_nodelay on;
 keepalive_timeout  5;
 gzip on;
 gzip_vary on;
 gzip_disable "MSIE [1-6]\.";
 gzip_proxied any;
 gzip_http_version 1.1;
 gzip_min_length  1000;
 gzip_comp_level  6;
 gzip_buffers  16 8k;
# You can remove image/png image/x-icon image/gif image/jpeg if you have
slow CPU
 gzip_types    text/plain text/xml text/css application/x-javascript
application/xml application/xml+rss text/javascript application/atom+xml;
 ignore_invalid_headers on;
 client_header_timeout  3m;
 client_body_timeout 3m;
 send_timeout     3m;
 reset_timedout_connection on;
 connection_pool_size  256;
 client_header_buffer_size 256k;
 large_client_header_buffers 4 256k;
 client_max_body_size 200M;
 client_body_buffer_size 128k;
 request_pool_size  32k;
 output_buffers   4 32k;
 postpone_output  1460;
 client_body_in_file_only on;
 log_format bytes_log "$msec $bytes_sent .";
 include "/etc/nginx/conf.d/virtual.conf";
}





On Thu, May 22, 2014 at 1:27 PM, Lord Nynex <lordnynex at gmail.com> wrote:

> This does not seem like an nginx issue?
>
>
> On Thu, May 22, 2014 at 1:24 AM, shahzaib shahzaib <shahzaib.cb at gmail.com>wrote:
>
>> These are the new status for php-fpm now :
>>
>> pool:                 stats
>> process manager:      dynamic
>> start time:           22/May/2014:12:17:39 +0500
>> start since:          3975
>> accepted conn:        866645
>> listen queue:         0
>> max listen queue:     2163
>> listen queue len:     65535
>> idle processes:       153
>> active processes:     2
>> total processes:      155
>> max active processes: 250
>> max children reached: 4
>>
>>
>>
>>
>>
>> On Thu, May 22, 2014 at 12:37 PM, shahzaib shahzaib <
>> shahzaib.cb at gmail.com> wrote:
>>
>>> Hello,
>>>
>>>      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.
>>>
>>> php-fpm.d/stats.conf
>>>
>>> [stats]
>>> listen = 127.0.0.1:9000
>>> user = apache
>>> group = apache
>>> request_slowlog_timeout = 5s
>>> slowlog = /var/log/php-fpm/stats-slow.log
>>> listen.allowed_clients = 127.0.0.1
>>> pm = dynamic
>>> pm.max_children = 250
>>> pm.start_servers = 40
>>> pm.min_spare_servers = 20
>>> pm.max_spare_servers = 40
>>> pm.max_requests = 40000
>>> listen.backlog = -1
>>> request_terminate_timeout = 300s
>>> rlimit_files = 13107200
>>> rlimit_core = unlimited
>>> env[HOSTNAME] = $HOSTNAME
>>> env[TMP] = /tmp
>>> env[TMPDIR] = /tmp
>>> env[TEMP] = /tmp
>>> pm.status_path = /status
>>>
>>> The main config parameters of sysctl.conf :
>>>
>>> vm.overcommit_memory = 1
>>> fs.file-max = 7000000
>>> net.ipv4.tcp_max_syn_backlog = 70000
>>> net.core.netdev_max_backlog = 4096
>>> net.core.somaxconn=65535
>>> net.ipv4.tcp_tw_reuse = 1
>>> net.ipv4.tcp_tw_recycle = 1
>>> net.ipv4.ip_local_port_range = 1024 65000
>>> net.ipv4.tcp_tw_reuse = 1
>>>
>>> /etc/security/limits.conf
>>> root soft nofile 700000
>>> root hard nofile 700000
>>>
>>>
>>> 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.
>>>
>>> Any clue why requests are still getting into php-fpm  queue and max
>>> children also reached errors occuring, even max_children are 250 * 40000. ??
>>>
>>> Php-fpm status :
>>>
>>> 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
>>>
>>>
>>>
>>> Regards.
>>> Shahzaib
>>>
>>>
>>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140522/fba07409/attachment.html>


More information about the nginx mailing list