Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End test immediately when all number of blocks/bytes sent/received #1775

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidBar-On
Copy link
Contributor

  • Version of iperf3 (or development branch, such as master or
    3.1-STABLE) to which this pull request applies:
    master

  • Issues fixed (if any): Lower throughtput numbers reported with v3.16 #1768

  • Brief description of code changes (suitable for use as a commit message):

Currently, after to change to multi-thread, when limiting the test by number of bytes (-n) or number of blocks (-k), the test ends only when the current interval (-i) ends and not when all the data was sent/received. This is because the select() no longer monitor the steams data. Therefore the throughput statistics are not properly calculated. I.e. for 1 second interval, if sending was done in 2.5 seconds, the statistics will be as if sending was done in 3 seconds. This is much worse if the interval period is larger.

This suggested fix is using the self-pipe trick, based on this example. When -n or -k are set, a self-pipe is added to the Client's select. When the limit is reached, one byte is written to the pipe to wake-up the select() in the main thread.

@bmah888
Copy link
Contributor

bmah888 commented Sep 24, 2024

Thanks for the PR! Admittedlly this might take alittle time to study what this change does.

@bmah888 bmah888 changed the title End test immediatelly when all number of blocks/bytes sent/received End test immediately when all number of blocks/bytes sent/received Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants