3x-ui/database
MHSanaei cfec48afec
chore(db): backend-aware pool sizes with env overrides
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.
2026-05-27 22:37:40 +02:00
..
model fix(xray-config): strip panel-only fields from inbound config 2026-05-27 22:00:47 +02:00
db.go chore(db): backend-aware pool sizes with env overrides 2026-05-27 22:37:40 +02:00
db_seed_test.go fix: address open bug reports (#4539, #4538, #4535, #4531, #4515) (#4545) 2026-05-25 00:08:06 +02:00
dialect.go Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00
migrate_data.go Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00