Performance degradation when using an external database ,especially when functions are enabled. #4227

Closed
opened 2025-11-11 15:49:08 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @xinhai-ai on GitHub (Mar 4, 2025).

Bug Report

Installation Method

git clone

Environment

  • Open WebUI Version: v0.5.18 dev version
  • Postgres:Latest: in local docker
  • Operating System: Windows 10
  • Browser (if applicable): Firefox

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Description

When using an external database (e.g., PostgreSQL), fast model output with enabled functions causes abnormal database reads and abnormally slow output speeds. It appears that streaming responses are constantly requesting the database, resulting in performance degradation. I believe this issue is critical.

Reproduction Details

Steps to Reproduce:
An external database(e.g., PostgreSQL), A fast model (e.g. o3-mini or R1 70b) with an simple functions like

from pydantic import BaseModel, Field
from typing import Optional

class Filter:

    def __init__(self):
        pass

    def inlet(self, body: dict, __user__: Optional[dict] = None) -> dict:
        return body

    def outlet(self, body: dict, __user__: Optional[dict] = None) -> dict:
        return body

Logs and Screenshots

Screenshots/Screen Recordings (if applicable):

https://github.com/user-attachments/assets/854a592d-8749-48fd-a25a-370f4a1561e3

Originally created by @xinhai-ai on GitHub (Mar 4, 2025). # Bug Report ## Installation Method git clone ## Environment - **Open WebUI Version:** v0.5.18 dev version - **Postgres:Latest:** in local docker - **Operating System:** Windows 10 - **Browser (if applicable):** Firefox **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest version of both Open WebUI and Ollama. - [ ] I have included the browser console logs. - [ ] I have included the Docker container logs. - [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Description When using an external database (e.g., PostgreSQL), fast model output with enabled functions causes abnormal database reads and abnormally slow output speeds. It appears that streaming responses are constantly requesting the database, resulting in performance degradation. I believe this issue is critical. ## Reproduction Details **Steps to Reproduce:** An external database(e.g., PostgreSQL), A fast model (e.g. o3-mini or R1 70b) with an simple functions like ``` from pydantic import BaseModel, Field from typing import Optional class Filter: def __init__(self): pass def inlet(self, body: dict, __user__: Optional[dict] = None) -> dict: return body def outlet(self, body: dict, __user__: Optional[dict] = None) -> dict: return body ``` ## Logs and Screenshots **Screenshots/Screen Recordings (if applicable):** https://github.com/user-attachments/assets/854a592d-8749-48fd-a25a-370f4a1561e3
Author
Owner

@tjbck commented on GitHub (Mar 4, 2025):

You should use async.

@tjbck commented on GitHub (Mar 4, 2025): You should use `async`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#4227