Skip to content

Terminal labs · 01 · Intermediate · about 15 min

The pool that ran dry

Alert firingThe page is yours: click the terminal to start
  1. To do: 1. Stop the bleeding: checkout errors under 1% and p99 under 300 ms for 20 s
  2. To do: 2. Fix the cause, not just the symptom
  3. To do: 3. Give support their search back, with checkout still healthy
oncall@shop-prod-1click to type
Checkout p99
1400 ms
-60 snow
  • p991300 ms
  • target300 ms
Checkout errors
100%
-60 snow
  • 5xx92%
  • target1.0%
Database connections
64
-60 snow
  • in use20
  • app pools20
  • max_connections60
Database CPU
100%
-60 snow
  • CPU100%

INFOshop-apiGET /admin/customers/search?email=r.chen@… 200 in 5992 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=4)

ERRshop-apiPOST /checkout 503 in 1008 ms: ConnectionTimeoutError: no connection available within 1000 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=6)

ERRshop-apiPOST /checkout 503 in 1018 ms: ConnectionTimeoutError: no connection available within 1000 ms

INFOshop-apiGET /admin/customers/search?email=a.kowalski@… 200 in 5793 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=7)

ERRshop-apiPOST /checkout 503 in 1023 ms: ConnectionTimeoutError: no connection available within 1000 ms

INFOshop-apiGET /admin/customers/search?email=r.chen@… 200 in 6025 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=6)

ERRshop-apiPOST /checkout 503 in 1017 ms: ConnectionTimeoutError: no connection available within 1000 ms

INFOshop-apiGET /admin/customers/search?email=a.kowalski@… 200 in 5696 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=5)

ERRshop-apiPOST /checkout 503 in 1012 ms: ConnectionTimeoutError: no connection available within 1000 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=10)

ERRshop-apiPOST /checkout 503 in 1034 ms: ConnectionTimeoutError: no connection available within 1000 ms

INFOshop-apiGET /admin/customers/search?email=t.nakamura@… 200 in 6577 ms

WARNpostgresduration: 6217 ms statement: SELECT * FROM orders WHERE customer_email = $1 ORDER BY created_at DESC LIMIT 50

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=7)

ERRshop-apiPOST /checkout 503 in 1024 ms: ConnectionTimeoutError: no connection available within 1000 ms

INFOshop-apiGET /admin/customers/search?email=r.chen@… 200 in 6081 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=5)

ERRshop-apiPOST /checkout 503 in 1014 ms: ConnectionTimeoutError: no connection available within 1000 ms

INFOshop-apiGET /admin/customers/search?email=a.kowalski@… 200 in 5568 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=8)

ERRshop-apiPOST /checkout 503 in 1029 ms: ConnectionTimeoutError: no connection available within 1000 ms

INFOshop-apiGET /admin/customers/search?email=s.dubois@… 200 in 6322 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=7)

ERRshop-apiPOST /checkout 503 in 1023 ms: ConnectionTimeoutError: no connection available within 1000 ms

INFOshop-apiGET /admin/customers/search?email=r.chen@… 200 in 6052 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=6)

ERRshop-apiPOST /checkout 503 in 1016 ms: ConnectionTimeoutError: no connection available within 1000 ms

INFOshop-apiGET /admin/customers/search?email=a.kowalski@… 200 in 5663 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=7)

ERRshop-apiPOST /checkout 503 in 1023 ms: ConnectionTimeoutError: no connection available within 1000 ms

INFOshop-apiGET /admin/customers/search?email=r.chen@… 200 in 6025 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=4)

ERRshop-apiPOST /checkout 503 in 1009 ms: ConnectionTimeoutError: no connection available within 1000 ms

WARNshop-apipool: waited 1000 ms for a connection (active=10/10, waiting=3)

ERRshop-apiPOST /checkout 503 in 1003 ms: ConnectionTimeoutError: no connection available within 1000 ms

The real production dashboard

While you play, the lab sends a real checkout to the live API every 2 seconds with faults that match your incident: failing here means real DB_POOL_TIMEOUT errors there. This is that service's Grafana dashboard, live, with every learner's traffic. Fix the incident and watch its error rate fall within a minute or two.

0 sent · 0 failed
Grafana CloudBuildBreak live demo APIlast 30 minutes · loading…
Recent errors and warnings

Loading…

How this lab works

The shop, its database and its logs are a model running in your browser, one step per second: two app instances with connection pools, Postgres with max_connections, CPU and an 8-million-row orders table. Commands read and change that model, so the terminal, the charts, the logs and the trace always agree, and what you do has consequences, good and bad. Nothing is scripted to a single answer. Your best score is kept on this device only.