PIPESZ(1) Dienstprogramme fur Benutzer PIPESZ(1) BEZEICHNUNG pipesz - Pipe- und FIFO-Puffergrossen festlegen oder untersuchen UBERSICHT pipesz [Optionen] [--set Grosse] [--] [Befehl [Argument] ] pipesz [Optionen] --get BESCHREIBUNG Pipes und FIFOs verwalten einen internen Puffer, der zum Ubertragen von Daten zwischen der Leseseite und der Schreibseite verwendet wird. In einigen Fallen kann die Standardgrosse dieses internen Puffers den Erfordernissen nicht entsprechen. Dieses Programm bietet Moglichkeiten, die Grosse 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 Grosse 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 Kurzel fur --fd 0. -o, --stdout Kurzel fur --fd 1. -e, --stderr Kurzel fur --fd 2. -c, --check beendet das Programm, ohne den Befehl auszufuhren, falls beim Manipulieren einer Datei oder eines Dateideskriptors ein Fehler auftrat. Falls diese Option nicht angegeben ist, wird standardmassig eine Warnung in die Standardfehlerausgabe geschrieben und die Programmausfuhrung 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 Uberschrift uber der Tabelle auszugeben, wenn dies mit --get angegeben wird. Wenn Sie es ansonsten angeben, schreibt pipesz die vom Kernel festgelegten tatsachlichen Puffergrossen 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-Puffergrosse einer Dienst-FIFO auf 1.048.576 Byte. Falls die Puffergrosse nicht gesetzt werden kann, wird pipesz mit einem Fehler beendet. echo hello | pipesz -g gibt die Grosse der Pipe aus, die von der Shell verwendet wird, um Eingaben an pipesz zu ubergeben. Da pipesz nicht aus der Standardeingabe liest, konnen auch 6 ungelesene Bytes in die Pipe gelangen, abhangig von relativen Timings. find /proc/PID/fd -exec pipesz -gqf '{}' ';' gibt die Grosse und Anzahl ungelesener Bytes aller Pipes aus, die von PID verwendet werden. Falls einige Pipes routinemassig voll sind, kann pipesz einen Flaschenhals bei der Verarbeitung mildern. ANMERKUNGEN Linux unterstutzt die Grossenanpassung von Pipe-Puffern seit Kernel 2.6.35. In dieser Version wurde ausserdem /proc/sys/fs/pipe-max-size eingefuhrt. Dieses Programm verwendet F_GETPIPE_SZ/F_SETPIPE_SZ aus fcntl(2), um die Pipe-Puffergrossen 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 fehlschlagt, wird die Menge der ungelesenen Daten als 0 gemeldet. FEHLER Vor Linux 4.9 beeintrachtigten einige Fehler das Erzwingen bestimmter Ressourcenbeschrankungen beim Setzen von Pipe-Puffergrossen. In pipe(7) finden Sie Details hierzu. AUTOREN Nathan Sharp SIEHE AUCH pipe(7) FEHLER MELDEN For bug reports, use the issue tracker . VERFUGBARKEIT Der Befehl pipesz ist Teil des Pakets util-linux, welches aus dem Linux-Kernel-Archiv heruntergeladen werden kann. util-linux 2.41 2025-03-29 PIPESZ(1)