From dad11f59a54ab81f08d442a3eae318604c11d273 Mon Sep 17 00:00:00 2001 From: Hubert Bugaj Date: Tue, 12 May 2026 10:40:42 +0200 Subject: [PATCH] chore: increase listen backlog --- src/utils/net.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/net.rs b/src/utils/net.rs index 9737cdb9ff5f..6faf28de05ef 100644 --- a/src/utils/net.rs +++ b/src/utils/net.rs @@ -31,8 +31,9 @@ use url::Url; /// kernel silently drops the completed handshakes and clients only retry /// after `TCP_RTO_MIN` (~1s on Linux). The kernel further clamps the /// requested backlog to `/proc/sys/net/core/somaxconn`, so it is safe to -/// ask for a large value. -const MIN_LISTEN_BACKLOG: u32 = 1024; +/// ask for a large value. 4096 matches the Linux default `somaxconn` on +/// kernels 5.4 and newer, and what Lotus and most other servers use. +const MIN_LISTEN_BACKLOG: u32 = 4096; /// Bind a TCP listener with an explicit listen backlog, floored at /// [`MIN_LISTEN_BACKLOG`]. Use this for any externally-facing listener that