Incident Library
Applied filters SymptomConnection pool exhaustionFactorMonitoring blind spotClear allEvery case under the filters, with no sentence; newest first.
Suggested filters Search, and the values found in your words appear here.

Graph

  • Root cause
  • Component
  • Symptom
  • Contributing factor
  • Case

Cases4 cases

1 to 4 of 4

  1. Symptoms

    On 31 March 2026 Buttondown was down twice, for about seven and about thirteen minutes. New requests could not get a database connection and failed, although the database itself was healthy: queries were fast, CPU and memory were fine and replication lag was nominal.

    Root cause
    Component
    Contributing factor
    Detection

    User reports and the team's own manual observation, not automated monitoring. The health check endpoint kept returning 200 for most requests, so no alert fired.

    Remediation
    • Killed active queries to free database connections in the first outage
    • Restarted the database to force-kill the running queries in the second outage
    Action items
    • Reserve a small number of database connections for administrative access
    • Monitor and alert on the database connection count as a percentage of the configured maximum
    • Make the health check endpoint run a lightweight query so connection exhaustion shows in the health checker and the load balancer
    • Add database connection limits to the quarterly capacity review
    • Document and script a fallback that force-recycles workers to release connections without needing a database connection
    Lessons

    Buttondown notes that the tool used to recover from the first outage needed the same resource that was exhausted, which locked the team out during the second outage, and that a health check which cannot detect connection exhaustion, the most common failure mode, gives little protection. A configuration value set long ago drifted out of line with traffic because nobody reviewed it.

  2. Symptoms

    At 13:08 UTC on 15 September 2025, Clerk's internal monitoring alerted on significant request failures and increased latency. Over the following days the request failures and latency spikes kept coming back while the Postgres database stayed unhealthy, with repeated spikes in database load.

    Trigger

    At 05:30 UTC on 14 September 2025 the cloud provider automatically upgraded Clerk's Postgres database to a new minor version, which changed how Postgres handled connection locks.

    Root cause
    Component
    Contributing factor
    Detection

    Internal monitoring alerted on significant request failures and increased latency at 13:08 UTC on 15 September. Shortly after the upgrade on 14 September it had already shown an increased but still acceptable database load.

    Remediation
    • Optimised several expensive queries, refined critical indexes and re-indexed the database
    • Blocked abusive traffic more aggressively for a time
    • Performed a manual minor version upgrade and increased database capacity
    • Added jitter to the connection pooling configuration so connections no longer recycled in step
    Action items
    • Evaluate other database providers that give more control over upgrades and downgrades
    • Isolate more services from each other, for example Sign Up and Sign In infrastructure from the rest of the system
    • Keep optimising the most costly database queries
    • Evaluate sharding and multi-tenant infrastructure to isolate one application from others
    Lessons

    Clerk's review found that connection metrics sampled every 60 seconds could not show a recycling pattern that lasted seconds and repeated every 15 minutes, that an attack and background jobs with similar periods pulled attention away from the database layer, that the Backend API looked healthy only because it manages far fewer connections, and that the release freeze removed the staggering of connection creation that normal deploys provide.

  3. Symptoms

    Over two weeks in early 2023, incident.io's Go application intermittently timed out on requests that used its Postgres database. A customer reported the problem, Sentry showed a burst of context canceled errors, and the first episode was over within a minute.

    Root cause
    Component
    Contributing factor
    Detection

    A customer report and a flurry of context canceled errors in Sentry; the on-call engineer opened an incident and checked the Grafana API dashboard. In the second episode an incident was opened automatically and the on-call engineer was pulled into it.

    Remediation
    • Moved the policy violations calculation to a materialised view
    • Added database indices for slow queries
    • Rewrote queries to filter on an indexed column already present in the join
    • Added a one second lock timeout to all transactions
    • Forwarded incoming Slack webhooks to PubSub and processed them asynchronously
    • Added a middleware that logs how long each operation holds a database connection
    • Removed the unnecessary transaction from most Slack modal submissions, keeping it only where needed
    Lessons

    The cause was not one slow operation but many short transactions that, added together, caused the problem. The investigation left incident.io with a way to filter logs and traces by how long each operation holds a database connection, and with real performance improvements. Separate databases for separate parts of the application would probably have made the cause easier to find, but would bring distributed transactions and less convenient development environments, a trade-off incident.io chose not to make for now.

  4. Symptoms

    At 9:34 UTC on November 23, 2022, RevenueCat started moving traffic from its Aurora PostgreSQL 10.x cluster to a new Aurora PostgreSQL 14.x cluster. By 9:39 UTC all traffic was on the new cluster, latency was bad, and the RevenueCat dashboard and the endpoints used by the RevenueCat SDK stopped working.

    Trigger

    At 9:34 UTC production traffic was switched from the Aurora PostgreSQL 10.x cluster to the new Aurora PostgreSQL 14.x cluster, before ANALYZE had run on its largest tables.

    Root cause
    Component
    Contributing factor
    Detection

    At 9:39 UTC, with all traffic on the new cluster, latency looked bad and the infrastructure team began to investigate.

    Remediation
    • Added a statement timeout to the database user so queries could not hold a connection too long
    • Shed 90% of traffic by returning 503s from the load balancer
    • Dropped indexes that the planner was using wrongly and that were not needed
    • Stopped accepting Apple webhooks for a time
    • Rolled out a release without New Relic to stop its EXPLAIN queries
    • Ran ANALYZE by hand on the biggest tables
    • Raised the values of the affected primary key sequences with a prepared script
    • Stopped the integration event dispatcher by hand
    • Replayed the webhooks that were dispatched but not recorded
    • Restored integration event dispatching, ETLs and other non-web server jobs
    Action items
    • Consider change freezes during business-critical periods
    • Explain better how the SDK behaves during backend outages
    • Tell customers about maintenance and outages in the developer dashboard and by direct email to technical contacts
    • Replay a subset of write traffic in migration dry runs to mimic the cutover
    • Move costly processes to asynchronous work to keep the API fast and stable
    • Re-evaluate table indexes, including unused ones the database may choose for queries
    • Show the load of each endpoint and system in the database dashboards
    • Involve support and customer communications staff during outages
    Lessons

    The new cluster had not been analyzed, and the tests missed it because the test cluster had been up long enough to gather statistics. Dry runs replayed no write traffic, on the belief that writes are simpler than reads, and the team assumed sequence state was replicated with the data. Rolling back at the start would have been better than fixing forward. The migration, timed to finish before Thanksgiving and Black Friday, should have been delayed until the week after, because the US had entered a sensitive period and part of the US support team was already on holiday.

Check your cluster for this

These 4 cases involve Database and Database proxy and connection pooler. kubegap audits a Kubernetes cluster for gaps like these, read-only, from Claude Code or Codex; its checks cite public reports like the ones in this library.

By root cause3