Sockets closed without SO_LINGER

Client, outgoing and FTP data sockets, and the inetd socket of a
standalone service, were given SO_LINGER, the client's for the long
string timeout (60 seconds by default), the outgoing one's for the
LINGER timeout. It kept nothing from being lost: without it the system
sends what is queued after the close all the same, and the time running
out reset the connection, losing what was still queued. All it did was
make close() wait for the peer to acknowledge the data, holding the
connection's thread and maxconn slot meanwhile, and, for clients served
on an event loop, every client of the loop: with one loop it was idle a
quarter of the time in a benchmark of many short exchanges.

The LINGER timeout keeps its use: how long a half-closed connection
waits for the rest of its data, and how long httpsrv reads what is left
of a request before closing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir DubrovinandClaude Opus 5.5 committed 2026-10-25 01:00:48 +03:00
1 parent c55f736a0d
commit 43f40569d4
6 files changed
+11 -39

No files matched your search

+5 -3
View File
@@ -526,9 +526,11 @@ can use %A as produced archive name and %F as filename.
\fBCHAIN\fR timeout for reading data from chained connection
.br
\fBLINGER\fR timeout to deliver buffered data after one of the sides has closed
its sending side, also used as SO_LINGER value on outgoing connections. Too small
value may cause the tail of the data to be lost on slow connections, too large one
delays release of the sockets.
its sending side, and for httpsrv to read what is left of a request before it
closes the connection. Too small value may cause the tail of the data to be
lost on slow connections, too large one delays release of the sockets.
Sockets are closed without SO_LINGER: the system sends what is queued after
the close, the connection's thread and slot freed at once.
.br
default timeouts 1 5 30 60 180 1800 15 60 15 5 5
.br