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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user