Synapse single process vs workers

Run Synapse as a single monolith process for small and moderate deployments and split it into workers only when measured load justifies the added Redis, PostgreSQL and routing work. This page explains the trade-off for each option.

On this page

When a single Synapse process is enough and when to choose workers

Start with the single monolith process for a small Synapse homeserver. The Synapse workers documentation recommends running small instances in the default monolith mode, and that recommendation is the basis for the decision below. Move to workers only when the deployment is large enough that performance is a real concern, because the same documentation says splitting functionality into multiple separate Python processes can help in that case. The monolith keeps operations simple: one process to configure, monitor, upgrade and back up, with PostgreSQL as the database. Its limit is that one process carries all client, federation and event traffic, so throughput eventually becomes the constraint.

Workers add throughput at a real operating cost. A worker deployment needs a Redis server, which carries the replication stream between the main process and workers and can also act as a shared cache. It requires PostgreSQL, because Synapse workers only work with PostgreSQL-based deployments. It also needs an HTTP reverse proxy such as nginx or HAProxy that routes each request path to the correct worker or the main process. Before splitting, ask your team to confirm the current worker layout, which generic worker roles it would run, and which stream writers would move off the main process, and to test each routing rule against a staging homeserver. Your team will then carry Redis, proxy rules and worker health checks on top of the homeserver itself.

Use a simple test to decide. If you run a small instance and your monitoring shows the main process keeping up with load, keep the monolith and document the trigger for revisiting the decision. If measured latency or resource saturation points to a bottleneck, plan the workers with a named owner for Redis and the proxy, and rehearse the change in staging. Keep in mind that the upgrade notes warn rolling back can be difficult because of database schema changes between releases, so take a database backup before any topology change.

Single process or workers: factor by factor

This table compares running Synapse as one monolith process against splitting it into workers across the factors that drive effort. Read each row as a question to answer for your own user count and traffic, and treat the workers column as the path you take only when the throughput gain outweighs the added components. Most cells depend on load tests in your own environment, which the upstream documentation does not replace.

FactorSingle monolith processWorkers with Redis and PostgreSQL
ArchitectureOne Synapse process handles all client, federation, admin and event workMain process plus generic and specialized workers, split by request path or stream writer
Required componentsSynapse and PostgreSQL for production; SQLite is for demo use onlyAdds Redis for replication between processes, with PostgreSQL required and SQLite unsupported
Request routingNo routing layer is needed between clients and the homeserverAn HTTP reverse proxy such as nginx or HAProxy must send each request path to the correct worker
Throughput headroomSuited to small instances, per the upstream recommendation; confirm the ceiling with your own load testsUpstream docs say splitting can help larger deployments where performance is a concern; measure the gain on your workload
Upgrade and rollbackOne process and one configuration to update; rollback is hard once schema changes apply, per the upgrade notesEvery worker must match the release, and the proxy routes must be updated too; rollback is equally hard on the schema
MonitoringMonitor one process, its database and its resource useMonitor each worker, the Redis replication stream and proxy health; confirm the metrics your version exposes
Skills neededOperating a Python service with PostgreSQL and a standard web server or proxyAdds Redis operations, proxy routing rules and worker topology design; confirm the team can own all three
Change to identity or federationSingle sign-on and federation settings live in one configurationRouting rules must keep federation and client endpoints on the right workers; confirm this against the current worker docs

What workers add: Redis, stream writers and the generic worker

Splitting Synapse into workers adds moving parts that all have to agree: a Redis relay, a database that must be PostgreSQL, specific worker roles and a reverse proxy that sends each request to the right process. The cards below cover each component and the checks to run before you commit to that operating model.

Redis as the replication relay

Every Synapse process in a worker deployment, including the main process, connects to Redis, which carries the replication stream between them. Redis can also serve as a shared cache. Treat it as a required service with its own availability, memory and access controls, because a Redis outage stops coordination between processes. Ask your team who will run and monitor it.

PostgreSQL is mandatory

Workers only work with PostgreSQL-based deployments. The Synapse workers documentation says SQLite should only be used for demo purposes. If your current monolith runs on SQLite, plan a database migration before adding workers, and confirm the PostgreSQL version against the Synapse upgrade notes for your target release.

The generic worker

The generic worker (synapse.app.generic_worker) handles a broad range of client, federation and admin API requests, so it is the usual first worker to add. It lets you scale request handling without dedicating processes to individual endpoints. Start with a small number of generic workers and measure load before splitting roles further.

Moving stream writes to a dedicated worker

Writing specific streams, such as events, can be moved off the main process to a named worker. This is the step that removes write pressure from the main process, but it also means a single writer for that stream must be configured correctly in every process. Review the worker configuration carefully and test failover behavior before production use.

Reverse proxy routing by path

A worker deployment needs an HTTP reverse proxy, such as nginx or HAProxy, that routes each request path to the correct worker or to the main process. Routing rules become part of your change control: a missing or misordered path rule sends traffic to a process that cannot answer it. Keep the routing table under version control and test each client and federation path.

Federation listener firewalling

Synapse federates on port 8448 by default, and the configuration manual recommends firewalling the federation listener. The federation_domain_whitelist setting restricts federation to listed domains, and an empty list disables it. Decide your federation policy first, then confirm the firewall rules match it on every worker that exposes a federation listener.

How to decide that the throughput gain justifies workers

The Synapse workers documentation recommends that small instances run in the default monolith mode, and it suggests splitting functionality into multiple Python processes only for larger deployments where performance is a concern. The decision to split therefore starts with evidence that the monolith is the bottleneck, not with an assumed user count. Before any change, the team should be able to name the constraint it expects workers to remove, such as slow client sync, delayed federation traffic or a busy event writer.

Start with baseline measurements on the existing homeserver: CPU and memory per process, PostgreSQL load, request latency for client and federation endpoints, and the time it takes users to join large rooms and complete sync. Separate client traffic from federation traffic, since the generic worker and the reverse proxy routing treat them differently. Check whether load is concentrated in a few expensive room joins or spread evenly, and whether the spikes line up with particular federated servers. Confirm these figures in the client's own environment, because the traffic patterns of one organization rarely match another's.

Once workers are on the table, weigh the operating effort against the gain. A split deployment adds Redis for replication, a reverse proxy that routes each request path to the correct worker, extra process supervision and a more involved upgrade path, and the upgrade notes warn that rolling back can be difficult because of schema changes. DeployOpen would confirm the measured bottleneck, the expected gain and the ongoing support load in writing before recommending any change, and would ask for a rollback plan and a staged test on a copy of production data first.

What operating each model asks of your team

This team carries most of the operating load. A single monolith process is one service to upgrade, watch and restart. A worker layout adds Redis, a reverse proxy with path routing, and several Python processes that must stay on the same release. The Synapse upgrade notes warn that rolling back can be difficult because database schema changes between releases, so every upgrade needs a tested restore point taken before the change.

  • Upgrades: Plan each release against the upgrade notes, and treat a worker fleet as one version that must move together.
  • PostgreSQL and Python currency: Synapse drops support for PostgreSQL and Python versions once upstream reaches end of life, so schedule runtime upgrades as recurring work, not one-off projects.
  • Backups: Back up PostgreSQL as the system of record. Confirm with Element how Redis state should be treated, since it carries replication traffic and an optional shared cache.
  • Monitoring: Track the main process and each worker separately, along with Redis and the reverse proxy routes, so a stalled stream writer is not mistaken for a healthy node.
  • Skills: Expect PostgreSQL administration, Redis operations, reverse proxy configuration and Python service management.

Before committing, ask your team to rehearse a full restore and a version rollback in a non-production environment.

Upgrades, backups, monitoring and skills for each model

This table compares how a single Synapse process and a worker split differ on upgrades, rollback, backups, monitoring, failure domains and skills. Read each row as the extra operating surface a worker deployment adds, then confirm the specifics with Element and in your own environment before deciding.

AreaSingle monolith processWorkers with Redis and PostgreSQL
Upgrade stepsUpgrade one Synapse process and its configuration, then restart itUpgrade the main process and every worker to matching releases, plus Redis and the reverse proxy routing where needed
Rollback riskRolling back is difficult once schema changes apply, per the upgrade notes, so plan a database backup before any upgradeSame schema caution applies, and mismatched process versions add a second rollback path to test
Backup scopePostgreSQL database, media store, signing keys and configuration filesSame core data, plus worker configuration, reverse proxy rules and Redis settings that must be recreated consistently
Redis roleNot requiredRequired to carry the replication stream between processes and optionally serve as a shared cache, so Redis state is part of recovery planning
Monitoring surfaceOne process to watch for health, resource use and federation trafficEach worker, the main process, Redis, the reverse proxy and PostgreSQL need monitoring, with per-stream lag to track
Failure domainsA single process failure takes down all client, federation and admin trafficA failed worker can affect only the request paths it serves, but a Redis or database fault can stop replication for every process
Routing failuresNot applicable beyond the single entry pointMisrouted request paths at the reverse proxy can send traffic to the wrong worker, so routing rules need testing after each change
Skills requiredPython service operation, PostgreSQL administration, reverse proxy basicsAdds Redis operation, multi-process tuning, worker configuration and proxy routing, ideally with a rehearsed runbook
To confirm with Element or your environmentSupported PostgreSQL and Python versions for your target release and your backup and restore timingsSupported worker layouts for your release, Redis sizing, and whether your team can rehearse a full worker upgrade in a staging copy

What drives the cost of running workers

The main cost of a worker build is not the software, which is open source, but the people and infrastructure that run it. Each worker process, the Redis server that relays replication between processes, and the PostgreSQL database all need their own compute, memory, monitoring and patching. The Synapse workers documentation says Redis carries the replication stream and can also serve as a shared cache, so Redis is a component you must size, secure and keep available, not an optional extra. Ask for each process to be listed with its host or container, its resource allocation, and who owns its backups and patching. Synapse workers also require PostgreSQL, so any database sizing and high availability design is part of the same bill, and it should be quoted separately so the database cost is visible.

The reverse proxy is where most of the one-time build work sits. The Synapse workers documentation says an HTTP reverse proxy such as nginx or HAProxy must route each request path to the correct worker or the main process. Someone has to write those routing rules, map every client, federation and admin path, and test each route, including the paths that only appear under real federation traffic. Ask the vendor to name the test cases, the environments where routing will be exercised, and whether load and failover tests are included. Recurring work follows from every Synapse upgrade, because new endpoints and changed stream assignments can require routing updates. A quote should show the one-time build and the expected operations as separate line items, with the upgrade process described in the written scope.

Upgrades are the largest recurring cost. The Synapse upgrade notes warn that rolling back can be difficult because of database schema changes between releases, and that Synapse drops support for Python and PostgreSQL versions when they reach upstream end of life. A worker estate multiplies this work, since every process must move to the same release in a coordinated order. Before signing, confirm who writes the upgrade runbook, who holds the database backups needed for a safe rollback, and whether monitoring and on-call coverage are included. Fixed-scope build work and an ongoing support arrangement should be priced separately, so you can see which part you pay once and which part recurs for as long as the deployment runs.

Questions teams ask before splitting Synapse into workers

Is a single Synapse process enough for my team size?

For small deployments, the Synapse workers documentation recommends staying on the default monolith mode. The split only pays off when performance is a concern at scale, so the deciding factor is measured load, not headcount. Before changing anything, measure CPU, memory, database load and request latency on the monolith under your real traffic, including federation if you join other servers. Ask your team or DeployOpen to baseline those numbers first, because a single process that is comfortable for a small, mostly closed community may not be comfortable for a busy federated one.

How much extra operating effort do Synapse workers add?

Workers add moving parts that you run every day, not a one-time setup. You operate the main process, one or more worker processes, a Redis server for replication, PostgreSQL, and an HTTP reverse proxy such as nginx or HAProxy that routes each request path to the correct process. Each worker needs its own configuration, monitoring and upgrade step, and every Synapse upgrade must be checked against the whole set. The effort recurs with each release, so weigh it against the throughput you actually gain. Ask for a written list of processes, the routing rules you will maintain, and the monitoring you will add before you accept a plan.

Are Redis and PostgreSQL mandatory for Synapse workers?

Yes, for workers. The Synapse workers documentation says workers need a Redis server to carry the replication stream between processes, and it can also serve as a shared cache. The same documentation states that workers only work with PostgreSQL-based deployments and that SQLite should only be used for demo purposes. A monolith can still run on SQLite for a demo, but a production deployment that will split into workers must move to PostgreSQL first. Check the PostgreSQL version you need against the Synapse upgrade notes, since recent Synapse releases require PostgreSQL 14 or newer.

Can my own team run a Synapse worker deployment?

Yes, if your team has Linux operations, PostgreSQL, Redis and reverse proxy skills and time to own them after go-live. Synapse is AGPL-3.0 licensed, so self-hosting it does not require a fee for the software itself. The costs are staff time, infrastructure, and the work of keeping routing, replication and database schemas correct through upgrades. The Synapse upgrade notes warn that rolling back can be difficult because of database schema changes, so plan staged upgrades with backups. If those skills are thin in-house, you can ask DeployOpen for a fixed-scope implementation, or a retainer for ongoing upgrades and support, and compare that against hiring.

How long does a move from a monolith to workers take?

No supplied source gives a duration for this migration, so treat any number you hear as unverified until it is written into a scope. The main drivers are the size of the deployment, how many workers you introduce, the state of your PostgreSQL and Redis hosting, how much routing logic your reverse proxy needs, and how many environments (test, staging, production) you must validate. Ask for a fixed-scope plan that lists the workers, the cutover steps, the rollback path and the test evidence each phase produces. Your team should also confirm the work it must contribute, such as change windows and access to the reverse proxy and database.

What does a worker migration cost, and what drives it?

No supplied source gives a price or budget for a Synapse worker migration, and DeployOpen does not publish a price list. Cost comes from the scope agreed in writing: the number of processes to design, the infrastructure you add (Redis, extra PostgreSQL capacity, reverse proxy nodes), the testing and the documentation you need. Infrastructure costs recur in your cloud or data center, while implementation is usually one-time, and ongoing support or upgrades are a separate retainer. Ask any provider for an itemized quote that separates one-time work from recurring infrastructure and support.

How do I confirm whether workers are the right choice?

Run a short, evidence-based review before committing. First, capture performance metrics on your current monolith under normal and peak load. Second, check whether the bottleneck is a stream or request type that a generic worker or a dedicated stream writer can take off the main process. Third, confirm the PostgreSQL and Redis footprint you can support, and the reverse proxy routing you can maintain. Finally, compare the operating effort with the throughput you gain. The Synapse workers documentation is the natural next read for the process layout, and DeployOpen can help plan that review as a fixed-scope engagement.

Moving from a monolith to workers later

Moving from a single process to workers later is an infrastructure project, not a configuration tweak. A working PostgreSQL-backed Synapse must gain a Redis server that carries the replication stream, worker processes such as the generic worker or dedicated stream writers, and an HTTP reverse proxy such as nginx or HAProxy that routes each request path to the correct process. Each of those components changes how traffic flows, so the migration touches the proxy, the homeserver configuration and the monitoring at once. Confirm with your team which of these pieces already exist in your environment, such as a Redis service or a proxy with path-based routing, before you estimate the work.

Rollback is the risk to plan for first. The Synapse upgrade notes warn that rolling back can be difficult because database schema changes between releases may not reverse cleanly, so a version change combined with a topology change compounds that exposure. Take a verified PostgreSQL backup and record the exact Synapse version before any change. Keep the monolith configuration in version control so you can restart it without rebuilding from memory. Check the Synapse upgrade notes for the release you run before you start, and confirm the expected rollback path with Element or your implementation partner in writing.

Run the change first in a non-production environment built from a recent copy of production data, with the same Synapse, PostgreSQL and Redis versions. Test client login, message send and receive, federation if enabled, and media upload through the new proxy routes, then time a rollback from the workers layout back to the monolith. We recommend treating that rehearsal as a gate: do not schedule the production change until the rollback has been performed successfully at least once and the team has written down who makes the call to revert. This staged approach reduces risk, but it does not guarantee a clean migration in every environment.

How DeployOpen scopes, builds and supports Synapse deployments

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside the client's own infrastructure, including Matrix homeservers. For Synapse, we start by agreeing which topology the traffic and operating team justify, then build and hand over only the components that decision requires.

How we scope

  • Written scope fixes whether Synapse stays a single monolith process or moves to workers, with the reasons recorded.
  • We confirm the PostgreSQL version, Redis placement and reverse proxy platform the client already operates before any build work starts.
  • Engagements are fixed-scope, so deliverables, timelines and the federation decision are agreed in writing before work begins.

How we build

  • We configure the main process, or the generic worker and stream writers the design calls for, with Redis carrying replication between processes.
  • We write reverse proxy routing so each request path reaches the correct worker or the main process, and test each route.
  • We enable the chosen single sign-on method and lock federation settings such as server_name and federation_domain_whitelist to the approved policy.

How we hand over

  • Handover documents the topology, process map, Redis and PostgreSQL dependencies, and the routing table for the client's operators.
  • We provide a tested upgrade and rollback runbook, noting that Synapse schema changes can make rollback difficult.
  • Operators are trained on the health checks, log locations and the steps to add or remove a worker later.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainer work can track Synapse release notes, PostgreSQL and Python version requirements, and reverse proxy changes as they arrive.
  • Before any topology change, we re-test routing and federation behavior, so the client confirms throughput gains against its own measured load.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.