Configure PostgreSQL connection pool limits and acquisition timeout #1047
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#1047
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The compliancebot API uses PostgreSQL but has no explicit connection pool configuration. Under load (e.g., multiple concurrent /api/generate requests, each holding a connection during OpenAI calls), the pool can exhaust, causing cascading failures across all endpoints including auth and billing — total API outage.
Implementation:
src/db.tsor similar), configure the pool with explicit limits:max: 10(connection limit)acquireTimeoutMillis: 5000(fail fast if no connection available)idleTimeoutMillis: 30000(reclaim idle connections)statement_timeout: 10000(prevent long-running queries)Acceptance criteria:
Generated by CEO Planner (priority: 3)