mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-01 14:06:06 -04:00
Fixes to the federation rate limiter (#5621)
- Put the default window_size back to 1000ms (broken by #5181) - Make the `rc_federation` config actually do something - fix an off-by-one error in the 'concurrent' limit - Avoid creating an unused `_PerHostRatelimiter` object for every single incoming request
This commit is contained in:
parent
0e5434264f
commit
9481707a52
6 changed files with 148 additions and 16 deletions
|
@ -23,7 +23,7 @@ class RateLimitConfig(object):
|
|||
|
||||
class FederationRateLimitConfig(object):
|
||||
_items_and_default = {
|
||||
"window_size": 10000,
|
||||
"window_size": 1000,
|
||||
"sleep_limit": 10,
|
||||
"sleep_delay": 500,
|
||||
"reject_limit": 50,
|
||||
|
@ -54,7 +54,7 @@ class RatelimitConfig(Config):
|
|||
|
||||
# Load the new-style federation config, if it exists. Otherwise, fall
|
||||
# back to the old method.
|
||||
if "federation_rc" in config:
|
||||
if "rc_federation" in config:
|
||||
self.rc_federation = FederationRateLimitConfig(**config["rc_federation"])
|
||||
else:
|
||||
self.rc_federation = FederationRateLimitConfig(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue