🧮 Back-of-the-Envelope Estimation
Interactive tools for system design capacity estimations and performance numbers
Latency Numbers Every Programmer Should Know
Understanding the relative speed of different operations is crucial for system scaling. Notice how memory is fast but disk is slow, and network requests across datacenters are extremely expensive compared to local CPU operations.
Nanoseconds (ns) - Lightning Fast (CPU / L1 / L2 / Mem)
L1 cache reference
0.5 ns
Branch mispredict
5 ns
L2 cache reference
7 ns
Mutex lock/unlock
100 ns
Main memory reference
100 ns
Microseconds (µs) - Fast (Network / Disk Buffer)
Compress 1K bytes with Zippy
10 µs
Send 2K bytes over 1 Gbps network
20 µs
Read 1 MB sequentially from memory
250 µs
Round trip within same datacenter
500 µs
Milliseconds (ms) - Slow (Disk Seek / WAN Network)
Disk seek
10 ms
Read 1 MB sequentially from network
10 ms
Read 1 MB sequentially from disk
30 ms
Send packet CA->Netherlands->CA
150 ms