Files
open-webui/backend/open_webui/utils
G30 6ea591491e perf(images): offload validate_url() DNS resolution with asyncio.to_thread (#25825)
validate_url() calls socket.getaddrinfo() for SSRF protection, which
blocks the event loop for 100-700ms per DNS lookup. This affects:

- Image generation (get_image_data) — every external image URL
- Image editing (load_url_image) — every external image URL
- OAuth profile pictures (_process_picture_url) — every login
- Webhook delivery (post_webhook) — every notification
- Image base64 conversion (get_image_base64_from_url) — chat images

Wrap all 5 async call sites in asyncio.to_thread() so DNS resolution
runs in the thread pool. The event loop remains free to serve other
requests during the lookup.

Benchmark (3 domains, 3 trials averaged):
- BEFORE: max jitter 479ms, 1 blocked ping per trial
- AFTER:  max jitter 1ms, 0 blocked pings (324x improvement)

Co-authored-by: Tim Baek <tim@openwebui.com>
2026-06-29 02:31:24 -05:00
..
2026-06-19 15:34:43 +02:00
2026-06-17 00:36:34 +02:00
2026-06-17 02:52:35 +02:00
2026-06-17 02:52:35 +02:00
2026-06-29 00:05:10 -05:00
2026-03-17 17:58:01 -05:00
2026-06-24 14:13:58 +02:00
2026-06-01 13:56:55 -07:00
2026-06-29 00:35:54 -05:00
2026-06-29 02:20:54 -05:00
2026-06-23 00:25:21 +02:00
2026-06-29 00:18:40 -05:00
2026-06-25 14:37:05 +01:00
2026-06-23 23:35:44 +02:00
2026-03-17 17:58:01 -05:00
2026-06-19 00:16:06 +02:00
2026-06-29 00:35:54 -05:00
2026-06-01 13:56:55 -07:00