<div dir="ltr">Hi, <div><br></div><div>I use Nginx as front end Engine for handling huge Traffic, we receive around 30k qps and have kept 5 Nginx under ELB (Elastic Load Balancer), each handling 6 k qps.</div><div><br></div>
<div>I am using the Nginx Upstream module for connecting with the backend server, my Backend server is able to handle only 300qps, we use Nginx for mainly for throttling the request. </div><div><br></div><div>But to my surprise on increasing the throttling limit to more than 100 qps, then Nginx is able to handle only around 1000, with throttling rate set to 1500qps, its able to handle only 250. </div>
<div><br></div><div>The following is the configuration i am using. </div><div><br></div><div>worker_processes auto;<br></div><div><br></div><div><div>events {</div><div> use epoll;</div><div> multi_accept on;</div>
<div> worker_connections 9046;<br></div><div>}</div></div><div><br></div><div>http {</div><div><br></div><div> log_format main '$remote_addr - $remote_user [$time_local] "$request" '</div><div> '$status $body_bytes_sent "$http_referer" '</div>
<div> '"$http_user_agent" "$http_x_forwarded_for"';</div><div><br></div><div> access_log off; </div><div> error_log /dev/null crit;</div><div> </div>
<div> sendfile on;</div><div> tcp_nopush on;</div><div><br></div><div> keepalive_timeout 0 <br></div><div><div><br></div><div><b> limit_req_zone $binary_remote_addr zone=jai:100m rate=1500r/s;</b></div>
<div><b><br></b></div><div><b> upstream backend</b></div><div><b> {</b></div><div><b> server <a href="http://127.0.0.1:5555">127.0.0.1:5555</a>;</b></div><div><b> }</b></div></div><div><br></div><div><div>
server {</div><div> listen 80 backlog=16384;</div><div> server_name localhost;</div></div><div><br></div><div><div> location /jai {</div><div><br></div><div> keepalive_timeout 60;</div>
<div> keepalive_requests 10000;</div><div><br></div><div><b> proxy_pass <a href="http://backend">http://backend</a>;</b></div><div><b> proxy_set_header Connection "keep-alive";</b></div>
<div><b> limit_req zone=jai burst=1000 nodelay;</b></div><div><br></div><div> access_log logs/dsp-access.log main buffer=32k;</div><div> error_log logs/dsp-error.log crit;</div>
<div> }</div><div><br></div></div><div>Please let me know how to make Nginx handle more request with throttle enable with the backend servers.</div><div><br></div><div>Thanks in advance, </div><div><br></div><div>Jaysingh Samuel</div>
</div>