How do I identify the slow part of an API?
Practice this questionWANT TO UNDERSTAND THE CONCEPT FIRST?Learn How do I identify the slow part of an API?
Definition:
API latency is the total time a request spends waiting and doing work across the system. That time can include load-balancer delay, connection-pool wait, application CPU, database work and external calls. Breaking it into stages turns “the API is slow” into a testable explanation.
Key points:
-
Measure request time, database time, external calls and queue/pool waits separately.
-
Check p95/p99 latency too; averages can hide slow requests.
-
Compare the same traffic and workload before and after a fix.
-
Distinguish throughput from latency: many completed requests per second can coexist with a badly delayed minority of requests.
Interview point:
- Use percentiles and traces to find the affected users and slow stage rather than relying only on average response time.
Adapted from 08_PERFORMANCE_SECURITY.md · “How do I identify the slow part of an API?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.