Skip to content

Conversation

@reivilibre
Copy link
Contributor

@reivilibre reivilibre commented Jun 4, 2025

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.

@reivilibre reivilibre requested a review from a team June 4, 2025 16:35
Comment on lines +821 to +833
await self.common_request_ratelimiter.ratelimit(requester)
await self.creation_ratelimiter.ratelimit(requester)
Copy link
Contributor Author

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

Copy link
Member

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},
Copy link
Member

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

Copy link
Contributor Author

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

@devonh
Copy link
Member

devonh commented Jun 4, 2025

Oh, and in general this PR will need to update the docs to refect the new config option.
But that can be done after this is out of draft :)

@reivilibre reivilibre force-pushed the rei/ratelimit_room_creation branch from d305fb4 to 98ed365 Compare June 6, 2025 10:39
@github-actions github-actions bot deployed to PR Documentation Preview June 6, 2025 10:40 Active
@github-actions github-actions bot deployed to PR Documentation Preview June 9, 2025 14:18 Active
@reivilibre reivilibre marked this pull request as ready for review June 20, 2025 11:53
@reivilibre reivilibre requested a review from a team June 20, 2025 11:54
Copy link
Member

@erikjohnston erikjohnston left a 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

reivilibre added a commit to matrix-org/sytest that referenced this pull request Jun 30, 2025
@reivilibre reivilibre enabled auto-merge (squash) July 23, 2025 15:33
@github-actions github-actions bot deployed to PR Documentation Preview July 23, 2025 15:33 Active
@reivilibre reivilibre merged commit 8344c94 into develop Jul 24, 2025
84 of 87 checks passed
@reivilibre reivilibre deleted the rei/ratelimit_room_creation branch July 24, 2025 14:08
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.

4 participants