When your database connection pool fills up, queries queue and apps hang. OnCallReady identifies idle or leaked connections, terminates them, rebalances the pool, and restarts offending services — typically under 25 seconds.
Fires on database connection-related alerts indicating pool saturation or connection leak. Typical triggers: "DB connection pool exhausted on api-server", "Too many connections to PostgreSQL", "Connection timeout after 30s", "Max connections reached (100/100)".
Runs pg_stat_activity (or equivalent) to enumerate current connections by state, duration, and application. Identifies idle connections, long-running transactions, and potential connection leaks.
Issues pg_terminate_backend for connections idle >5 minutes. Preserves active query connections. Frees pool slots immediately without requiring service restarts.
Cross-references application tags on connections to identify which service is leaking. Performs a rolling restart of that service to reset its internal connection pool state.
Checks connection count drops below 70% of maximum. Confirms application health endpoints return 200 and database queries complete normally.
Records freed connection count, offending service, and incident timeline. Flags if the max_connections setting is consistently approached — surfaces this for infrastructure review.
OnCallReady catches connection leaks and fixes them in seconds. See it in action.