[OpenSIPS-Users] tcp_async timeouts confusion

Liviu Chircu liviu at opensips.org
Tue Jan 9 04:19:44 EST 2018


Hi, Steve!

The transport layer was heavily refactored roughly three years ago, see 
[1], [2] and [3] for the relevant commits which, indeed, bumped the 
default connect timeout down a lot, to a much lower value (10s -> 
100ms). Although 100ms might seem unnecessary (it's async! let it sleep 
as long as it wants!), keep in mind that the TLS support isn't async at 
all, yet it will also make use of the same, default 
"tcp_connect_timeout" - a 10s default here is quite bad for high traffic 
volume TLS proxies which often need to open up lots of TCP/TLS connections.

All in all, the "tcp_connect_timeout" should not get ignored at all. The 
"tcp_async_local_connect_timeout" [4] is the first one that hits, after 
which the connect waiting will be performed by a non-TCP worker, up to 
"tcp_connect_timeout" milliseconds. If it doesn't behave like this, let 
us know, and we'll look into it more.

Best regards,

[1]: https://github.com/OpenSIPS/opensips/commit/b343ca1c
[2]: https://github.com/OpenSIPS/opensips/commit/78c84620
[3]: https://github.com/OpenSIPS/opensips/commit/11aedc6
[4]: 
http://www.opensips.org/html/docs/modules/2.4.x/proto_tcp.html#idp5544000

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 08.01.2018 22:38, Steve Brisson wrote:
>
> Hi,
>
> I've run into some issues related to tcp_async and tcp/tls timeouts 
> since upgrading opensips from v1.8 to v2.3.
>
> Based on my v1.8 config, I had the tcp_connect_timeout set to 3 secs 
> but this gets ignored in v2.3 because tcp_async is enabled by default. 
> As a result, calls made from a local opensips endpoint to a remote 
> registered endpoint (through a cisco vcs) were failing. I then noticed 
> that the tcp/tls timeouts were aggressively reduced from 10-30s to 
> 100ms by default with the tcp_async feature.
>
> My main questions are:
>
> - How is the tcp_async feature supposed to function if the 
> tcp_async_local_connect_timeout expires? The code seems to imply that 
> the socket gets put onto a tcp main thread and handled.
>
> - 100ms seems pretty short as a default for these timeouts, especially 
> tls. Does a timeout result in the sip request getting cancelled or is 
> there still some processing that can occur after because of handling 
> on the tcp main thread.
>
> In short, I'm a confused about what the tcp_async feature does and how 
> the timeouts should be set. Any explanations would be greatly appreciated.
>
> Thanks for your time.
>
> steve
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180109/fda8bd7b/attachment.html>


More information about the Users mailing list