<div dir="ltr"><div>Hi!</div><div>I have to admit, my previous "details" were somewhat vague - by "tons of traffic" i meant exactly what you described - a huge number of shortlived connections per second (some millions in a few seconds)<br></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 9, 2021 at 5:27 PM Maxim Dounin <<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<br>
On Sat, May 08, 2021 at 10:01:19AM +0200, Charlie Kilo wrote:<br>
<br>
> Thanks Maxim for further explaining!<br>
> <br>
> We do listen to a huge number of IPs with tons of traffic and huge spikes<br>
> on them. We really need to avoid any type<br>
> of congestion, therefore the reuseport.<br>
> <br>
> While many of the ip:port combos are simply there for failover purposes and<br>
> actually aren't "in use", I see right now<br>
> no feasible way to reduce the number of listening sockets before the<br>
> upgrade and restore them afterwards. That would be hugely complex,<br>
> error-prone and would still leave us with a window where the instant<br>
> failover wouldn't work as expected.<br>
<br>
Thanks for the details.<br>
<br>
Note that "reuseport" doesn't help with "tons of traffic". It can <br>
help in the special case when there are a lot of new connections <br>
are established per second, and all these connections are <br>
short-lived, so a large part of CPU time is spent in establishing <br>
new connections.<br>
<br>
Further, "reuseport" doesn't help if there are already multiple <br>
listening sockets, and new connections are already distributed <br>
between these sockets. Its main use is when you have only one <br>
listening socket and want to reduce lock contention on this socket <br>
by providing additional listening sockets.<br>
<br>
The only case when "reuseport" is unavoidable in nginx now is when <br>
you want to handle UDP proxying with sessions.<br>
<br>
-- <br>
Maxim Dounin<br>
<a href="http://mdounin.ru/" rel="noreferrer" target="_blank">http://mdounin.ru/</a><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div>