Skip to content

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

OperationLatencyIf 1 ns were 1 second
One CPU cycleAt about 3 GHz.0.3 ns0.3 seconds
L1 cache reference1 ns1 seconds
L2 cache reference4 ns4 seconds
L3 cache reference20 ns20 seconds
Main memory reference100 ns2 minutes
Compress 1 KB with a fast codecSnappy or LZ4 class.2 µs33 minutes
Read 1 MB sequentially from memoryOne thread, about 20 GB/s.50 µs14 hours

Storage

OperationLatencyIf 1 ns were 1 second
Random 4 KB read from an NVMe SSD50 µs14 hours
Read 1 MB sequentially from an NVMe SSDAbout 3 GB/s.330 µs3.8 days
Hard disk seek5 ms1.9 months
Read 1 MB sequentially from a hard diskAbout 150 MB/s.7 ms2.7 months

Network

OperationLatencyIf 1 ns were 1 second
Send 1 KB over a 10 Gbps linkTransfer time only.800 ns13 minutes
Round trip within one availability zone200 µs2.3 days
Cache read (Redis-class) in the same zoneNetwork round trip plus the lookup.300 µs3.5 days
Indexed database read in the same zone1 ms12 days
Round trip between zones in one region1 ms12 days
Round trip Mumbai to Singapore60 ms1.9 years
Round trip US East to US West65 ms2.1 years
Round trip US East to London75 ms2.4 years
Round trip Mumbai to US East190 ms6 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.

Questions

Where do these latency numbers come from?
The idea comes from the latency tables Jeff Dean and Peter Norvig popularized. These figures are rounded orders of magnitude for current cloud servers and public-cloud networks, so treat them as a starting point and measure your own hardware and regions before relying on a number.
How do I use latency numbers in a system design interview?
Use them to check a design against its latency goal. A request that makes five sequential database reads in one zone spends about 5 ms on them; the same five calls across an ocean spend close to a second. The gaps between rows tell you what to cache, batch or move closer.
Why scale latency to a human clock?
Nanoseconds and milliseconds are both too small to feel. If a memory reference took 100 seconds, a cross-zone round trip would take about 12 days and a round trip from Mumbai to US East about 6 years. The gaps between rows are what the numbers are for.