Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Re: FPM - fails high / low loads

$
0
0
Updating the somaxconn to 10240 I was able to get the socket to work.. and I changed a few other things but see below for ref.. hope this helps others out there.

Nginx config
fastcgi_pass 127.0.0.1:9000; now is
fastcgi_pass unix:/var/run/php5-fpm.sock;

changed all the timeouts to 20
fastcgi_connect_timeout 20;
fastcgi_send_timeout 20;
fastcgi_read_timeout 20;
FPM config
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
listen.backlog = -1
is now
listen = /var/run/php5-fpm.sock
listen.allowed_clients = 127.0.0.1
listen.backlog = 10240

and the changed one item in the sysctl.conf
net.core.somaxconn = 10240

for my PHP FPL config
[global]
pid = run/php-fpm.pid
error_log = /var/log/nginx/fpm.log

[www]
listen = /var/run/php5-fpm.sock
listen.allowed_clients = 127.0.0.1
listen.backlog = 10240

user = nobody
group = nobody

pm.status_path = /status
ping.path = /ping

pm = dynamic
pm.max_children = 150
pm.start_servers = 20
pm.min_spare_servers = 10
pm.max_spare_servers = 30
pm.max_requests = 15000
request_terminate_timeout = 20s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = no

request_slowlog_timeout = 5s
slowlog = /var/log/nginx/fpm_slow.log




Running
ab -r -k -n 100000 -c 5000 http://172.16.33.46/?ip

I can get a 100% success rate.. now onto figuring out how to get a 100% success rate on the connections to mongo.. as I’m getting



[24-Jun-2013 12:53:14] [pool www] pid 9269
script_filename = /www/index.php
[0xb778e8d4] __construct() /www/index.php:9
[0xb778dd30] mdb() /www/index.php:52
[0xb778d8a0] +++ dump failed

[24-Jun-2013 12:49:56] [pool www] pid 8836
script_filename = /www/index.php
[0xb778dd30] update() /www/index.php:57
[0xb778d8a0] +++ dump failed

On 100K requests I max out all 150 processes and 350-400 of them fail with the above errors which is mostly the connection to mongo in php.

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>