mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 01:12:43 -05:00
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. <table> <tr><th></th><th>Before</th><th>After</th></tr> <tr><td>Longest server stall, 20 results at 50 ms per lookup</td><td>1020 ms</td><td>11 ms</td></tr> </table> Relates to #35245
This commit is contained in:
1 parent
3592825be8
commit
c865616f9a
1 file changed
+1
-1
@@ -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 = [
|
||||
|
||||
Reference in new issue
Block a user