Bound connection pool to prevent max_connections exhaustion

pool_size=5, max_overflow=10 per app (6 apps = 90 max connections).
Previously pool_size=0 meant unlimited connections, causing
asyncpg.TooManyConnectionsError under concurrent load.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-24 17:08:00 +00:00
parent 322ae481ee
commit 5518c95237

View File

@@ -15,7 +15,8 @@ _engine = create_async_engine(
future=True,
echo=False,
pool_pre_ping=True,
pool_size=0, # 0 = unlimited (NullPool equivalent for asyncpg)
pool_size=5,
max_overflow=10,
)
_Session = async_sessionmaker(