api: add configurable database connection pool settings

Add support for configuring SQLAlchemy connection pool parameters via settings to help prevent pool exhaustion under high load:

  • DATABASE_ENGINE_MAX_OVERFLOW: max overflow connections (default: 10)
  • DATABASE_ENGINE_POOL_TIMEOUT: connection wait timeout in seconds (default: 30)
  • DATABASE_ENGINE_POOL_PRE_PING: test connections before use (default: false) Sends a simple query ("SELECT 1") to verify connection is alive before using it, preventing errors from stale/dead connections after database restarts or network interruptions.
  • DATABASE_ENGINE_POOL_USE_LIFO: use LIFO instead of FIFO (default: false) Returns most recently used connections first, keeping fewer connections active during low traffic and allowing idle connections to be closed.
  • DATABASE_ENGINE_POOL_RECYCLE: recycle connections after N seconds (default: -1) Automatically closes and recreates connections after specified time, preventing issues with stale connections or firewall timeouts. Set to -1 to disable, common values: 300 (5min), 1800 (30min), 3600 (1hr).

Generated-By: Claude Code

Signed-off-by: Miroslav Vadkerti mvadkert@redhat.com

Edited by Miroslav Vadkerti

Merge request reports

Loading