Welcome! Log In Create A New Profile

Advanced

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

Posted by agriz 
Nginx - Only handles exactly 500 request per second - How to increase the limit?
January 23, 2018 10:18AM
It is a 8 core system. 32 gb ram. But only 500 connections are accepted per second.
I optimized network settings and nginx settings.

I can pay. But i cant give server details.
You have to fix the problem.

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;
}

sysctl.conf

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

Please tell your price in $
Re: Nginx - Only handles exactly 500 request per second - How to increase the limit?
February 02, 2018 02:25PM
are you missing

ulimit for user

in etc/security/limit.conf

in shell

check ulimit -sn is this value 500

ulimit -hn

ulimit -u

set this unlimit -u unlimited

for the user

and check again
ulimit -u

add this lines to /etc/security/limits.conf (restart nginx)

www-data soft nproc 100000
www-data soft nofile 100000


reboot sys test with seige

<a href="http://theonlineking.com">raju ginne</a>



[url=http://theonlineking.com] raju [/]
Re: Nginx - Only handles exactly 500 request per second - How to increase the limit?
February 02, 2018 02:39PM
are you missing

ulimit for user

in etc/security/limit.conf

in shell

check ulimit -sn is this value 500

ulimit -hn

ulimit -u

set this unlimit -u unlimited

for the user

and check again
ulimit -u

add this lines to /etc/security/limits.conf (restart nginx)

www-data soft nproc 100000
www-data soft nofile 100000


ps auxw | grep nginx
root 8762 0.0 0.0 12944 944 pts/0 S+ 19:36 0:00 grep --color=auto nginx
root 20624 0.0 0.1 162100 12280 ? Ss Feb01 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 24480 0.0 0.1 162324 13256 ? S 17:43 0:03 nginx: worker process
www-data 24481 0.0 0.1 162324 13180 ? S 17:43 0:03 nginx: worker process
www-data 24482 0.0 0.1 162324 13184 ? S 17:43 0:02 nginx: worker process
www-data 24483 0.0 0.1 162324 13176 ? S 17:43 0:02 nginx: worker process
www-data 24484 0.0 0.1 162100 9032 ? S 17:43 0:00 nginx: cache manager process



cat /proc/nginxpid/limits


cat /proc/20624/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 31878 31878 processes
Max open files 1024 4096 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 31878 31878 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us

reboot sys test with seige
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 94
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready