Nginx - Only handles exactly 500 request per second - How to increase the limit?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Nginx - Only handles exactly 500 request per second - How to increase the limit?

ayman
worker_processes auto;
pid /run/nginx.pid;
worker_rlimit_nofile 100000;
error_log /var/log/nginx/error.log crit;
events {
worker_connections 4000;
multi_accept on;
use epoll;
}

http {
include /etc/nginx/mime.types;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
directio 4m;
types_hash_max_size 2048;

client_body_buffer_size 15K;
client_max_body_size 8m;

keepalive_timeout 20;
client_body_timeout 15;
client_header_timeout 15;
send_timeout 10;

open_file_cache max=5000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 5;
open_file_cache_errors off;

gzip on;
gzip_comp_level 2;
gzip_min_length 1000;
gzip_proxied any;
gzip_types text/plain text/css application/json application/xjavascript
text/xml application/xml application/xml+rss text/javascript;

access_log off;
log_not_found off;
include /etc/nginx/conf.d/*.conf;
}

The server has 8 cores and 32 gb ram.
The load is 0.05
But nginx is not able to handle more than 500 requests per second.
The server suddenly received 1500 hits and goes down immediately. I have to
restart nginx.
Please tell me how to increase the limit

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278237,278237#msg-278237

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx - Only handles exactly 500 request per second - How to increase the limit?

Pratyush Kumar
What's the load during incident ?
Are the request for static files or PHP ?



On 23-Jan-2018 11:04 PM, agriz <[hidden email]> wrote:

worker_processes auto;
pid /run/nginx.pid;
worker_rlimit_nofile 100000;
error_log /var/log/nginx/error.log crit;
events {
worker_connections 4000;
multi_accept on;
use epoll;
}

http {
include /etc/nginx/mime.types;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
directio 4m;
types_hash_max_size 2048;

client_body_buffer_size 15K;
client_max_body_size 8m;

keepalive_timeout 20;
client_body_timeout 15;
client_header_timeout 15;
send_timeout 10;

open_file_cache max=5000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 5;
open_file_cache_errors off;

gzip on;
gzip_comp_level 2;
gzip_min_length 1000;
gzip_proxied any;
gzip_types text/plain text/css application/json application/xjavascript
text/xml application/xml application/xml+rss text/javascript;

access_log off;
log_not_found off;
include /etc/nginx/conf.d/*.conf;
}

The server has 8 cores and 32 gb ram.
The load is 0.05
But nginx is not able to handle more than 500 requests per second.
The server suddenly received 1500 hits and goes down immediately. I have to
restart nginx.
Please tell me how to increase the limit

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278237,278237#msg-278237

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx



_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx - Only handles exactly 500 request per second - How to increase the limit?

ayman
In reply to this post by ayman
Sir,

I can see any message there.
Additionally, There are the sysctl.conf file i modified

net.ipv6.conf.all.accept_ra=2
net.core.rmem_max = 16777216
net.core.rmem_default = 31457280
net.ipv4.tcp_rmem = 4096 87380 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_wmem = 4096 16384 16777216
net.ipv4.tcp_mem = 65536 131072 262144
net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.udp_rmem_min = 16384
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_fin_timeout = 20
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_tw_reuse = 1
net.core.netdev_max_backlog = 10000
net.core.somaxconn = 4096
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.ip_local_port_range = 15000 61000
kernel.pid_max = 65535
fs.inotify.max_queued_events = 2000000
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 15
net.core.optmem_max = 25165824
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
fs.inotify.max_user_watches=100000

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278237,278246#msg-278246

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx - Only handles exactly 500 request per second - How to increase the limit?

Payam Chychi

On Tue, Jan 23, 2018 at 9:22 PM agriz <[hidden email]> wrote:
Sir,

I can see any message there.
Additionally, There are the sysctl.conf file i modified

net.ipv6.conf.all.accept_ra=2
net.core.rmem_max = 16777216
net.core.rmem_default = 31457280
net.ipv4.tcp_rmem = 4096 87380 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_wmem = 4096 16384 16777216
net.ipv4.tcp_mem = 65536 131072 262144
net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.udp_rmem_min = 16384
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_fin_timeout = 20
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_tw_reuse = 1
net.core.netdev_max_backlog = 10000
net.core.somaxconn = 4096
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.ip_local_port_range = 15000 61000
kernel.pid_max = 65535
fs.inotify.max_queued_events = 2000000
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 15
net.core.optmem_max = 25165824
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
fs.inotify.max_user_watches=100000

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278237,278246#msg-278246

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx

What does ulimit show?

--
Payam Tarverdyan Chychi
Network Security Specialist / Network Engineer

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx - Only handles exactly 500 request per second - How to increase the limit?

nginx mailing list
500 requests max sounds very much like the default max_requests parameter from PHP-FPM process manager.

Btw, the configuration snippet you provided is incomplete (include [...]/*.conf). How can people help you?
Have a look at nginx -T.
---

B. R.

On Wed, Jan 24, 2018 at 7:08 AM, Payam Chychi <[hidden email]> wrote:

On Tue, Jan 23, 2018 at 9:22 PM agriz <[hidden email]> wrote:
Sir,

I can see any message there.
Additionally, There are the sysctl.conf file i modified

net.ipv6.conf.all.accept_ra=2
net.core.rmem_max = 16777216
net.core.rmem_default = 31457280
net.ipv4.tcp_rmem = 4096 87380 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_wmem = 4096 16384 16777216
net.ipv4.tcp_mem = 65536 131072 262144
net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.udp_rmem_min = 16384
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_fin_timeout = 20
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_tw_reuse = 1
net.core.netdev_max_backlog = 10000
net.core.somaxconn = 4096
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.ip_local_port_range = 15000 61000
kernel.pid_max = 65535
fs.inotify.max_queued_events = 2000000
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 15
net.core.optmem_max = 25165824
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
fs.inotify.max_user_watches=100000

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278237,278246#msg-278246

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx

What does ulimit show?

--
Payam Tarverdyan Chychi
Network Security Specialist / Network Engineer

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx - Only handles exactly 500 request per second - How to increase the limit?

Payam Chychi

On Wed, Jan 24, 2018 at 10:50 AM B.R. via nginx <[hidden email]> wrote:
500 requests max sounds very much like the default max_requests parameter from PHP-FPM process manager.

Btw, the configuration snippet you provided is incomplete (include [...]/*.conf). How can people help you?
Have a look at nginx -T.
---

B. R.

On Wed, Jan 24, 2018 at 7:08 AM, Payam Chychi <[hidden email]> wrote:

On Tue, Jan 23, 2018 at 9:22 PM agriz <[hidden email]> wrote:
Sir,

I can see any message there.
Additionally, There are the sysctl.conf file i modified

net.ipv6.conf.all.accept_ra=2
net.core.rmem_max = 16777216
net.core.rmem_default = 31457280
net.ipv4.tcp_rmem = 4096 87380 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_wmem = 4096 16384 16777216
net.ipv4.tcp_mem = 65536 131072 262144
net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.udp_rmem_min = 16384
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_fin_timeout = 20
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_tw_reuse = 1
net.core.netdev_max_backlog = 10000
net.core.somaxconn = 4096
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.ip_local_port_range = 15000 61000
kernel.pid_max = 65535
fs.inotify.max_queued_events = 2000000
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 15
net.core.optmem_max = 25165824
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
fs.inotify.max_user_watches=100000

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278237,278246#msg-278246

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx

What does ulimit show?

Google “Linux ulimit” or man ulimit 


--
Payam Tarverdyan Chychi
Network Security Specialist / Network Engineer

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
--
Payam Tarverdyan Chychi
Network Security Specialist / Network Engineer

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx