open-webui/backend/open_webui
Classic298 e1e31973f0
perf: renaming a folder or deleting all chats takes seconds when many users are online (#32888)
* perf: renaming a folder or deleting all chats takes seconds when many users are online

Renaming, sharing, moving or deleting a folder, and deleting all chats, each made the server recheck access for every chat that any online user had open in a browser tab, one database lookup at a time, before the request finished, and every one of those open chats reloaded its contents afterwards. Any user can do these, so with a few thousand people online every such click took several seconds and reloaded everyone's open chat. Owners keep access to their own chats (a role change or account deletion already disconnects them), so the recheck now skips owners entirely, with no lookup and no reload, and only checks people viewing someone else's chat and chats that no longer exist. Anyone who lost access is still removed from the chat as before.

Postgres 16, one open chat per online user, 2% of them viewing someone else's chat, time for a folder rename (the other actions above run the same recheck):

| Online users | No Redis, before | No Redis, after | Redis, before | Redis, after |
| --- | --- | --- | --- | --- |
| 1,000 | 2.2 s | 0.12 s | 2.5 s | 0.23 s |
| 3,000 | 6.9 s | 0.60 s | 7.7 s | 0.78 s |

* refac: collect the open chats with a plain loop

Same behaviour, the owner lookup now reads more plainly.

* refac: shorten the owner comment in the chat access sweep
2026-10-25 07:21:47 +09:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal fix: requests hang or fail with 503 after pages are closed while loading (#32617) 2026-10-21 03:23:05 +09:00
migrations refac 2026-10-14 18:49:51 +04:00
models perf: renaming a folder or deleting all chats takes seconds when many users are online (#32888) 2026-10-25 07:21:47 +09:00
retrieval chore: Python 3.12 and Debian 13 base image (#32861) 2026-10-22 04:51:57 +09:00
routers refac 2026-10-25 04:50:39 +09:00
socket perf: renaming a folder or deleting all chats takes seconds when many users are online (#32888) 2026-10-25 07:21:47 +09:00
static refac 2026-09-06 17:27:30 -04:00
storage refac 2026-10-05 12:03:19 +04:00
tools refac 2026-10-21 09:53:09 +09:00
utils fix: MCP tools whose input has alternative forms are called with no arguments (#32903) 2026-10-25 06:22:08 +09:00
__init__.py chore: Python 3.12 and Debian 13 base image (#32861) 2026-10-22 04:51:57 +09:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-10-25 04:50:39 +09:00
constants.py fix: SSO login failures show the email/password error (#31629) 2026-09-30 19:07:49 +04:00
env.py feat: connect to MCP servers that speak protocol version 2026-07-28 (#33087) 2026-10-25 04:41:10 +09:00
events.py refac: recheck live chat access after archiving and bulk unsharing (#32887) 2026-10-22 08:32:51 +09:00
functions.py fix: pipes and tools get None instead of a file list when nothing is attached (#32380) 2026-10-14 12:18:55 +04:00
main.py fix: Terminal capability shows while no terminal server exists (#32966) 2026-10-25 05:15:13 +09:00
tasks.py refac 2026-10-16 04:20:53 +04:00