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

Commit e053c86

Browse files
authored
Make redis go faster with hiredis (#7439)
For the record, the reason we need this is as follows: each RDATA command comes down the redis pipe as a subscription message. txredisapi as written needs at least three reactor ticks to read each subscription message from the tcp buffer. Hence, once the process gets loaded, it starts getting behind, and eventually redis knifes the connection. it then takes ages for the master to work its way through the backlog, before it reconnects again, during which any commands from any workers are dropped.
1 parent aee9130 commit e053c86

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changelog.d/7439.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for running replication over Redis when using workers.

synapse/python_dependencies.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@
9898
"sentry": ["sentry-sdk>=0.7.2"],
9999
"opentracing": ["jaeger-client>=4.0.0", "opentracing>=2.2.0"],
100100
"jwt": ["pyjwt>=1.6.4"],
101-
"redis": ["txredisapi>=1.4.7"],
101+
# hiredis is not a *strict* dependency, but it makes things much faster.
102+
# (if it is not installed, we fall back to slow code.)
103+
"redis": ["txredisapi>=1.4.7", "hiredis"],
102104
}
103105

104106
ALL_OPTIONAL_REQUIREMENTS = set() # type: Set[str]

0 commit comments

Comments
 (0)