<div dir="ltr">Hi,<br><br><div>Probably an issue associated with backlog and/or timewait. If the backlog queue or the timewait bucket is full, the new connection request will be dropped by tcp, before Nginx even accepting the connection, so you can't see error log in Nginx.</div><div><br></div><div>To increase the backlog queue, you can increase the system tcp configuration `net.core.somaxconn`, `net.ipv4.tcp_max_syn_backlog` and the nginx config `listen backlog=xxxx`. The former is the system-level limit, the latter is the process-level limit.</div><div><br></div><div>To avoid timewait bucket overflow, you can increase the system tcp configuration `net.ipv4.tcp_max_tw_buckets` or enable the `net.ipv4.tcp_tw_reuse`.</div><div><br></div><div>In addition, enlarging the ip/port range of the client side may also be helpful. </div><div><br></div><div>BTW, you can use `ss` or `netstat` to observe the backlog of the listening socket which corresponds to the `Send-Q` and `Recv-Q` fields of the output. The kernel log can also gives you some information. If I remember correctly, there is a kernel log when timewait bucket overflow occurs.<br><br>Hope it helps.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Reinis Rozitis <<a href="mailto:r@roze.lv">r@roze.lv</a>> 于2022年10月27日周四 19:46写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> We are using the hey (<a href="https://github.com/rakyll/hey" rel="noreferrer" target="_blank">https://github.com/rakyll/hey</a>) tool to pump 50k requests per second and are seeing only 40k requests being received on the backend application side.<br>
> Any other tcp configuration that needs to be tuned ?<br>
<br>
I am not familiar with the tool but per documentation it should have some sort of error status report for the failed requests What it is for the 10k "missing" requests?<br>
<br>
Are they "missing" (already) on nginx or just on the proxied backend(s)? <br>
(in the provided nginx configuration I don't see any access/error log configuration - you could enable both to see if you actually get those 50k requests to nginx).<br>
<br>
Are you testing from a single client (same server) or multiple?<br>
Do you use keepalive or new connection per request (in the case of later might come close to the ephemeral port limit (~65k) depending on if tcp_tw_reuse is or isn’t configured)? <br>
<br>
Have you tried with other tools like 'ab', 'httperf' or 'siege' to see if you get the same results/problems?<br>
<br>
rr <br>
<br>
_______________________________________________<br>
nginx mailing list -- <a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
To unsubscribe send an email to <a href="mailto:nginx-leave@nginx.org" target="_blank">nginx-leave@nginx.org</a><br>
</blockquote></div>