Latency Numbers Every SRE Should Know
nanosecond = 1/1,000,000,000 second microsecond = 1/1,000,000 second millisecond = 1/1000 second
Sub-Nanosecond Range
- Accessing CPU registers
- CPU Clock Cycle
1-10 Nanosecond Range
- L1/L2 cache
- Branch Misprediction in CPU pipelining
10-100 Nanosecond Range
- L3 cache
- Apple M1 referencing main memory (RAM)
100-1000 Nanosecond Range
- System call on Linux
- MD5 hash a 64-bit number
1-10 Microsecond Range
- Context switching between Linux threads
10-100 Microsecond Range
- Process a HTTP request
- Reading 1 megabyte of sequential data from RAM
- Read an 8k page from an ssd
100-1000 Microsecond Range
- SSD write Latency
- Intra-zone networking round trip in most cloud providers
- Memcache/Redis get operation
1-10 Millisecond Range
- Inter-zone networking Latency
- Seek time of a HDD
10-100 Millisecond Range
- Network round trip between US-west and US-east coast
- Read 1 megabyte sequentially from main memory
100-1000 Millisecond Range
- Some encryption/hashing algorithms
- TLS handshake
- Read 1 Gigabyte sequentially from an SSD
1 second+
- Transfer 1GB over a cloud network within the same region