Batch up outgoing read-receipts to reduce federation traffic. (#4890)

Rate-limit outgoing read-receipts as per #4730.
This commit is contained in:
Richard van der Hoff 2019-03-20 16:02:25 +00:00 committed by GitHub
parent 11f2125885
commit a902d13180
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 308 additions and 22 deletions

View file

@ -42,6 +42,10 @@ class RatelimitConfig(Config):
self.federation_rc_reject_limit = config.get("federation_rc_reject_limit", 50)
self.federation_rc_concurrent = config.get("federation_rc_concurrent", 3)
self.federation_rr_transactions_per_room_per_second = config.get(
"federation_rr_transactions_per_room_per_second", 50,
)
def default_config(self, **kwargs):
return """\
## Ratelimiting ##
@ -111,4 +115,12 @@ class RatelimitConfig(Config):
# single server
#
#federation_rc_concurrent: 3
# Target outgoing federation transaction frequency for sending read-receipts,
# per-room.
#
# If we end up trying to send out more read-receipts, they will get buffered up
# into fewer transactions.
#
#federation_rr_transactions_per_room_per_second: 50
"""