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

100% CPU utilization in a limited rate test #1741

Closed
piknik opened this issue Aug 8, 2024 · 1 comment
Closed

100% CPU utilization in a limited rate test #1741

piknik opened this issue Aug 8, 2024 · 1 comment

Comments

@piknik
Copy link

piknik commented Aug 8, 2024

Context

  • Version of iperf3: 3.17.1

  • Hardware: i7-1165G7

  • Operating system (and distribution, if any): Arch Linux

Bug Report

  • Expected Behavior

Minimal CPU utilization for a limited rate bandwidth test; 1 packet per second

  • Actual Behavior

100% CPU utilization

  • Steps to Reproduce

iperf3 -c server -b 7776 -l 972 -t 0
This limits iperf3 to send 1 packet per second of size 972. UDP or TCP doesn't matter.

With strace we observe that a function is called many times (over 1000) in a loop between each packet output:
strace -f -p $(pidof iperf3)
[pid 185030] pselect6(5, [4], [], NULL, {tv_sec=0, tv_nsec=911000}, NULL) = 0 (Timeout)

@davidBar-On
Copy link
Contributor

With strace we observe that a function is called many times (over 1000) in a loop between each packet output:

This is the result of the --pacing_timer interrupt - the default is 1000us and this is the reason for the1000 calls per second to the timer interrupt handler..

The CPU overload is because with the move to multi-threads, the sending function is now running in a loop that does not include any mechanism for waiting if nothing should be sent (in the non-multi-threads version this was done by select()). Submitted PR #1743 with a suggested fix.

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

No branches or pull requests

2 participants