How is iperf so fast? #1975
Replies: 2 comments 8 replies
-
iperf3 does not receiver does not send back the data it received. With Another point is that by default iperf3 sends 128Kbyte messages. If messages are much smaller (e.g. 1KB) then there is a quite big throughput difference. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @DUOLabs333, the biggest question in my mind is what is your program supposed to actually do? Unless you're writing a toy program just for fun (which by the way is a great learning exercise) your program is trying to do accomplish something specific by transferring some data over the network to another process. That pattern of communication (bulk data transfer? request-response?) might be different from what iperf3 does, but it's required for whatever your application needs to do. If that's true, you can't really compare the performance of your program to iperf3 because you measure different things. iperf3 basically shovels data down a socket (or several sockets). It might rate-limit itself based on command-line options, but the default for TCP transfer is just to keep sending data as fast as the TCP congestion control algorithm (and flow control on the receiver side) will let it go. On the sending side (which be either the client or server depending on command-line options) it counts the number of bytes sent and divides by the time it took to send them all. Think something similar for the receiver. There's no magic here. Is this what your program is doing? You should also supply a few other details. What operating system? What's the network path look like between the two hosts (like is this a single Ethernet network in your house or a campus LAN or a national-scale WAN)? (iperf3 was designed around Linux hosts, generally attached to wide-area networks with link speeds at least 10Gbps.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm writing a program that requires high throughput and low latency --- however, no matter what I do, my program is only able to achieve around half of the throughput of iperf (eg, on local TCP (ie, from one process to another), iperf is able to get ~ 14 GBps, while my program is only able to get ~5 GBps), even though after looking through iperf's source code, both seem to be doing the same thing (ie, use
send/recvand disable Nagle's).For my own program, I'm calculating bitrate by dividing the amount of data sent/received (since in my benchmarks, I essentially just send data, then immediately request it again) by the time it took to send it --- does iperf use a different formula?
Beta Was this translation helpful? Give feedback.
All reactions