Increase TCP bandwidth for small messages #1691
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Version of iperf3 (or development branch, such as
master
or3.1-STABLE
) to which this pull request applies:master
Issues fixed (if any): iperf3 single-stream low bandwidth with small message sizes (1KB, 1500B, 2000B, etc.) #1078
Brief description of code changes (suitable for use as a commit message):
Suggested enhancement to resolve the iperf3 TCP low bandwidth with small message sizes, compared to iper2 and netperf. This is by receiving all the sent burst messages as one read message. In my environment, for
-l1500
throughput is increased by about 35% for a single stream and more than 50% for multi streams tests.It seems that the main reason for iperf2 and netperf higher bandwidth for small messages is that iperf3 is sending and receiving the same message size, while in iperf2, and probably netperf, they are different. For example, iperf2 default receive TCP message size is 128K.
Notes:
-n
,-k
or--file
) are set, read may wait because bytes sent are not multiple of message size. Therefore, when these parameters are set, read size is only-l
value is read. Future enhancement may be that read will not wait for the full message (like in iperf2), and count received blocks based on number of bytes received.blksize
by the burst size) to maximumMAX_BLOCKSIZE
(1MB). If this is too large, it may be limited toMAX_TCP_BUFFER
(512KB)orDEFAULT_TCP_BLKSIZE
(128KB).-l
with the receiver message length, i.e. the first value is for the sender size (and is the receiver default). This will be similar to the iperf2 approach, but I believe that using burst is better.-b
, the default burst size is set to 1. Assume that the network bandwidth is 1Gbps. For test that does not set-b
the burst size is 10, and for test with-b10G
the burst size is 1. Therefore, the first test will have higher bandwidth, although practically the second test didn't put a real limit to the bandwidth. A workaround is also setting the burst size by-b10G/10
, but still users may not understand this burst size difference. (By the way, with multi-thread the sending burst may be redundant, so it may be possible to remove the burst loop when sending. With this approach, burst size will only be applicable to TCP receives, maybe allowing to not changing the default burst to 1 when-b
is set.)