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

human readable bitrates calculation #316

Closed
junka opened this issue Mar 22, 2022 · 1 comment
Closed

human readable bitrates calculation #316

junka opened this issue Mar 22, 2022 · 1 comment

Comments

@junka
Copy link

junka commented Mar 22, 2022

Hi all,
I wonder if this is an old topic.

When I debug on a rate limit with sar -n DEV, there is always a deviation in the rxkB/s. I use the value to multiply 8.

When I set the limit to 40000kbps, the value in the sar output is 4883.12. Then I take it as 39065 kbps (4883.12 * 8).
At first , I doubted if there was any bug in my rate limit code. However, after days' digging, it turns out that the value from sar is not correct.

This value was calculated with the formula rxkb / 1024, so after calibration 39065 * 1024 /1000 = 40002, the value seems good enough.
So my question is why it is calculated in this way and should we fix it?

@junka
Copy link
Author

junka commented Mar 22, 2022

seems duplicate, close.

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

1 participant