<div dir="ltr">To summarize:<div>TCP balancing decision is on every new connection.</div><div>TCP balancing decision is on every packet since it is connectionless.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 23, 2016 at 9:08 AM, Maxim Konovalov <span dir="ltr"><<a href="mailto:maxim@nginx.com" target="_blank">maxim@nginx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 6/23/16 6:57 PM, Frank Liu wrote:<br>
> That makes sense for udp (connection less).<br>
> What about tcp? I assume when client initiate the connection , nginx<br>
> will pick one upstream (rr) to make a connection and send all<br>
> subsequent packets to the same upstream using the same connection.<br>
><br>
</span>Not sure I understand your request.<br>
<br>
For tcp nginx balances new connections based on the configured load<br>
balancing discipline (rr by default).<br>
<span class=""><br>
> Frank<br>
><br>
> On Thursday, June 23, 2016, Maxim Konovalov <<a href="mailto:maxim@nginx.com">maxim@nginx.com</a><br>
</span><span class="">> <mailto:<a href="mailto:maxim@nginx.com">maxim@nginx.com</a>>> wrote:<br>
><br>
> On 6/23/16 6:44 PM, Frank Liu wrote:<br>
> > Hi,<br>
> ><br>
> > In the default stream/udp/proxy setup, will nginx round robin<br>
> every<br>
> > packet or will it remembers client and send all packets from same<br>
> > client to same upstream?<br>
> ><br>
> The default is round-robin, yes.<br>
><br>
> You can enable persistent-like behaviour though:<br>
><br>
> <a href="https://www.nginx.com/resources/admin-guide/tcp-load-balancing/#hash" rel="noreferrer" target="_blank">https://www.nginx.com/resources/admin-guide/tcp-load-balancing/#hash</a><br>
><br>
> --<br>
> Maxim Konovalov<br>
><br>
> _______________________________________________<br>
> nginx mailing list<br>
</span>> <a href="mailto:nginx@nginx.org">nginx@nginx.org</a> <javascript:;><br>
> <a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
<div class="HOEnZb"><div class="h5">><br>
><br>
><br>
> _______________________________________________<br>
> nginx mailing list<br>
> <a href="mailto:nginx@nginx.org">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>
><br>
<br>
<br>
--<br>
Maxim Konovalov<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">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>
</div></div></blockquote></div><br></div>