BW_PIPE(8)
π bw_pipe β bestie we're timing data through pipes π
okay so this is bw_pipe from the LMBENCH manual, section 8, and it's genuinely one of the cutest little benchmarks ever. let's get into it π«Ά
β¨ NAME β¨
bw_pipe β time data movement through pipes πΈ
β¨ SYNOPSIS β¨
bw_pipe [ -m <message size> ] [ -M <total bytes> ] [ -P <parallelism> ]
[ -W <warmups> ] [ -N <repetitions> ]
like, look at her. five whole options. she's serving β¨
β¨ DESCRIPTION β¨
so what she does is: bw_pipe makes a Unix pipe between two processes and moves total bytes through that pipe in message size chunks. and bestie, hear me on this β pipes are typically sized smaller than that, so don't come for me when the chunks don't fit, that's literally just how pipes are π
the default total bytes is 10MB and the default message size is 64KB. iconic defaults, no notes.
β¨ OUTPUT β¨
the output format is literally this, character for character:
"Pipe bandwidth: %0.2f MB/sec\n", megabytes_per_second
which in real life looks like:
Pipe bandwidth: 4.87 MB/sec
okay but that number? that's the whole point. that's the tea π
β¨ MEMORY UTILIZATION β¨
this is the part where it gets lowkey unhinged. this benchmark can move up to six times the requested memory per process. SIX. π
there are two processes, babes: the sender and the receiver.
most Unix systems implement the read/write system calls as a bcopy from/to kernel space to/from user space. and bcopy will use 2-3 times as much memory bandwidth: there's one read from the source and a write to the destination. the write usually results in a cache line read and then a write back of the cache line at some later point. so yeah, she's eating memory for breakfast π
the good news? memory utilization might be reduced by 1/3 if the processor architecture implemented "load cache line" and "store cache line" instructions (as well as getcachelinesize). so like... theoretically slay, if your CPU was built different π§
β¨ ACKNOWLEDGEMENT β¨
funding for the development of this tool was provided by Sun Microsystems Computer Corporation. we love a sponsor, periodt π
β¨ SEE ALSO β¨
go read that one too, iykyk π
β¨ AUTHOR β¨
Carl Staelin and Larry McVoy wrote this and honestly? kings π
Comments, suggestions, and bug reports are always welcome. fr fr, they want your feedback, don't be shy π
and that's the whole page bestie!! this is (c)1994 Larry McVoy, the date on this version is $Date$, and the source is the LMBENCH manual, section 8. mwah π β¨πππ¦πΈ
π¦ where this page comes from
- debian bookworm: lmbench 3.0-a9+debian.1-6
- debian trixie: lmbench 3.0-a9+debian.1-9
- ubuntu jammy: lmbench 3.0-a9+debian.1-6
- ubuntu noble: lmbench 3.0-a9+debian.1-6build3
- ubuntu questing: lmbench 3.0-a9+debian.1-9
- ubuntu resolute: lmbench 3.0-a9+debian.1-10
- ubuntu stonking: lmbench 3.0-a9+debian.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms