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

[core] Tweak ratelimiting a little better for low rates #618

Merged
merged 2 commits into from
Jan 31, 2023

Conversation

alanmcgovern
Copy link
Owner

Fix another issue with a ratelimit of 1 byte/second. Hopefully no-one was actually trying to use a limit this low.

Additionally, simplify this logic now. Rate limits are much easier than they used to be as the engine works in bytes, not 'blocks' or 'chunks'.

Back in the day there had to be estimates made for the amount of data which would be received for a given 'ReceiveAsync' call. Now we're just counting the raw number of bytes sent/received, or read/written, so we don't need complicated math to account for over/under-shoot.

Fix another issue with a ratelimit of 1 byte/second. Hopefully
no-one was actually trying to use a limit this low.

Additionally, simplify this logic now. Rate limits are much
easier than they used to be as the engine works in bytes, not
'blocks' or 'chunks'.

Back in the day there had to be estimates made for the amount
of data which would be received for a given 'ReceiveAsync' call.
Now we're just counting the raw number of bytes sent/received,
or read/written, so we don't need complicated math to account
for over/under-shoot.
@alanmcgovern alanmcgovern merged commit a8c7a6c into master Jan 31, 2023
@alanmcgovern alanmcgovern deleted the simplify-ratelimiter branch January 31, 2023 23:33
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.

None yet

1 participant