diff options
author | alexvru <alexvru@ydb.tech> | 2023-06-27 12:21:23 +0300 |
---|---|---|
committer | alexvru <alexvru@ydb.tech> | 2023-06-27 12:21:23 +0300 |
commit | 60b31269dc93b86d297c964565c892a92a34396a (patch) | |
tree | dee243f78c26ddb25bc72c9c3814a8d9f68707a7 /library/cpp/actors | |
parent | 86e59d4bc6858a17a13ea13fc55c729ae3615f1f (diff) | |
download | ydb-60b31269dc93b86d297c964565c892a92a34396a.tar.gz |
Tunable backlog size for IC
Diffstat (limited to 'library/cpp/actors')
-rw-r--r-- | library/cpp/actors/interconnect/interconnect_common.h | 1 | ||||
-rw-r--r-- | library/cpp/actors/interconnect/interconnect_tcp_server.cpp | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/library/cpp/actors/interconnect/interconnect_common.h b/library/cpp/actors/interconnect/interconnect_common.h index aa2cbe9a19..d313038094 100644 --- a/library/cpp/actors/interconnect/interconnect_common.h +++ b/library/cpp/actors/interconnect/interconnect_common.h @@ -50,6 +50,7 @@ namespace NActors { ui32 NumPreallocatedBuffers = 16; bool EnableExternalDataChannel = false; bool ValidateIncomingPeerViaDirectLookup = false; + ui32 SocketBacklogSize = 0; // SOMAXCONN if zero ui32 GetSendBufferSize() const { ui32 res = 512 * 1024; // 512 kb is the default value for send buffer diff --git a/library/cpp/actors/interconnect/interconnect_tcp_server.cpp b/library/cpp/actors/interconnect/interconnect_tcp_server.cpp index aad8677ca4..ede35b0b8b 100644 --- a/library/cpp/actors/interconnect/interconnect_tcp_server.cpp +++ b/library/cpp/actors/interconnect/interconnect_tcp_server.cpp @@ -46,9 +46,10 @@ namespace NActors { if (addr.GetFamily() == AF_INET6) { SetSockOpt(*Listener, IPPROTO_IPV6, IPV6_V6ONLY, 0); } + const ui32 backlog = ProxyCommonCtx->Settings.SocketBacklogSize; if (const auto e = -Listener->Bind(addr)) { return e; - } else if (const auto e = -Listener->Listen(SOMAXCONN)) { + } else if (const auto e = -Listener->Listen(backlog ? backlog : SOMAXCONN)) { return e; } else { return 0; |