Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Apply limiter patch from Gitter import #14941

Closed
clokep opened this issue Jan 30, 2023 · 0 comments · Fixed by #14977
Closed

Apply limiter patch from Gitter import #14941

clokep opened this issue Jan 30, 2023 · 0 comments · Fixed by #14977
Assignees
Labels
A-Performance Performance, both client-facing and admin-facing O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Comments

@clokep
Copy link
Member

clokep commented Jan 30, 2023

While importing historical Gitter archives into Gitter's homeserver we added a patch to improve performance:

diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -502,7 +502,7 @@

         # We arbitrarily limit concurrent event creation for a room to 5.
         # This is to stop us from diverging history *too* much.
-        self.limiter = Linearizer(max_count=5, name="room_event_creation_limit")
+        self.limiter = Linearizer(max_count=1, name="room_event_creation_limit")

         self._bulk_push_rule_evaluator = hs.get_bulk_push_rule_evaluator()

Digging some context out of internal issues:

The idea is to reduce the concurrency of event sends into rooms from 5 -> 1 in order to eliminate state resolution from occurring when sending bursts of events to a local room: matrix-org/synapse@54c012c/synapse/handlers/message.py#L502-L504

For cross-linking, there was an old issue about doing this in #8612.


Unfortunately this changes was applied at the same time as a few other changes (disabling push and increasing the number of workers), so it is unclear how much impact this change had.

@H-Shay H-Shay self-assigned this Jan 31, 2023
@H-Shay H-Shay added T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. A-Performance Performance, both client-facing and admin-facing labels Jan 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Performance Performance, both client-facing and admin-facing O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
2 participants