Performance Debugging: Step by Step¶
The application is slow. Where to start? A systematic step-by-step guide.
1. Define the Problem¶
- Which endpoint is slow?
- Current vs target latency?
- Consistent or intermittent?
2. Measure¶
curl -o /dev/null -s -w “%{time_total}\n” URL
3. Identify the Bottleneck¶
- Network — DNS, TLS, TTFB
- Backend — CPU, memory, I/O
- Database — slow queries
- Frontend — render blocking
- External services
4. Backend Profiling¶
node –inspect app.js python -m cProfile app.py go tool pprof …
5. Database¶
EXPLAIN (ANALYZE, BUFFERS) SELECT …;
6. Optimize and Verify¶
One change at a time. Measure before and after.
7. Monitoring¶
- P95/P99 latency
- Query time
- Error rate
- Resource utilization
Summary¶
Measure -> Identify bottleneck -> Optimize -> Verify -> Monitor.