Performance Engineering — methodology in action. Three scenarios: (1) CPU flame graph reveals 60% CPU in jackson.ObjectMapper init — fix with static singleton beats horizontal scale by 4×; (2) Continuous profiling (Pyroscope) catches a regression in v2.4 (gzip on tiny payloads) within 1h via version diff; (3) Load test with k6 surfaces tail latency at p99 — mean lies (45ms), p99 is 2.8s due to autovacuum stop-the-world; tuned + hedged requests bring p99 to 280ms. Topology: production service (lb/api/cache/db) instrumented with /debug/pprof, scraped by Pyroscope into a flame graph UI. SRE tooling: k6 load gen, Prometheus RED metrics, Grafana p99 dashboard, Tempo traces. On-call engineer drives flame graph inspection, SLO checks, and load runs. Two ADRs: optimize hot path before scaling horizontally; continuous profiling in prod over ad-hoc local profiling.
Performance engineering is an evidence loop: define a user/workload objective, measure a representative baseline, localize the limiting resource or path, form a hypothesis, change one controlled factor, and compare against correctness and resource cost. Metrics, traces and profiles answer different questions and each can be biased or intrusive.
Percentiles expose distribution tails but are not universally superior to every other statistic. Means, medians, percentiles, histograms, throughput, concurrency, queueing and resource utilization all have valid roles when tied to a decision. Synthetic benchmarks require workload fidelity and production measurements require safety, privacy and overhead controls.
VACUUM uses a lock compatible with normal reads/writes and can cause I/O pressure; VACUUM FULL takes ACCESS EXCLUSIVE. Tail truncation can also briefly seek a stronger lock. “Autovacuum locks the table for two seconds” is not a valid general claim.Representative baseline. The engineer fixes workload, correctness, windows and resource metrics before interpreting a latency distribution.
Profile and validate a hypothesis. A sampling profile localizes CPU work, but a canary experiment verifies latency and resource changes under the same workload.
Plain VACUUM lock semantics. Routine vacuum coexists with normal DML but its I/O and exceptional stronger-lock phases remain observable.
Bounded idempotent hedge. A delayed duplicate is used only for a safe read, with a load budget and cancellation of the losing request.
Введите числа или выберите пресет