mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 03:01:21 +02:00
Large PostgreSQL farms exhausted the fixed pool (pool_size=10 + max_overflow=20): with ~93 printers every connection sat idle in transaction and unrelated requests waited out the 30s pool timeout or failed in the auth middleware. - Make pool sizing env-configurable (DB_POOL_SIZE / DB_MAX_OVERFLOW / DB_POOL_TIMEOUT / DB_POOL_RECYCLE); raise the Postgres default to 20 + 80 with pool_pre_ping + pool_recycle=1800. - Cache the auth_enabled probe (30s) to drop a per-request DB round-trip. Only enabled=True is cached, so staleness fails closed; set_auth_enabled invalidates immediately. - Add GET /api/v1/system/db-pool exposing resolved config + live checked_out/checked_in/overflow gauges without consuming a connection. Session-hygiene (connections held across MQTT/FTP/camera/3MF I/O) is a separate follow-up.