Latency vs throughput?
Options
- They are the same thing, measured two ways
- Latency: time of one request; throughput: rate (Correct option)
- Latency is measured in megabytes per second
- Throughput is the rate of errors in a system
Answer
Latency = how long one request takes; throughput = how many requests are handled per unit of time
Why
Picture a highway. Latency is how long one car takes to travel from A to B. Throughput is how many cars pass per hour.
You can have high throughput with high latency (a big batch job) or low latency with low throughput.
For APIs, latency is usually reported as percentiles: p50 (typical), p99 (the slowest 1%).
Remember
Latency = time per request. Throughput = requests per second.