Relays: the size of a splice() pipe given to a service, -b,SIZE

-b, which made a service read less at once into a connection's buffer,
takes the size of its pipes after a comma: -b,262144, -b8192,32768.
From 4096 to 64M (MAXPIPESIZE); a pipe the system will not make so
large (pipe-max-size for an unprivileged process) is not used, and the
data is copied, as with -DPIPESIZE, which stays the default for a
service given none. sockmap() and the callbacks' relay fill a pipe up
to the service's size (SRVPIPESIZE()), and only a pipe of other than
64K costs an fcntl() as it is made.

The man page tells of -b, which it did not before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir DubrovinandClaude Opus 5.5 committed 2026-10-28 13:20:42 +03:00
1 parent add40b1d85
commit a6402010a4
6 files changed
+44 -21

No files matched your search

+11
View File
@@ -229,6 +229,17 @@ the filters see all of the data, nor does one ending or beginning TLS, unless
the kernel does TLS for it both ways (\fBssl_ktls\fR). Available in builds with
WITHSPLICE, the default on Linux.
.br
.B -b
\fISIZE\fR[\fB,\fIPIPESIZE\fR] (for TCP services) read at most \fISIZE\fR bytes at
once into a connection's buffer: less than the 16K it has, never more.
\fIPIPESIZE\fR (Linux, with \fB-s\fR) makes the pipes of splice() hold that many
bytes instead of 64K, from 4096 to 67108864, e.g. \fB-b,262144\fR: the
system rounds it up to a power of 2 pages, and gives an unprivileged process
no more than /proc/sys/fs/pipe-max-size (1M by default). A pipe that cannot
be made so large is not used, and the data is copied. Larger pipes move more
at once and take more kernel memory for each connection; 64K was as fast as
larger ones in our tests.
.br
.B -C
(for TCP services) a connection closed by any of the sides terminates the
session, buffered data is delivered before the sockets are closed. By default