-
Notifications
You must be signed in to change notification settings - Fork 423
Add configurable rate limiting for the creation of rooms. #18514
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
Conversation
| await self.common_request_ratelimiter.ratelimit(requester) | ||
| await self.creation_ratelimiter.ratelimit(requester) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's an open question if we want them both or not, but since room creation consuming tokens from the general bucket was implicitly relied upon by tests, I thought I should leave it like that for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - this is the bit I'm unsure of. Would need to dig into this further to see what we should be doing here, and if this is in fact the right thing to do.
| self.rc_room_creation = RatelimitSettings.parse( | ||
| config, | ||
| "rc_room_creation", | ||
| defaults={"per_second": 0.016, "burst_count": 10}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting per_second value... almost 1 per minute?
I don't have a problem with it, but it might warrant a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm yeah, not sure what would be a good default
|
Oh, and in general this PR will need to update the docs to refect the new config option. |
d305fb4 to
98ed365
Compare
erikjohnston
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though has merge conflicts
Default values will be 1 room per minute, with a burst count of 10.
It's hard to imagine most users will be affected by this default rate, but it's intentionally non-invasive in case of bots or other users that need to create rooms at a large rate.
Server admins might want to down-tune this on their deployments.