Provided by: util-linux-locales_2.41-4ubuntu4.2_all 

BEZEICHNUNG
pipesz - Pipe- und FIFO-Puffergrößen festlegen oder untersuchen
ÜBERSICHT
pipesz [Optionen] [--set Größe] [--] [Befehl [Argument] …]
pipesz [Optionen] --get
BESCHREIBUNG
Pipes und FIFOs verwalten einen internen Puffer, der zum Übertragen von Daten zwischen der Leseseite und
der Schreibseite verwendet wird. In einigen Fällen kann die Standardgröße dieses internen Puffers den
Erfordernissen nicht entsprechen. Dieses Programm bietet Möglichkeiten, die Größe dieser Puffer zu setzen
und zu untersuchen.
The --set operation sets pipe buffer sizes. If it is specified, it must be specified with an explicit
size. Otherwise, it is implied and the size is read from /proc/sys/fs/pipe-max-size. The kernel may
adjust size as described in fcntl(2). To determine the actual buffer sizes set, use the --verbose option.
If neither --file nor --fd are specified, --set acts on standard output.
The --set operation permits an optional command to execute after setting the pipe buffer sizes. This
command is executed with the adjusted pipes.
The --get operation outputs data in a tabular format. The first column is the name of the pipe as passed
to pipesz. File descriptors are named as "fd N". The second column is the size, in bytes, of the pipe’s
internal buffer. The third column is the number of unread bytes currently in the pipe. The columns are
separated by tabs ('\t', ASCII 09h). If --verbose is specified, a descriptive header is also emitted. If
neither --file nor --fd are specified, --get acts on standard input.
Unless the --check option is specified, pipesz does not exit if it encounters an error while manipulating
a file or file descriptor. This allows pipesz to be used generically without fear of disrupting the
execution of pipelines should the type of certain files be later changed. For minimal disruption, the
--quiet option prevents warnings from being emitted in these cases.
The kernel imposes limits on the amount of pipe buffer space unprivileged processes can use, though see
BUGS below. The kernel will also refuse to shrink a pipe buffer if this would cause a loss of buffered
data. See pipe(7) for additional details.
pipesz supports specifying multiple short options consecutively, in the usual getopt(3) fashion. The
first non-option argument is interpreted as command. If command might begin with '-', use '--' to
separate it from arguments to pipesz. In shell scripts, it is good practice to use '--' when parameter
expansion is involved. pipesz itself does not read from standard input and does not write to standard
output unless --get, --help, or --version are specified.
OPTIONEN
-g, --get
Report the size of pipe buffers to standard output and exit. As a special behavior, if neither --file
nor --fd are specified, standard input is examined. It is an error to specify this option in
combination with --set.
-s, --set Größe
Set the size of the pipe buffers, in bytes. This option may be suffixed by K, M, G, KiB, MiB, or GiB
to indicate multiples of 1024. Fractional values are supported in this case. Additional suffixes are
supported but are unlikely to be useful. If this option is not specified, a default value is used, as
described above. If this option is specified multiple times, a warning is emitted and only the
last-specified size is used. As a special behavior, if neither --file nor --fd are specified,
standard output is adjusted. It is an error to specify this option in combination with --get.
-f, --file Pfad
Set the buffer size of the FIFO or pipe at path, relative to the current working directory. You may
specify this option multiple times to affect different files, and you may do so in combination with
--fd. Generally, this option is used with FIFOs, but it will also operate on anonymous pipes such as
those found in /proc/PID/fd. Changes to the buffer size of FIFOs are not preserved across system
restarts.
-n, --fd Dateideskriptor
Set the buffer size of the pipe or FIFO passed to pipesz as the specified file descriptor number. You
may specify this option multiple times to affect different file descriptors, and you may do so in
combination with --file. Shorthand options are provided for the common cases of fd 0 (stdin), fd 1
(stdout), and fd 2 (stderr). These should suffice in most cases.
-i, --stdin
Kürzel für --fd 0.
-o, --stdout
Kürzel für --fd 1.
-e, --stderr
Kürzel für --fd 2.
-c, --check
beendet das Programm, ohne den Befehl auszuführen, falls beim Manipulieren einer Datei oder eines
Dateideskriptors ein Fehler auftrat. Falls diese Option nicht angegeben ist, wird standardmäßig eine
Warnung in die Standardfehlerausgabe geschrieben und die Programmausführung fortgesetzt.
-q, --quiet
schreibt keine nicht-schwerwiegenden Diagnosemeldungen in die Standardfehlerausgabe. Die normale
Ausgabe von --get, --verbose, --help oder --version wird hiervon nicht beeinflusst.
-v, --verbose
veranlasst pipesz, eine beschreibende Überschrift über der Tabelle auszugeben, wenn dies mit --get
angegeben wird. Wenn Sie es ansonsten angeben, schreibt pipesz die vom Kernel festgelegten
tatsächlichen Puffergrößen in die Standardfehlerausgabe.
-h, --help
zeigt einen Hilfetext an und beendet das Programm.
-V, --version
Display version and exit.
BEISPIELE
pipesz dd if=Datei bs=1M | ...
Runs dd(1) with an expanded standard output pipe, allowing it to avoid context switches when piping
around large blocks.
pipesz -s1M -cf /run/mein-dienst.fifo
Setzt die Pipe-Puffergröße einer Dienst-FIFO auf 1.048.576 Byte. Falls die Puffergröße nicht gesetzt
werden kann, wird pipesz mit einem Fehler beendet.
echo hello | pipesz -g
gibt die Größe der Pipe aus, die von der Shell verwendet wird, um Eingaben an pipesz zu übergeben. Da
pipesz nicht aus der Standardeingabe liest, können auch 6 ungelesene Bytes in die Pipe gelangen,
abhängig von relativen Timings.
find /proc/PID/fd -exec pipesz -gqf '{}' ';'
gibt die Größe und Anzahl ungelesener Bytes aller Pipes aus, die von PID verwendet werden. Falls
einige Pipes routinemäßig voll sind, kann pipesz einen Flaschenhals bei der Verarbeitung mildern.
ANMERKUNGEN
Linux unterstützt die Größenanpassung von Pipe-Puffern seit Kernel 2.6.35. In dieser Version wurde
außerdem /proc/sys/fs/pipe-max-size eingeführt.
Dieses Programm verwendet F_GETPIPE_SZ/F_SETPIPE_SZ aus fcntl(2), um die Pipe-Puffergrößen zu ermitteln
und zu setzen.
Dieses Programm verwendet FIONREAD aus ioctl(2), um die Menge der ungelesenen Daten in Pipes zu
ermitteln. Falls dies aus irgendeinem Grund fehlschlägt, wird die Menge der ungelesenen Daten als 0
gemeldet.
FEHLER
Vor Linux 4.9 beeinträchtigten einige Fehler das Erzwingen bestimmter Ressourcenbeschränkungen beim
Setzen von Pipe-Puffergrößen. In pipe(7) finden Sie Details hierzu.
AUTOREN
Nathan Sharp <nwsharp@live.com>
SIEHE AUCH
pipe(7)
FEHLER MELDEN
For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.
VERFÜGBARKEIT
Der Befehl pipesz ist Teil des Pakets util-linux, welches aus dem Linux-Kernel-Archiv
<https://www.kernel.org/pub/linux/utils/util-linux/> heruntergeladen werden kann.
util-linux 2.41 2026-03-06 PIPESZ(1)