mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
Per-backend defaults: - Postgres: 25 max open / 25 max idle. Matching idle to open removes pool churn under bursts (Postgres handles concurrency at the server, idle connections are cheap). - SQLite: 1 max open / 1 max idle. Single-writer model means a wider cap just queues behind busy_timeout; tight cap is honest. Both back ends share ConnMaxLifetime=1h and ConnMaxIdleTime=30m so stale connections (vault rotation, pgbouncer drops, load-balancer idle eviction) rotate out without operator intervention. Operators can override either default at boot via: XUI_DB_MAX_OPEN_CONNS=... XUI_DB_MAX_IDLE_CONNS=... envInt parses these; missing/empty/non-positive values fall back to the per-backend default. |
||
|---|---|---|
| .. | ||
| model | ||
| db.go | ||
| db_seed_test.go | ||
| dialect.go | ||
| migrate_data.go | ||