Skip to content

Instantly share code, notes, and snippets.

@igrigorik
Last active December 10, 2015 02:48
Show Gist options
  • Save igrigorik/4370730 to your computer and use it in GitHub Desktop.
Save igrigorik/4370730 to your computer and use it in GitHub Desktop.
Home router latency (Linksys E1550) - quick test.

Quick, take a guess, what's the first hop latency to your home wireless router?

Below 1ms, right? Yeah, you wish!

Below are results from a quick test on my home router (Linksys E1550). Some lessons learned:

  • 3-8ms median
  • very different latency tails on different channels (1,6,11)
  • running in mixed mode helps tame the long tails (do it, if you can)
  • all tests on 2.4Ghz, unfortunately E1550 can't do 5Ghz
  • for whatever reason, lots of "phantom" devices seem to like channel 11

Started with channel 6, mixed mode. Now running on channel 1, with N-only.. 2x difference for 90 percentile, and 1ms shaved off the median. Of course, these settings will change as different devices come online...

P.S. Rough methodology: ping 192.168.1.1 (5 minutes worth) | grep | cut | massage | R > results.gist

@evnm
Copy link

evnm commented Dec 26, 2012

Here's an example methodology. It's pretty basic compared to Ilya's setup, but can hopefully get you started.

A one-liner that teases out and prints the latency measurements unbuffered to stdout:

ping 192.168.1.1 | grep --line-buffered time | awk '{ print $7; fflush(); }' | tr -u -d time=

If you've dumped this output in a file (say, /tmp/latency.txt), you can generate histograms in an R console:

$ r
...
> data <- readLines("/tmp/latency.txt")
> hist(as.numeric(data))

You can fiddle with the breaks parameter to hist() in order to vary the number of buckets in your histogram:

hist(as.numeric(data), breaks=25)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment