Add TCP_NOTSENT_LOWAT setting

This commit is contained in:
9seconds
2026-04-07 15:39:26 +02:00
parent 2f62e8055d
commit 0de8b28de8
4 changed files with 36 additions and 0 deletions
+8
View File
@@ -55,6 +55,14 @@ const (
// tcpLingerTimeout defines a number of seconds to wait for sending
// unacknowledged data.
tcpLingerTimeout = 1
// tcpNotSentLowat limits the amount of unsent data queued in the
// kernel write buffer per socket. When the unsent data drops below
// this threshold, the socket becomes writable again. This reduces
// per-connection memory usage and bufferbloat by applying
// back-pressure to the relay loop instead of piling up data in
// kernel buffers.
tcpNotSentLowat = 128 * 1024
)
var (