mirror of
https://github.com/element-hq/synapse.git
synced 2025-12-28 06:47:37 +00:00
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. |
||
|---|---|---|
| .. | ||
| transport | ||
| __init__.py | ||
| test_complexity.py | ||
| test_federation_catch_up.py | ||
| test_federation_client.py | ||
| test_federation_devices.py | ||
| test_federation_media.py | ||
| test_federation_out_of_band_membership.py | ||
| test_federation_sender.py | ||
| test_federation_server.py | ||