How-Tos

How-To: Test Your Linux Link for Bufferbloat With Plain ping

Leave a comment

In honor of Dave Täht’s Postel award, here’s the quickest way I know to see if your connection suffers from bufferbloat: measure latency while idle, then again while the link is saturated. You only need ping and something big to download.

1. Get an idle baseline

ping -c 20 1.1.1.1 | tail -2

Note the average round-trip time, the second number in the rtt min/avg/max line.

2. Load the link and ping again

In one terminal, start a large download (a Linux ISO works great). In a second terminal, run the same ping while the download is going:

curl -o /dev/null https://mirror.example.org/some-big.iso   # terminal 1, use a real mirror
ping -c 30 1.1.1.1 | tail -2                                   # terminal 2

Repeat with an upload if you can, since upstream bloat is often worse. If loaded latency jumps by more than about 30 ms over idle, you’ve got bufferbloat. Hundreds of ms means it’s bad.

3. See what your Linux box queues with

tc qdisc show
sysctl net.core.default_qdisc

Modern distros default to fq_codel, which is good for the host itself, but the real bottleneck is usually your router or modem. If your router supports SQM (smart queue management) with CAKE or fq_codel, turn it on and set the shaper a bit below your measured speeds, then rerun step 2.

4. Want more detail?

The flent tool runs proper “realtime response under load” tests and graphs them, and the Bufferbloat project has more ways to test.

Review before you install: read the release notes yourself, back up your config, and try new versions somewhere you can afford to break first.

God Bless, and Happy hacking!

References & Further Reading

Subscribe (RSS) Follow How-Tos via RSS

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.