open-webui/backend/open_webui
Classic298 a5fdd329db perf: opt-in routed delivery for the socket.io Redis manager
With WEBSOCKET_MANAGER=redis every emit is published on one shared channel and
every instance decodes every message: a 16 instance fleet decodes each streamed
token delta 16 times and 15 discard it, and streams whose user closed the tab
keep publishing every delta until they end. py-spy across a loaded fleet (16
instances, ~4000 users) puts ~31% of all active CPU samples in the pubsub
listener parse chain, the largest bucket, growing with instance count.

WEBSOCKET_REDIS_ROUTING=true routes instead: instances register room membership
in Redis and emits go only to instances holding members. Rooms empty fleet-wide
are dropped before serialization, local-only delivery skips Redis and sio.call
acks return on the caller's channel. Lookups use a short-TTL cache invalidated
on membership changes; any registry uncertainty (wipe, failover, prune, failing
writes, suspend) falls back to stock broadcast, so degraded Redis never loses
messages hub mode would deliver. Composes with the new delta streaming: deltas
cut bytes per message, routing cuts decoders per message. Default off,
byte-identical to today; the fleet must switch together with a full restart.
Verified end to end with two instances: cross-instance delta streams deliver
with zero broadcast-channel traffic. Ref #28173.
2026-08-14 20:09:57 +02:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal perf: route native JSON columns through JSONCodec instead of stdlib json (#28396) 2026-08-10 19:39:49 -05:00
migrations refac 2026-08-10 23:22:08 -06:00
models refac 2026-08-13 19:59:11 -06:00
retrieval fix: remove vestigial api_base_url param that broke the Tavily web loader (#27636) 2026-08-12 02:05:26 -05:00
routers refac 2026-08-14 00:22:17 -06:00
socket perf: opt-in routed delivery for the socket.io Redis manager 2026-08-14 20:09:57 +02:00
static refac 2026-07-27 19:39:36 -04:00
storage refac 2026-07-31 17:41:14 -04:00
tools refac 2026-08-13 18:19:25 -06:00
utils refac 2026-08-14 00:55:21 -06:00
__init__.py refac 2026-07-27 19:39:36 -04:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-08-13 19:59:11 -06:00
constants.py fix: reject COUNT rules without DTSTART so limited automations cannot run forever (#27781) 2026-08-12 01:08:55 -06:00
env.py perf: opt-in routed delivery for the socket.io Redis manager 2026-08-14 20:09:57 +02:00
events.py refac 2026-08-10 23:13:10 -06:00
functions.py perf: build debug log messages lazily so disabled debug logs cost nothing (#27834) 2026-07-31 19:09:01 -05:00
main.py refac 2026-08-13 21:36:41 -06:00
tasks.py refac 2026-08-14 00:22:17 -06:00