I have a question about nginx tune.
I have an application which I want execute 200 times every second.
I created bash file and used wget with bqO switch for execute.
But it has a problem.
When the number of requests is greater than 100. nginx not responses to another request and stuck into loading until one request done.
However I set pm.max_children and set worker_connections to 200.
Do you have a any suggest for solve this or is there any tuner like "MySQL Tuner" for tune nginx.
my configs: php-fpm55.conf:
pm = ondemand pm.max_children = 1024 pm.start_servers = 20 pm.min_spare_servers = 20 pm.max_spare_servers = 35 pm.max_requests = 256 pm.process_idle_timeout = 20
net.core.somaxconn=4096
sysctl.conf:
- net.ipv4.tcp_window_scaling = 1
- net.core.rmem_max = 16777216
- net.core.wmem_max = 16777216
- net.ipv4.tcp_rmem = 4096 87380 16777216
- net.ipv4.tcp_wmem = 4096 65536 16777216
- net.ipv4.ip_local_port_range = 1024 65000
nginx.conf:
- worker_processes 8;
- worker_rlimit_nofile 1024000;
events {
- worker_connections 10240;
- use epoll;
- multi_accept on;
}
- sendfile on;
- keepalive_timeout 2;
- types_hash_max_size 2048;
- server_tokens off;
- client_max_body_size 1024m;
- client_body_buffer_size 128k;
- server_names_hash_bucket_size 128;
- server_names_hash_max_size 10240;
- fastcgi_buffers 8 16k;
- fastcgi_buffer_size 32k;
- fastcgi_connect_timeout 300;
- fastcgi_send_timeout 300;
- fastcgi_read_timeout 300;
result: ab -n 100 -c 10 myindex.php
Server Software: nginx
Server Port: 80
Document Length: 3 bytes
Concurrency Level: 10
Time taken for tests: 21.128 seconds
Complete requests: 100
Failed requests: 32
(Connect: 0, Receive: 0, Length: 32, Exceptions: 0)
Total transferred: 17500 bytes
HTML transferred: 515 bytes
Requests per second: 4.73 [#/sec] (mean)
Time per request: 2112.791 [ms] (mean)
Time per request: 211.279 [ms] (mean, across all concurrent requests)
Transfer rate: 0.81 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 1
Processing: 19 1334 2747.0 144 15734
Waiting: 19 1334 2747.0 144 15733
Total: 19 1334 2746.9 144 15734
Percentage of the requests served within a certain time (ms)
50% 144
66% 549
75% 1281
80% 1700
90% 4095
95% 8790
98% 12579
99% 15734
100% 15734 (longest request)