When using external PostgreSQL instances (Azure Flexible Server/Google Cloud SQL), Open WebUI becomes severely sluggish – simple actions like opening a chat take 10-15 seconds.
Latency multiplier: 150-250ms average database response time
Cumulative effect: A window reload triggers ~20 API calls → 60-100 database queries. This is about 15 seconds for me.
Note: Pooling has helped me to cut the response times in half. Still, the issue persists.
Example Breakdown
For get_chat_tags_by_id:
Authentication: 3 queries (200ms × 3 = 600ms)
Endpoint logic: 2+ queries (200ms × 2 = 400ms)
Total: ~1 second baseline before business logic
Key Questions
Are others running Open WebUI successfully with managed databases at this latency tier?
Can we:
Reduce auth query count (3→1?)
Reduce redundant user activity updates or at least update asynchronously
Parallelize queries in endpoint chains
What caching strategies work for session data without sacrificing security?
Query Log
Here's all queries launched for one page reload (61 queries): queries.log
Thanks!
Originally created by @TobiasGoerke on GitHub (Feb 26, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/10807
## Description
When using external PostgreSQL instances (Azure Flexible Server/Google Cloud SQL), Open WebUI becomes severely sluggish – simple actions like opening a chat take 10-15 seconds.
The core issue stems from:
* Query amplification: 3+ auth queries (`get_user_by_id`, `update_user_last_active_by_id`) + 2+ endpoint-specific queries per request
* Latency multiplier: 150-250ms average database response time
* Cumulative effect: A window reload triggers ~20 API calls → 60-100 database queries. This is about 15 seconds for me.
* Note: Pooling has helped me to cut the response times in half. Still, the issue persists.
## Example Breakdown
For `get_chat_tags_by_id`:
* Authentication: 3 queries (200ms × 3 = 600ms)
* Endpoint logic: 2+ queries (200ms × 2 = 400ms)
* Total: ~1 second baseline before business logic
## Key Questions
1. Are others running Open WebUI successfully with managed databases at this latency tier?
2. Can we:
* Reduce auth query count (3→1?)
* Reduce redundant user activity updates or at least update asynchronously
* Parallelize queries in endpoint chains
3. What caching strategies work for session data without sacrificing security?
## Query Log
Here's all queries launched for one page reload (61 queries):
[queries.log](https://github.com/user-attachments/files/18981257/queries.log)
Thanks!
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @TobiasGoerke on GitHub (Feb 26, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/10807
Description
When using external PostgreSQL instances (Azure Flexible Server/Google Cloud SQL), Open WebUI becomes severely sluggish – simple actions like opening a chat take 10-15 seconds.
The core issue stems from:
get_user_by_id,update_user_last_active_by_id) + 2+ endpoint-specific queries per requestExample Breakdown
For
get_chat_tags_by_id:Key Questions
Query Log
Here's all queries launched for one page reload (61 queries):
queries.log
Thanks!