Latency vs Throughput: The Plumbing Analogy
I used to think that "Internet Speed" was just one number. If I had 100 Mbps, everything should be fast, right?
But sometimes, even with a great connection, websites take forever to start loading, or my video calls stutter.
It turns out "speed" is actually two different things: Latency and Throughput.
The Plumbing Analogy¶
Imagine you are trying to fill a bucket with water using a long garden hose.
Throughput: The Width of the Hose¶
Throughput is how wide the hose is. A fire hose has high throughput; a straw has low throughput. In networking, this is your bandwidth (like 100 Mbps). It's how much data can fit through the "pipe" at once.
Latency: The Length of the Hose¶
Latency is how long it takes for the first drop of water to travel from the faucet to the bucket. Even if you have a massive fire hose, if it's 5 miles long, it will take a while for the water to arrive!
Wait, but why does it matter?¶
- Downloading a movie: You want high Throughput. You have a huge amount of data, and you want to cram as much of it into the pipe as possible. Latency doesn't matter much—once the movie starts "flowing," it just keeps coming.
- Gaming or Video Calls: You want low Latency. You aren't sending much data, but you need it to arrive instantly. If your latency is high, you'll experience "lag," even if you have a gigabit connection!
Common gotchas¶
- I always forget that distance is a physical limit. Even at the speed of light, sending a signal across the ocean takes time. This is why servers in your own country feel "snappier."
- Watch out for "Bufferbloat": This is when your router gets overwhelmed and starts queuing up data, which actually increases your latency.
Try it yourself¶
You can measure both right now in your terminal:
To measure Latency (Ping):
Look for thetime=XXms. Under 20ms is great; over 100ms is where you start noticing lag. To measure Throughput: Use a site like fast.com or speedtest.net. This tells you how many Megabits you can pull down per second.
Further reading¶
- Megabit vs Megabyte – Don't confuse your throughput units!
- Bufferbloat.net – A deep dive into why your router might be making your latency worse.
— Nadeem 💧