From c865616f9abed5dc73b2639e2d24a6a6c5ed22c8 Mon Sep 17 00:00:00 2001
From: Classic298 <27028174+Classic298@users.noreply.github.com>
Date: Mon, 30 Nov 2026 20:04:13 +0100
Subject: [PATCH] perf: stop web search URL checks from blocking the server
(#35252)
Each web search resolved the address of every result site before loading it, and those lookups blocked the whole server. With many results or a slow DNS server, other users' requests stalled until all of them finished. The lookups now run without holding up other users.
| Before | After |
| Longest server stall, 20 results at 50 ms per lookup | 1020 ms | 11 ms |
Relates to #35245
---
backend/open_webui/routers/retrieval.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backend/open_webui/routers/retrieval.py b/backend/open_webui/routers/retrieval.py
index 561661ceb3..1bcd5087e4 100644
--- a/backend/open_webui/routers/retrieval.py
+++ b/backend/open_webui/routers/retrieval.py
@@ -2737,7 +2737,7 @@ async def process_web_search(request: Request, form_data: SearchForm, user=Depen
if hasattr(result, 'snippet') and result.snippet is not None
]
else:
- loader = get_web_loader(urls, config)
+ loader = await asyncio.to_thread(get_web_loader, urls, config)
docs = await loader.aload()
urls = [