The Three Terms
| Term | Measures | Unit |
|---|---|---|
| Latency | Delay, usually as a round trip | ms |
| Bandwidth | Capacity of a link | Mbit/s, Gbit/s |
| Throughput | Data actually delivered | Mbit/s, MB/s |
A comparison that helps: bandwidth is the width of a road, latency is its length, and throughput is how many cars actually arrive per minute.
Distance Sets a Floor for Latency
Light in optical fiber travels at about 200,000 km per second, roughly two thirds of its speed in a vacuum. That adds about 1 ms of round-trip time for every 100 km of fiber, and cables rarely run in a straight line. Routers, queues, and the last link to the user add more. No upgrade removes this delay: a server on another continent is always tens of milliseconds further away.
Why a Fast Link Can Feel Slow
Loading a page takes several round trips before the first byte arrives: a DNS lookup, the TCP handshake, the TLS handshake, then the request itself. At 100 ms per round trip, that is a noticeable pause, whatever the bandwidth. A page that loads many files from several servers repeats part of this many times.
TCP adds a second effect. A sender may only have a limited amount of unacknowledged data in flight, its window, and must wait for acknowledgments before sending more. Throughput on one connection is at most the window divided by the round-trip time: with a 64 KB window and 100 ms of latency, that is about 5 Mbit/s, even on a 1 Gbit/s link. Modern Linux systems scale the window up automatically, but the effect remains: on long paths, one connection needs time to reach full speed, and any packet loss slows it down sharply.
Bits and Bytes
Network speeds are given in bits per second; file sizes and download tools often show bytes per second. Divide by 8: a 1 Gbit/s link carries at most 125 MB/s, and somewhat less after protocol overhead.
On Your Server: Measure Latency
ping -c 20 example.com
mtr -rwc 100 example.com
- ping: the summary line shows minimum, average, maximum, and
mdev, the standard deviation of the round-trip times. A low average with a high mdev means jitter, often from congestion. - mtr: shows every hop with loss and delay. Look at the last hop: loss there is real; loss at one middle hop that disappears later is usually a router that answers slowly.
Measure from where your users are, too: your server's view is only one direction. A looking glass gives you the view from a provider's network; see what is a looking glass.
On Your Server: Measure Throughput with iperf3
iperf3 measures throughput between two machines you control. Install it with sudo apt install iperf3 or sudo dnf install iperf3 on both. On the first, open TCP port 5201 in the firewall for the duration of the test and start the server:
iperf3 -s
On the second:
iperf3 -c 203.0.113.10
iperf3 -c 203.0.113.10 -R
iperf3 -c 203.0.113.10 -P 4 -t 30
By default the client sends to the server over TCP for 10 seconds. -R reverses the direction, -P 4 runs four parallel streams, and -t 30 runs for 30 seconds. If four streams reach much more than one, latency or loss limits single connections. Stop the server with Ctrl+C and close the port again afterward. Do not run iperf3 against servers you do not operate.
Other Limits on Throughput
- Packet loss: even a small amount cuts TCP throughput on long paths.
- Disk: a download cannot be faster than the disk can read; see how to check disk I/O.
- CPU: encryption and compression use processor time on both ends.
- The far end: the other machine and its link may be the slower part.
Choosing a Server Location
For anything interactive, such as a website, an API, or an SSH session, latency usually matters more than extra bandwidth. Place the server close to most of its users, test the round-trip time from their region before you decide, and put static files behind a CDN if your users are spread across continents.