How nginx stream module reuse tcp connections?

allenhe nginx-forum at
Mon Mar 8 02:03:48 UTC 2021

Thanks for the reply!

So, if there is no error and the downstream/upstream didn't actively close
the connection,  the nginx won't timeout and close the tcp connection with
the downstream or with the upstream at all?  is that correct? and I suppose
the SO_KEEPALIVE option is turn on by default on connection sockets, right?

The "session" refers to  the ngx_stream_session_t in the source code, I want
to know if the tcp load balance (select upstream) is triggered just once per
"session" just like http does with ngx_http_request_t?


Posted at Nginx Forum:,290851,290909#msg-290909

More information about the nginx mailing list