24

I´m having issues with slow internet. I have used speedtest.net at different times of the day and week and the result tells me that I get 10-20% of the bandwidth that I pay for. My ISP tells me that the promised bandwidth is an average, so a single test is not proof of a poor connection.

So now I want to conduct several tests (like every x minute) for several days while I´m away, thus giving me an average.

How do I best collect this data?

kodeaben
  • 353

4 Answers4

22

That is a known problem, I had to talk to my ISP multiple times over 3 weeks in order to convince them that something is off with the connection. My solution was to automate speedtests so that they run every 30 minutes using a docker container made by Henry Whitacker. Set is up on a raspberry pi, an old laptop or a NAS, and let it run for a week. After that you have a very good base of measurement data to show your ISP. It even is presented in a way any normal person can understand so you don’t need to find someone more competent than the last time.

To set it up, follow the instructions on the GitHub page, I recommend using docker-compose as it is much easier than anything else. If you want to have a look at it first, there is a running demo version on Henry Whitacker‘s personal website here.

DarkDiamond
  • 1,919
  • 11
  • 15
  • 21
8

I'm going to answer this as an X-Y problem instead of an answer to your question, given there is already a really good answer here that adresses your question.

Theory

When an ISP tells you a certain speed is what you should get according to your subscription, this is indeed a speed that you should be allowed to get on average.

But for consumers, internet works as follows: many users share bandwidth along many households, and that is called overbooking. The idea is that most households don't use up the entire bandwidth at the same time so the speeds can be delivered when necessary, but it also means, that it may happen that lots of people do try to up- or download at the same time causing congestion which can reduce the speeds a little bit.

Because of the last sentence in the previous paragraph, ISP's will tell you that the speeds you pay for are an average and that in most cases you should get that speed.

Unfortunately, when unexperienced employees get this explained, they don't understand the technology, and all they hear is: it's an average, so a lower speed can be expected sometimes.

You have experienced a significant drop to 10-20% of what your connection should be capable of, which is far more than what normally overbooking would cause, which suggests that there's an actual problem on your line.

One thing to note is the following though: If either the up or download is fully saturated, the other will suffer as well. So if you have a 1 MBit upload and 1000 MBit download, but you fully utilize your 1 MBit upload, then the download will slow down to a crawl too. The reason for this is because every sequence of up or download will send a packet back to confirm it was received by the other party, and if this packet cannot be sent back but is queued up, the other side will wait sending you the rest of the data, and thus the connection slows down significantly.

This also means that if for some reason your upload is way lower than you should get, more towards 0.1mbit, you can bet your download will fluctuate a lot and be slow too because the confirmation packets are sent very slow too.

Actions for making troubleshooting easier

The ISP will always want to rule out any local network issues, so it is recommended to use a LAN cable directly from the modem to a laptop or PC (if its a modem/router combi) or to the router behind it and perform the speedtest then. Make sure all other devices are unplugged. If this is slow, call your ISP, because this is the ideal state for you to be in, and it's not working either.

Also, another thing the ISP will want to rule out, is services hanging inside the modem, so always turn off the modem, wait 10 seconds and turn it on again, and see if that solves your issues. When you call them, you can tell them that you already performed these actions. It will tell them that you know what you're doing and they will take you more seriously.

You can ask the ISP to measure the line from their end, and tell them you perform a speedtest with only one device connected to the modem using a LAN cable and that this should give optimal results.

If the ISP says they cannot measure the line, ask to be transferred to a person with more experience, or if they refuse to their supervisor.

If the ISP measures the line, but they claim it is working correctly, they will likely have to send a mechanic over.

LPChip
  • 66,193
4

How do I best collect this data?

There is a similar to speedtest.net command line tool called speedtest-cli: https://github.com/sivel/speedtest-cli. It supports several output formats such as csv or json or default verbose human readable format. You can run speedtest-cli in a loop several times from terminal:

for i in `seq 1 2`; do speedtest-cli; done
Retrieving speedtest.net configuration...
Testing from ***...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by *** ms
Testing download speed................................................................................
Download: *** Mbit/s
Testing upload speed......................................................................................................
Upload: *** Mbit/s
Retrieving speedtest.net configuration...
Testing from ***...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by *** ms
Testing download speed................................................................................
Download: *** Mbit/s
Testing upload speed......................................................................................................
Upload: *** Mbit/s

When you done, you can send all this output to ISP as a proof of possibly bad connection.

ks1322
  • 459
3

If you have a linux machine available or wsl on windows (or windows itself, but it's more tedious to automate a script) I would go with iperf3.

Here are some servers to use probably test some out of these or find your own.

(in this example the script is saved under /home/speedtest/speedtest.sh)

#!/bin/bash

date | tee -a /home/speedtest/log.txt

testing upload

iperf3 -c speedtestserver.domain.tld | tee -a /home/speedtest/log.txt

testing download

iperf3 -c speedtestserver.domain.tld -R | tee -a /home/speedtest/log.txt

And make a cronjob */30 * * * * /bin/bash /home/speedtest/speedtest.sh

You can easily fine tune your execution plan with this site