open-webui/backend
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
open_webui perf: opt-in routed delivery for the socket.io Redis manager 2026-08-14 20:09:57 +02:00
.dockerignore fix: litellm config issue 2024-02-24 22:35:11 -08:00
.gitignore refac 2024-09-06 04:59:20 +02:00
dev.sh refac 2026-03-24 19:43:30 -05:00
requirements-min.txt perf: optional orjson JSON codec behind ENABLE_ORJSON (#27583) 2026-07-27 03:45:37 -04:00
requirements.txt fix: make the aiodns resolver opt-in and pin aiodns to 3.6.1 (#28242) 2026-08-10 19:52:29 -06:00
start.sh refac 2026-06-17 03:01:11 +02:00
start_windows.bat fix: generate valid WEBUI_SECRET_KEY in start_windows.bat (#28061) 2026-08-10 23:22:43 -06:00