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:

  1. as a server β€” -s πŸ‘‘
  2. as a client β€” bw_tcp localhost 🧚
  3. 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 πŸ¦‹