Back Home

GitHub Repo

Open WebUI Discussion Clarifies SQLite Connection Pool Risks: Default Capacity May Exceed Open-File Limit

On November 14, the Open WebUI community reported that a long-running SQLite deployment could no longer connect to model services after exhausting file descriptors. Project members did not reproduce a connection leak, but noted that a fully loaded default connection pool could exceed the system’s soft limit of 1,024 open files.

NASA · Public domain · Image source
zh-Hant

A November 14 incident discussion in Open WebUI highlighted a capacity issue that can be easy to overlook in self-hosted AI interfaces: database connection pool settings may not match the operating system’s file descriptor limit. The reporter was using v0.13.3, a native installation, and the default SQLite configuration. After about two and a half days, they encountered Too many open files, which also caused outbound HTTP calls to model services to fail. Restarting restored service. Incident discussion

The report initially attributed the problem to a connection leak when canceling responses. Project member Classic298 said they could not reproduce it in the current development branch after 1,200 chat turns and 2,000 randomly canceled saves. They noted that the existing cancellation handler rolls back connections and returns them to the pool, so the available evidence does not confirm a new leak bug. The issue was closed as not planned. Testing and response

The clearer risk lies in the capacity settings. The official documentation states that when SQLite’s DATABASE_POOL_SIZE is unset or set to zero, the pool still uses 512 connections, with 10 additional overflow connections allowed; zero does not disable pooling in this case. A project member explained that each connection holds file descriptors for the database and WAL files, so a fully loaded configuration could exceed the soft limit of 1,024. As a result, pressure on database resources can appear as a model connectivity failure, making diagnosis more difficult. Connection pool settings

Engineering teams can start by reducing the pool size according to actual concurrency, then checking the service’s open-file limit. The discussion suggests DATABASE_POOL_SIZE=32 as an example adjustment; the official container documentation lists a file descriptor limit of 65,536. Each process has its own connection pool, so resource needs should be recalculated when adding workers or replicas. Deployment resource settings, processes and connection pools

Next, teams should monitor whether descriptor counts continue to rise after reducing the pool size, and retain operating steps and server logs. The discussion identifies a deployment risk that can be checked and mitigated immediately; it does not establish that all long-running instances have the same defect.

Sources

  1. Open WebUI issue #34417:SQLite instance runs out of open files after days of use
  2. Open WebUI 環境變數文件:DATABASE_POOL_SIZE
  3. Open WebUI 效能文件:Container Resource Limits