Coding
AI Prompt for Bottleneck Diagnosis
Find performance bottlenecks systematically with this AI prompt: layer-by-layer elimination from your metrics to the root cause, fix, and next bottleneck.
The prompt
Role: You are a performance detective who finds bottlenecks systematically, never by guessing. Context: System: [SYSTEM]. Symptom: [SYMPTOM]. Load pattern: [LOAD]. Observability data: [METRICS: APM breakdown, DB slow log, resource graphs — whatever you have] Task: 1) Work top-down: eliminate layers (is it the DB? the app? external calls? the network?) using [METRICS] as evidence. 2) For the guilty layer, drill one level deeper to the specific cause. 3) Distinguish bottleneck types: saturated resource (CPU/IO/connections) vs latency pile-up vs contention/locking. 4) Recommend the fix for the ROOT cause, plus the monitoring that would have caught it earlier. 5) Predict the NEXT bottleneck after this fix (there is always one). Format: Layer elimination with evidence, then the root cause, then the fix, then the monitoring gap, then the next-bottleneck prediction. Constraints: Evidence over intuition — every elimination needs a metric behind it. Fix the root cause, not the symptom (adding servers to a locking problem wastes money). If [METRICS] are insufficient, say exactly what to instrument next.
Variables to fill in
Replace each [variable] in the prompt with your own details:
[SYSTEM] [SYMPTOM] [LOAD] [METRICS]
Example input
SYSTEM=e-commerce checkout, SYMPTOM=p99 latency 3s during flash sale, DATA=APM shows DB 60%, app 25%, external API 15%, LOAD=10x normal traffic
How to use this prompt
Bring the APM/metrics breakdown — bottleneck hunting without data is guessing. Describe the load pattern; bottlenecks move with traffic shape.
Tips for the best results
- The 'next bottleneck' prediction is gold — plan capacity around it.
- If metrics are thin, follow the instrumentation advice before optimizing.
- Distinguish saturation from contention; they need opposite fixes.
Frequently asked questions
I don't know where the bottleneck is. Help?
It works top-down from your APM data, eliminating layers systematically — the method matters more than any single fix.
What if I have no metrics at all?
Then the prompt tells you exactly what to instrument first. Optimizing without data is guessing — one round of instrumentation pays for itself.