Latency Numbers Every Engineer Should Know
How long the operations a system is built from take, from a CPU cycle to a round trip across an ocean, with each one scaled to a human clock so the gaps are easy to feel.
CPU and memory
| Operation | Latency | If 1 ns were 1 second |
|---|---|---|
| One CPU cycleAt about 3 GHz. | 0.3 ns | 0.3 seconds |
| L1 cache reference | 1 ns | 1 seconds |
| L2 cache reference | 4 ns | 4 seconds |
| L3 cache reference | 20 ns | 20 seconds |
| Main memory reference | 100 ns | 2 minutes |
| Compress 1 KB with a fast codecSnappy or LZ4 class. | 2 µs | 33 minutes |
| Read 1 MB sequentially from memoryOne thread, about 20 GB/s. | 50 µs | 14 hours |
Storage
| Operation | Latency | If 1 ns were 1 second |
|---|---|---|
| Random 4 KB read from an NVMe SSD | 50 µs | 14 hours |
| Read 1 MB sequentially from an NVMe SSDAbout 3 GB/s. | 330 µs | 3.8 days |
| Hard disk seek | 5 ms | 1.9 months |
| Read 1 MB sequentially from a hard diskAbout 150 MB/s. | 7 ms | 2.7 months |
Network
| Operation | Latency | If 1 ns were 1 second |
|---|---|---|
| Send 1 KB over a 10 Gbps linkTransfer time only. | 800 ns | 13 minutes |
| Round trip within one availability zone | 200 µs | 2.3 days |
| Cache read (Redis-class) in the same zoneNetwork round trip plus the lookup. | 300 µs | 3.5 days |
| Indexed database read in the same zone | 1 ms | 12 days |
| Round trip between zones in one region | 1 ms | 12 days |
| Round trip Mumbai to Singapore | 60 ms | 1.9 years |
| Round trip US East to US West | 65 ms | 2.1 years |
| Round trip US East to London | 75 ms | 2.4 years |
| Round trip Mumbai to US East | 190 ms | 6 years |
Numbers for turning days into rates
- Seconds in a day
- 86,400 (about 10⁵)
- Seconds in a month
- about 2.6 million
- 1 million requests a day
- about 12 per second
- 1 billion requests a day
- about 11,600 per second
- 2¹⁰ bytes
- about a thousand (1 KB)
- 2²⁰ bytes
- about a million (1 MB)
- 2³⁰ bytes
- about a billion (1 GB)
- 2⁴⁰ bytes
- about a trillion (1 TB)
How it works
Each figure is an order of magnitude for a current cloud server, rounded so it is easy to remember. Transfer rows are computed from the bandwidth in their note; network round trips are typical figures between public-cloud regions and depend on the route.
The useful part is the ratios. A memory reference is thousands of times faster than a call to a cache in the same zone, and a round trip between regions is about a hundred times slower again than one between zones. A design that hides a slow step behind a cache, a batch or a closer replica is usually trading across one of these gaps.