BW_TCP(8)
β¨ BW_TCP(8) β bestie, we're timing data through TCP/IP sockets β¨
okay so this is a page from the LMBENCH manual set, and the star of the show is bw_tcp π pull up a chair, we're measuring how fast bytes can vibe their way through a socket π¦
πΈ NAME πΈ
bw_tcp β time data movement through TCP/IP sockets β±οΈβ¨
π SYNOPSIS π
bw_tcp [ -m <message size> ] [ -M <total bytes> ] [ -P <parallelism> ] [
-W <warmups> ] [ -N <repetitions> ] server
bw_tcp -s
bw_tcp -S <server>
π DESCRIPTION π
so bw_tcp is a client/server program that moves data over a TCP/IP socket π«Ά and here's the thing β nobody does anything with the data on either side. it's not being parsed, it's not being saved, it's not being judged. it just gets moved. total bytes of data get shoved across in message size chunks, and that's the whole personality π
bw_tcp has three forms of usage:
- as a server β
-sπ - as a client β
bw_tcp localhostπ§ - as a shutdown β
bw_tcp -S localhostπ
the default amount of data is 10MB β¨ but the client form can specify a different amount of data if you're feeling spicy π
and omg the units β specifications may end with k or m, which mean kilobytes (* 1024) or megabytes (* 1024 * 1024) π
π OUTPUT π
the output format is literally this:
Socket bandwidth using localhost: 2.32 MB/sec
no cap, that's it, that's the whole reveal π
π§ MEMORY UTILIZATION π§
okay bestie this part is important, listen up π
this benchmark can move up to six times the requested memory per process when you run it through the loopback device. SIX. TIMES. π
here's why: there are two processes β 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 β±οΈ
and the lil hopeful note: 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) π
π«Ά ACKNOWLEDGEMENT π«Ά
funding for the development of this tool was provided by Sun Microsystems Computer Corporation and Silicon Graphics, Inc. π thank u legends
π SEE ALSO π
π AUTHOR π
Carl Staelin and Larry McVoy β¨
comments, suggestions, and bug reports are always welcome π fr fr, slide into their mentions, they want to hear from you
cute lil sign-off bestie: this page is copyright (c)1994 Larry McVoy, with the date placeholder $Date$, and yeah the footer still says BW_TCP(8) because we keep it iconic π
β¨ bye ily π¦
π¦ 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