Skip to content
How a Test Works

How a Test Works

A run has these steps:

  1. Find the servers
  2. Measure latency
  3. Measure the download and upload rates
  4. Measure packet loss, in the background while the other tests run

With several servers, the tests run on each server in turn.

Finding the servers

  1. speedtest-go asks speedtest.net for your IP address, ISP, location, and country.
  2. It fetches the servers speedtest.net lists near you, or near the place --city or --location names.
  3. It chooses the servers to test:
SettingsServers tested
NoneThe server with the lowest latency
--serverThe servers with those IDs
--custom-urlThe server at that URL, which speedtest.net does not need to list
--filter-ccThe server with the lowest latency in those countries

Choosing servers covers each setting.

Latency and jitter

speedtest-go measures 10 round trips to the server:

ResultMeaning
LatencyThe mean round trip
JitterHow much the round trips vary
Min, MaxThe shortest and longest round trips

--ping-mode chooses how each round trip is made: an HTTP request, the speedtest.net TCP protocol, or ICMP. Test protocols compares them.

Download and upload

Each transfer test moves data over several connections at once: by default one per CPU for downloads, and up to 8 for uploads.

AspectBehavior
DurationUp to 15 seconds, ending early once the rate settles
RateThe bytes moved over the time they took
Loaded latencyPings every half second during the transfer, which show how latency changes under load
ProtocolHTTP by default, or plain TCP with --protocol tcp

In a terminal, the progress bar’s estimate of the time left tracks how soon the rate is expected to settle.

--thread, --dl-size, and --ul-size tune the transfers, and --no-download and --no-upload skip them. Test protocols covers them.

Packet loss

Packet loss is measured over UDP, in the background while the other tests run, for up to 30 seconds. speedtest-go numbers each packet it sends, and the server reports what it received, so the result is the loss on the way up to the server.

ResultMeaning
SentThe packets the server received
DupThe duplicates among them
MaxThe highest packet number the server received. Packets are numbered from 0, so Max + 1 packets had been sent by then

The loss is the share of those Max + 1 packets that never arrived: 1 - (Sent - Dup) / (Max + 1). Packet loss shows N/A when the server received none of them, such as through a proxy or a firewall that blocks UDP.