Performance
Incident to enforcement: SLO burn to verified fix in 35 minutes
An SLO burn alert fires at 10:47 am. Without continuous profiling and distributed traces, the on-call spends the afternoon guessing. With them, she has a root cause and a fix deployed by 11:22 am. The 35-minute window is not luck — it is the previous investment in observability paying off under pressure.
The incident: /checkout p99 burns the SLO
At 10:47 am, an alert fires: “checkout SLO p99 burn rate 14x — 12 hours of error budget consumed in 6 hours.”
The on-call engineer opens the unified dashboard. No deploys in the last hour. Traffic at baseline. This is not a spike — something changed in a downstream service.
Step 1: Observe — 60 seconds
Prometheus: /checkout p99 jumped from 240 ms to 1.4 s. Started approximately two hours ago. RPS flat. Error rate flat. Pure latency degradation.
RUM: client-side LCP unaffected. This is a server-side problem, not a bundle regression.
Step 2: Profile — 90 seconds
Pyroscope filtered to /checkout over the last two hours:
runtime.scanobject: 22% (baseline: 4%)
runtime.mallocgc: 9% (baseline: 2%)
encoding/json.Marshal: 24% (baseline: 4%)
handlers.Checkout: 6%
pgx.Query: 12%GC frames jumped from 6% to 31%. JSON Marshal jumped from 4% to 24%. Something is producing much more garbage and serialising much larger payloads than before.
Step 3: Classify — 60 seconds
Allocation-bound (family: GC / piece 04), with the serialisation overhead pointing at an unusually large response being produced, not just processed. This is the N+1 family pattern (piece 05) applied to inter-service payloads: something upstream started returning bulk data where a summary was sufficient.
Amdahl on the combined GC + Marshal frames (55%): 1 / (1 - 0.55) = 2.2x. That would bring p99 from 1.4 s to 636 ms — still above the 200 ms SLO. The root cause is not just “GC is hot”; it is whatever is causing the GC and Marshal pressure.
Step 4: Trace correlation — 5 minutes
Open Tempo, filter to slow /checkout traces in the last two hours. The waterfall shows:
[span] handle_request 1820ms
[span] auth_check 5ms
[span] order_query 340ms (baseline: 12ms)
[span] inventory_check 850ms (baseline: 80ms)
[span] payment_call 280ms (baseline: 90ms)
[span] serialise_response 340ms (baseline: 8ms)Every downstream span and the serialisation step degraded by the same multiplier. This is the pattern of an upstream service returning a response that is much larger than expected — every consumer step inflates proportionally.
Check deploy history: inventory-service rolled out at 10:31 am — 16 minutes before the SLO burn started. Diff: added include_full_sku_details: true to the /inventory response. Previously returned SKU IDs only; now returns full SKU objects. Response payload: 8 KB → 85 KB per call.
The /checkout service receives 85 KB, deserialises it (more allocations), selects 0.1% of the data it needs, then serialises its own response including the inflated inventory data. All three cost centres — GC, Marshal, downstream latency — trace to a single cause.
| Signal | Observation | Implication |
|---|---|---|
| Pyroscope GC frames | 6% → 31% | Much more garbage produced per request |
| Pyroscope json.Marshal | 4% → 24% | Much larger payload being serialised |
| Tempo: inventory_check span | 80ms → 850ms | Upstream service much slower or returning more |
| Deploy log: inventory-service | 10:31 am deploy | Payload grew 8 KB → 85 KB per call |
| Combined | All degraded spans correlate | Single root cause: inventory-service deploy |
Step 5: Fix — 15 minutes
Two parallel actions:
- Roll back the inventory-service deploy via the deploy console.
- Add a defensive check in /checkout: reject any inventory response over 64 KB with an error before processing.
Both ship within 15 minutes.
Step 6: Verify — 10 minutes
Pyroscope after rollback: scanobject returns to 4%, mallocgc to 2%, json.Marshal to 4%. Profile baseline restored.
Prometheus: /checkout p99 at 235 ms within 5 minutes of the rollback completing. SLO burn rate drops to 0.1x.
Both the local profile AND the headline metric confirmed.
Step 7: Enforce — the sprint after
Three enforcement actions, all taken in the following sprint:
A. PR gate: inter-service response size. Any PR to any service that changes a response schema must pass a contract test asserting the body size does not exceed 2x the current median. PRs that grow a response by more than 2x require explicit SRE review.
B. Production alert: per-endpoint payload size p99. Add a metric tracking p99 response body bytes per downstream call. Alert if it grows more than 50% week-over-week. First time this class of regression fires, the alert routes to the responsible team’s on-call before the SLO burns.
C. Runbook entry. “p99 spike on /checkout with all spans degraded proportionally → check upstream deploys in the last 2 hours for response-schema changes. Check inventory-service specifically.” The next on-call resolves this in under 5 minutes instead of starting from scratch.
Total elapsed from page to fix: 35 minutes. Total elapsed to enforcement: one sprint (1 week). Engineer-hours: incident response + postmortem + enforcement: 6 hours. Without continuous profiling + traces: estimated 4 to 8 hours for the incident alone.
Why this works
The enforcement step is what separates discipline from firefighting. The incident consumed 35 minutes. Without the gate, the exact same class of regression — a different service’s response growing unexpectedly — will consume another 35 minutes in 3 to 6 months. With the gate, every future PR that changes a response schema is checked. The one-time cost of adding the gate is under 4 engineer-hours. The recurring cost it prevents is 35+ minutes per incident, potentially dozens of times.
- Time from page to verified fix (with full stack)
- 35 minutes
- Time from page to root cause (without continuous profiling)
- 4–8 hours
- Inventory-service response payload growth
- 8 KB → 85 KB
- p99 degradation on /checkout
- 240ms → 1820ms
- p99 after rollback (within 5 min)
- 235ms
- Engineer-hours to add enforcement gates
- ~4 hours
- Average incidents prevented per enforcement gate
- 3–8 per year
In the /checkout incident, the profile showed GC and json.Marshal both spiking. A naive response would fix the allocation hotspot. Why is that wrong?
Why does the enforcement step (adding CI gates and runbook entries) matter more than the fix itself?
Order the diagnostic steps in the /checkout incident from first observation to confirmed root cause:
- 1 SLO alert: p99 at 1.4s, RPS flat, RUM unaffected — server-side only
- 2 Profile shows GC frames 6% → 31%, json.Marshal 4% → 24%
- 3 Classify: allocation-bound + serialisation-bound; root cause must be upstream
- 4 Trace: every downstream span degraded proportionally — upstream bulk payload
- 5 Deploy log: inventory-service shipped at 10:31am with full SKU details in response
- 6 Rollback inventory-service; profile and p99 return to baseline within 5 minutes
- 01Walk through how each of the five observability signals contributed to resolving the /checkout incident.
- 02The /checkout incident combined family 04 (GC) and family 05 (N+1/bulk payload). How does cross-family identification change the fix strategy?
- 03What are the three enforcement actions taken after the /checkout incident, and what class of regression does each prevent?
The /checkout incident ran from page to verified fix in 35 minutes because the five-signal observability stack was in place. Metrics named the service and severity. RUM ruled out client-side causes. Profiles showed GC and serialisation pressure — two effects of one cause. Traces showed all downstream spans degrading proportionally, pointing at an upstream service. Deploy history confirmed the inventory-service payload grew from 8 KB to 85 KB 16 minutes before the SLO burn. The fix was a rollback plus a defensive size check. The enforcement step — PR gate, payload-size alert, runbook entry — prevents the entire class of upstream payload regressions from becoming incidents in the future. This is what distinguishes a discipline from firefighting: the incident retro ends with a gate, not just a fix.
appears again in260
- Why GraphQL gets N+1junior
- DataLoader mechanics: tick-boundary batchingmiddle
- Batch function contracts: ordering, shapes, errorsmiddle
- Federation and lookahead: batching beyond DataLoadermiddle
- Query complexity defences: depth, cost, persisted queriesmiddle
- Senior GraphQL API: scheduling contract, tenant isolation, observabilitysenior
- The journey of a request: seven stops from socket to responsejunior
- Accept and parse: from kernel queue to a typed requestmiddle
- Routing and middleware: choosing what runs, and in what ordermiddle
- Handler and response: from business logic to bytes on the wiremiddle
- Streaming and backpressure: when the client reads slower than you writesenior
- Timeouts and tail latency: budgets, deadlines, and the fan-out trapsenior
- Middleware and DI: the two patterns that shape every backendjunior
- Writing middleware: signatures, next(), and the three framework modelsmiddle
- Inversion of control: how dependencies reach a classmiddle
- DI scopes and lifecycles: singleton, request, transientmiddle
- DI as a testing seam: fakes, mocks, and the boundary that matterssenior
- DI containers in production: resolution graphs, circular deps, and when not tosenior
- Blocking vs non-blocking I/O: two ways to waitjunior
- The event loop: one thread, ordered phasesmiddle
- What blocks the loop: CPU work and sync callsmiddle
- Offloading CPU work: worker threads and the libuv poolmiddle
- Backpressure and bounded concurrencysenior
- Throughput under load: tail latency and saturationsenior
- Why pool: the cost of creating a connectionjunior
- Pool sizing: why bigger is not fastermiddle
- Acquisition and timeouts: the wait queue is the real latency dialmiddle
- Why idempotency: making retries safejunior
- Server-side state machine: four states of an idempotency keymiddle
- Retry strategies: backoff, jitter, and thundering herdmiddle
- Outbox and inbox: effectively-once across the dual-write boundarymiddle
- Concurrency and cache architecture for idempotency at scalesenior
- Observability, production failures, and global-scale designsenior
- The event loop: one thread, three queuesjunior
- Tasks, microtasks, and scheduler.yield()middle
- Timer accuracy, throttling, and idle workmiddle
- Microtask starvation, Long Tasks, and LoAFsenior
- Node.js event loop: phases, nextTick, and loop lagsenior
- React, Vue, and INP observability in productionsenior
- The render pipeline: six stages from bytes to pixelsjunior
- Stage costs and the renderer process modelmiddle
- Invalidation, dirty bits, and containmiddle
- Compositor layers: promotion, overlap, and GPU memorymiddle
- DevTools flame strip and the frame lifecyclemiddle
- Layout thrash: forced synchronous layoutsenior
- BeginMainFrame, compositor-driven animations, and GPU memorysenior
- Production observability: LoAF, INP, and the full attack surfacesenior
- What V8 is and why performance varies 100×junior
- V8''''s four-tier JIT pipeline and profile-guided tieringmiddle
- Hidden classes, transition trees, and memory layoutmiddle
- Inline caches, IC states, and deoptimizationmiddle
- Orinoco GC: parallel scavenger, concurrent marking, and write barriersmiddle
- TurboFan''''s speculative engine and the deopt-loop trapsenior
- V8 in production: isolates, pointer compression, and real failuressenior
- Service worker lifecycle and cache strategiesmiddle
- Service worker edge cases: version skew, durability, and navigation trapssenior
- What the reconciler does: render vs commitjunior
- The fiber object and the double-buffer treemiddle
- Render phase purity and commit phase sub-stepsmiddle
- Reconciliation: diffing heuristics and the key trapmiddle
- Priority lanes, time-slicing, and useTransitionmiddle
- Bailout, memoisation, and tearingsenior
- React Profiler, the Compiler, and production observabilitysenior
- Rendering strategies: SSG, SSR, ISR, streaming, and hydrationjunior
- SSG, SSR, ISR, streaming, and RSC — how each worksmiddle
- Hydration cost: selective, progressive, islands, resumabilitymiddle
- Hydration mismatch: causes, detection, and the determinism rulesenior
- RSC, per-route strategy, and production observabilitysenior
- Core Web Vitals: what LCP, INP, and CLS measurejunior
- LCP: four phases, one dominant costmiddle
- INP: input delay, processing, presentationmiddle
- CLS: why layout shifts happen and how to stop themmiddle
- Lab vs field: why the two disagree and how to use eachmiddle
- Metric tradeoffs, RUM attribution, and the CI+field loopsenior
- The full picture: URL to LCP to INP as a relay racejunior
- Eight layers traced: from the service worker to the second navigationmiddle
- Five canonical breaks: where production reliably diessenior
- The three-track method: reading traces and building a monitored systemsenior
- What is a cache stampede and why it makes things worsejunior
- Lock and single-flight: bounding concurrent rebuildsmiddle
- XFetch: coordination-free probabilistic early expirationmiddle
- Stale-while-revalidate and CDN request coalescingmiddle
- Detecting stampedes and designing TTL for productionmiddle
- Metastable failure, fencing tokens, and production postmortemssenior
- What a relation is: tables, rows, keys, and constraintsjunior
- Constraints, keys, and Postgres data typesmiddle
- Normal forms, denormalization, and why schemas stickmiddle
- JSONB, arrays, and when a side table winsmiddle
- Heap storage, TOAST, and column alignmentsenior
- Schema integrity: deferral, versioning, and production failure modessenior
- Relational vs document, wide-column, graph, and key-valuesenior
- What an index is and how it speeds up queriesjunior
- The leading-column rule and composite index designmiddle
- Partial, expression, and covering indexesmiddle
- Index types: GIN, GiST, BRIN, Hash, Bloom, and HOT updatesmiddle
- Index-only scans, the Visibility Map, and INCLUDEsenior
- Production failure modes and the index audit playbooksenior
- Index design exercise: full-text search strategysenior
- EXPLAIN and execution plans: what the planner decides and whyjunior
- Scan types: Seq, Index, Bitmap, Index-Onlymiddle
- Join algorithms and the row-estimate cascademiddle
- pg_statistic, ANALYZE, and production observabilitymiddle
- Extended statistics: fixing correlated-column estimate failuressenior
- Plan cache, cost-constant tuning, and planner internalssenior
- Production failure modes and plan stabilitysenior
- MVCC: why readers and writers never wait for each otherjunior
- Row versions and snapshots: the on-disk mechanicsmiddle
- HOT updates and isolation levels: what you gain and what you paymiddle
- Vacuum and bloat: keeping the storage tax boundedmiddle
- CLOG, XID wraparound, and MultiXact: deep visibility internalssenior
- SSI internals and production autovacuum tuningsenior
- Real-world MVCC failures, deployment patterns, and distributed snapshotssenior
- Connection pools: amortising the cost of a Postgres backendjunior
- PgBouncer session, transaction, and statement modesmiddle
- Pool sizing: the (cores × 2) + spindles formula and the two-layer stackmiddle
- Pool exhaustion and idle-in-transaction: the 3 AM failure modemiddle
- Migrating to transaction mode: rollout playbook and PgBouncer 1.21 prepared statementsmiddle
- The Postgres process model and why raising max_connections degrades throughputsenior
- Pooler landscape 2026, serverless connection storms, and the full failure-mode taxonomysenior
- What a schema migration is and why it replaces ad-hoc DDLjunior
- ADD COLUMN: instant in PG 11+ vs rewrite in older Postgresjunior
- The lock-queue failure mode: why instant DDL can freeze the databasemiddle
- Safe DDL patterns: NOT VALID, CONCURRENTLY, and unsafe-op fixesmiddle
- Expand-contract: zero-downtime for breaking schema changesmiddle
- Advisory locks, migration tools, and deploy coordinationsenior
- Migration failure taxonomy and production disciplinesenior
- Why sharding exists: the single-Postgres ceilingjunior
- Shard-key selection: hash, range, list, and directory strategiesmiddle
- Partitioning vs sharding: same word, two different thingsmiddle
- Co-location and Citus: the invariant that makes sharding usablemiddle
- The hot-shard failure mode: detection, isolation, and durable policymiddle
- Schema-based sharding and multi-tenancy alternativessenior
- Online resharding, 2PC, and the operational cost of shardingsenior
- The seven acts: from CREATE TABLE to Citusjunior
- Acts 1–3 in depth: schema, indexes, and planner statisticsmiddle
- Acts 4–6 in depth: MVCC bloat, connection pooling, and safe migrationsmiddle
- Act 7 in depth: sharding, co-location, and the seven-tier tradeoff cascademiddle
- Observability, anti-patterns, and production triagesenior
- Raft roles, terms, and why majority quorums prevent split brainjunior
- How Raft replicates a log entry and decides it is safe to commitmiddle
- Raft leader election: timeouts, voting rules, and the four safety propertiesmiddle
- Raft in the real world: partitions, slow disks, and client routingmiddle
- Raft extensions: pre-vote, learners, snapshots, and linearizable readssenior
- Raft in production: membership changes, Multi-Raft, and observabilitysenior
- Where data fetching happens — and why it decides LCPjunior
- Fetch waterfalls — diagnosis and the Promise.all curemiddle
- React Server Components and Suspense streamingmiddle
- Client-side cache: TanStack Query, SWR, and stale-while-revalidatemiddle
- LCP, prefetch, and race conditions in interactive fetchingmiddle
- Senior internals: RSC payload, caching layers, and production failure modessenior
- Bits on the wirejunior
- Latency mathmiddle
- Bufferbloat and congestionsenior
- The physical frontiersenior
- The three-way handshakejunior
- Sequence numbers and connection statemiddle
- Flow control and congestion controlmiddle
- BBR, production observability, and beyond TCPsenior
- DNS: what it does and why it existsjunior
- The resolver walk: referrals, record types, and gluemiddle
- TTL, caching, and DNS propagationmiddle
- The 1-RTT handshake: key shares and ECDHEmiddle
- Session resumption and 0-RTTmiddle
- CDN: putting content next doorjunior
- Anycast and GeoDNS: routing to the nearest edgemiddle
- Tiered cache and Cache-Controlmiddle
- Vary header and cache keysmiddle
- Stale-while-revalidate and cache stampedesenior
- Edge workers and edge-side compositionsenior
- CDN operations and observabilitysenior
- WebSocket: the HTTP upgrade handshakejunior
- WebSocket frame format: opcodes, masking, fragmentationmiddle
- WebSocket vs SSE vs long-polling: choosing the right transportmiddle
- WebSocket backpressure: when clients can''''t keep upmiddle
- Reconnection: jittered backoff, thundering herd, message resumptionsenior
- WebSocket at scale: HTTP/2 multiplexing, permessage-deflate, C10Msenior
- WebSocket in production: proxies, security, and distributed architecturesenior
- What reverse proxies dojunior
- Balancing algorithms: round-robin to power-of-two-choicesmiddle
- L4 vs L7 load balancing and client-IP preservationmiddle
- Health checks, connection draining, and slow startmiddle
- Session affinity, consistent hashing, and the right fixmiddle
- Retry storms, circuit breakers, and load sheddingsenior
- Resilient LB architecture: anycast, zone-aware routing, and observabilitysenior
- Why QUIC and not TCP+TLSjunior
- QUIC streams and head-of-line blockingjunior
- Integrated handshake and 1-RTTmiddle
- Connection IDs and network migrationmiddle
- Loss detection and congestion controlmiddle
- 0-RTT resumption and packet encryptionsenior
- Deployment tradeoffs and CPU costsenior
- DDoS: what it is and why it worksjunior
- Amplification attacks and state exhaustionmiddle
- Rate limiting: algorithms and architecturemiddle
- WAFs, firewalls, mTLS, and HSTSmiddle
- DNS cache poisoning and BGP hijackingsenior
- Defense-in-depth architecture and attack economicssenior
- The twelve layers: one URL, seven actorsjunior
- DNS, TCP, TLS in sequence: where the milliseconds gomiddle
- Critical render path and Core Web Vitalsmiddle
- Proxy intercepts and security gates: rate limiters, WAF, mTLSmiddle
- Alternate paths: QUIC 0-RTT, WebSocket upgrade, connection migrationmiddle
- Observability: distributed traces, USE/RED, and samplingsenior
- Resilience: cascading retries, circuit breakers, and error budgetssenior
- What the three signals are: logs, metrics, and tracesjunior
- Metrics and cardinality: the cost model of a time-series databasemiddle
- Logs and volume: the cost model of structured loggingmiddle
- Traces and sampling: the cost model of distributed tracingmiddle
- Join keys and exemplars: making the three signals composemiddle
- Observability 2.0: wide events and the cost shiftsenior
- Failure modes and engineering practice: cardinality budgets, PII, and samplingsenior
- Why structured logs exist: the diary vs the spreadsheetjunior
- The production log schema: fields every line must carrymiddle
- Log levels and alert routingmiddle
- Sampling strategies and log costmiddle
- PII redaction and log injectionsenior
- Trace context propagation in logssenior
- OTel Logs Data Model and audit logs as a subsystemsenior
- OTel signals, Semantic Conventions, and the OTLP wire formatmiddle
- Auto-instrumentation and manual spans: the 80/20 of OTelmiddle
- The OTel Collector: receivers, processors, exporters, and deployment patternsmiddle
- Sampling strategies: head, tail, and parent-basedmiddle
- Vendor neutrality, eBPF instrumentation, the Operator, and browser/serverless OTelsenior
- Operating the OTel Collector: reliability, version skew, failure modes, and governancesenior
- RED and USE: two checklists, one triage disciplinejunior
- Instrumenting RED in Prometheus: counters, histograms, and cardinality disciplinemiddle
- USE on Linux: CPU, memory, disk, network, and PSImiddle
- Golden signals, dashboard layout, and service mesh auto-REDmiddle
- Cardinality as a cost driver: labels, PII, exemplars, and samplingmiddle
- Native histograms, SLO tie-in, and production failure patternsmiddle
- SLI, SLO, and the error budget: reliability by the numbersjunior
- Choosing SLIs and SLO targets: ratios, not feelingsmiddle
- Multi-window multi-burn-rate alerting: why AND beats ORmiddle
- Error budget policy, latency SLOs, and composite journeysmiddle
- Iceberg SLIs, composite SLO math, and SLA vs SLOsenior
- Production SLO failures, self-observability, security, and the big picturesenior
- Flame graphs: reading the picture that shows where time goesjunior
- Sampling vs instrumentation profiling: why 99 Hz wins in productionmiddle
- Profile types: CPU, memory, off-CPU, mutex — which one to reach formiddle
- Continuous profiling: always-on flame graphs with eBPF and trace-id correlationmiddle
- How flame graphs are built from samples, and the production workflows that use themmiddle
- Linux perf, eBPF internals, PGO, and the limits of samplingsenior
- Profiling in production: security, war stories, OTel profiles, and the infrastructure designsenior
- The debugging funnel: SLO → RED → trace → profilejunior
- OTel architecture: one SDK, four signals, one wire formatmiddle
- Cost discipline: keeping observability under 5% of infra spendmiddle
- The incident loop: from pager to postmortem to preventionmiddle
- Scale, security, and the ROI of observable systemssenior
- At-most-once, at-least-once, exactly-once: the three delivery contractsjunior
- The three failure legs — where duplicates and losses actually happenmiddle
- Consumer-side dedup: the cheapest path to exactly-once processingmiddle
- Kafka exactly-once semantics: idempotent producer and transactionsmiddle
- SQS visibility timeout, DLQ, and the outbox patternmiddle
- Exactly-once in production: impossibility proof, hybrid patterns, and real incidentssenior
- What OAuth is and why passwords are not the answerjunior
- Authorization code flow with PKCEmiddle
- ID token validation and JWKS cache managementmiddle
- Refresh token rotation and scope-based least privilegemiddle
- Sender-constrained tokens: DPoP and mTLSsenior
- OAuth in production: audience attacks, observability, and real failuressenior