synapse/tests/api
Erik Johnston 5408101d21
Speed up pruning of ratelimiter (#19129)
I noticed this in some profiling. Basically, we prune the ratelimiters
by copying and iterating over every entry every 60 seconds. Instead,
let's use a wheel timer to track when we should potentially prune a
given key, and then we a) check fewer keys, and b) can run more
frequently. Hopefully this should mean we don't have a large pause
everytime we prune a ratelimiter with lots of keys.

Also fixes a bug where we didn't prune entries that were added via
`record_action` and never subsequently updated. This affected the media
and joins-per-room ratelimiter.
2025-11-04 12:44:57 +00:00
..
__init__.py
test_auth.py Stabilize support for MSC4326: Device masquerading for appservices (#19033) 2025-10-13 11:13:07 -05:00
test_errors.py Stabilize support for Retry-After header (MSC4014) (#16947) 2024-03-08 09:33:46 +00:00
test_filtering.py Use type hinting generics in standard collections (#19046) 2025-10-22 16:48:19 -05:00
test_ratelimiting.py Speed up pruning of ratelimiter (#19129) 2025-11-04 12:44:57 +00:00
test_urls.py Introduce Clock.call_when_running(...) to include logcontext by default (#18944) 2025-09-22 10:27:59 -05:00