性能工程:Measure → Locate → Hypothesis → Change → Re-measure
Freshness metadata
last_verified:2026-08-24version_scope:JDK 25 production baselinesource_type:OpenJDK/JDK docs + engineering practicestability:version-sensitive
指标
throughput、latency distribution(p50/p95/p99)、error、resource saturation、queue depth、allocation rate、GC pause、DB wait、cache hit/miss。平均延迟会掩盖尾部。
实验流程
- 固定 workload、dataset、JDK、container limit 与 warm-up;
- 建 baseline,确认负载生成器不是瓶颈;
- 用 trace/metrics/JFR/profiler/GC log/thread dump/heap dump/DB plan 定位;
- 写可证伪 hypothesis;
- 一次改变一个主要因素;
- 重跑并比较置信范围、资源与回归;
- 把 capacity 与 SLO 写入运行手册。
加缓存、加线程或改 GC 都不是通用答案。先找瓶颈属于 CPU、allocation/GC、lock、I/O、database、downstream、queue 还是网络。