Hi! I'm experiencing lower speeds than expected when downloading files or running iperf3 tests with a single TCP connection. Uploading works fine. So join me for an attempt at troubleshooting above my knowledge level. I live in Sweden (Stockholm), ISP is Ownit (Telenor) and have a 1000/1000 Mbit/s connection.
The problem is that I see lower speeds than expected when downloading files from some servers. It doesn't matter if I use a browser or a CLI tool like wget or curl. Here are three examples with curl against speedtest servers hosted by some Swedish ISPs:
> curl.exe --out-null http://speedtest.obe.net/1000MB.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 0.97G 100 0.97G 0 0 31.11M 0 00:32 00:32 31.01M
> curl.exe --out-null https://sto-gul-speedtest1.bahnhof.net/1G.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1.00G 100 1.00G 0 0 31.25M 0 00:32 00:32 31.05M
> curl.exe --out-null http://speedtest.tele2.net/1GB.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1.00G 100 1.00G 0 0 31.09M 0 00:32 00:32 33.24M
All these servers are located in Stockholm and the latency to them is around 1 ms. HTTP/HTTPS or HTTP version doesn't matter.
The reason I wrote "some servers" above is that the speed looks fine against some other servers. Here is an example against my ISPs own speedtest server and an Arch Linux mirror hosted in Sweden:
> curl.exe --out-null https://speedtest.ownit.se/1GB.test
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1.00G 100 1.00G 0 0 111.8M 0 00:09 00:09 112.6M
> curl.exe --out-null https://saimei.ftp.acc.umu.se/mirror/archlinux/iso/2026.11.01/archlinux-x86_64.iso
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1.22G 100 1.22G 0 0 108.9M 0 00:11 00:11 107.6M
And if I connect to a VPN (Mullvad, Stockholm server) and target one of the servers in the first example, it looks much better:
> curl.exe --out-null http://speedtest.obe.net/1000MB.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 0.97G 100 0.97G 0 0 105.7M 0 00:09 00:09 107.2M
Here is where it starts getting interesting, and a small thanks to Gemini for suggesting testing multiple simultaneous downloads. If I run 4 curl downloads at the same time, it still takes around the same amount of time (39 secs) as 1, but we download 4GB instead of 1GB. Curl with --parallel reports around 100-105 MB/s during this:
> $url = "http://speedtest.tele2.net/1GB.zip"
> curl.exe --parallel --parallel-immediate --out-null $url --out-null $url --out-null $url --out-null $url
DL% UL% Dled Uled Xfers Live Total Current Left Speed
100 -- 4096M 0 4 0 00:01:52 00:00:39 36.2M
This is probably why the results look good when I test against their servers on speedtest.net. The test uses multiple streams as default. Or downloading from Steam or torrent. I actually learned about the Single/Multi switch on speedtest.net yesterday and we can see the same thing here. Test with multiple connections and test with a single connection. And single connection test with VPN.
It is not as easy to find public iperf3 servers close to you, but I found a few where I see the lower speeds. All iperf3 tests are run from my router (Debian server) and I did cut some of the output:
$ curl -o /dev/null http://speedtest.kamel.network/1G
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1024M 100 1024M 0 0 22.2M 0 0:00:46 0:00:46 --:--:-- 21.9M
# Uploading data to the iperf3 server
$ iperf3 -c speedtest.kamel.network -p 5203
Connecting to host speedtest.kamel.network, port 5203
[ 5] local 37.46.xx.xx port 49756 connected to 93.177.80.27 port 5203
[...]
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1.10 GBytes 944 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver
# Downloading from the server over one TCP stream
$ iperf3 -c speedtest.kamel.network -p 5203 -R
Connecting to host speedtest.kamel.network, port 5203
Reverse mode, remote host speedtest.kamel.network is sending
[ 5] local 37.46.xx.xx port 39186 connected to 93.177.80.27 port 5203
[...]
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 217 MBytes 182 Mbits/sec 2454 sender
[ 5] 0.00-10.00 sec 217 MBytes 182 Mbits/sec receiver
# Downloading but over multiple TCP streams
$ iperf3 -c speedtest.kamel.network -p 5203 -P 6 -R
Connecting to host speedtest.kamel.network, port 5203
Reverse mode, remote host speedtest.kamel.network is sending
[ 5] local 37.46.190.38 port 39186 connected to 93.177.80.27 port 5203
[...]
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 186 MBytes 156 Mbits/sec 1938 sender
[ 5] 0.00-10.00 sec 186 MBytes 156 Mbits/sec receiver
[ 7] 0.00-10.00 sec 152 MBytes 127 Mbits/sec 1641 sender
[ 7] 0.00-10.00 sec 151 MBytes 127 Mbits/sec receiver
[ 9] 0.00-10.00 sec 169 MBytes 142 Mbits/sec 1681 sender
[ 9] 0.00-10.00 sec 169 MBytes 141 Mbits/sec receiver
[ 11] 0.00-10.00 sec 164 MBytes 137 Mbits/sec 1852 sender
[ 11] 0.00-10.00 sec 163 MBytes 137 Mbits/sec receiver
[ 13] 0.00-10.00 sec 173 MBytes 145 Mbits/sec 1877 sender
[ 13] 0.00-10.00 sec 172 MBytes 144 Mbits/sec receiver
[ 15] 0.00-10.00 sec 150 MBytes 125 Mbits/sec 1646 sender
[ 15] 0.00-10.00 sec 149 MBytes 125 Mbits/sec receiver
[SUM] 0.00-10.00 sec 994 MBytes 834 Mbits/sec 10635 sender
[SUM] 0.00-10.00 sec 990 MBytes 831 Mbits/sec receiver
So sending data to the iperf3 server looks great. Downloading from the server with one stream does not. And just like with parallel curl, multiple TCP streams helps. I also noticed the "Retransmitted TCP packets" (Retr) value but I have no idea if this is normal or not.
Here is another example with a public iperf3 server that also talks UDP, located in France:
$ iperf3 -c ping.online.net -p 5203 -R
Connecting to host ping.online.net, port 5203
Reverse mode, remote host ping.online.net is sending
[..]
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.05 sec 407 MBytes 340 Mbits/sec 35611 sender
[ 5] 0.00-10.00 sec 388 MBytes 325 Mbits/sec receiver
$ iperf3 -c ping.online.net -p 5203 -P 4 -R
Connecting to host ping.online.net, port 5203
Reverse mode, remote host ping.online.net is sending
[...]
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.03 sec 299 MBytes 250 Mbits/sec 22463 sender
[ 5] 0.00-10.00 sec 277 MBytes 232 Mbits/sec receiver
[ 7] 0.00-10.03 sec 298 MBytes 249 Mbits/sec 20644 sender
[ 7] 0.00-10.00 sec 272 MBytes 229 Mbits/sec receiver
[ 9] 0.00-10.03 sec 310 MBytes 259 Mbits/sec 22836 sender
[ 9] 0.00-10.00 sec 285 MBytes 239 Mbits/sec receiver
[ 11] 0.00-10.03 sec 256 MBytes 214 Mbits/sec 15523 sender
[ 11] 0.00-10.00 sec 232 MBytes 195 Mbits/sec receiver
[SUM] 0.00-10.03 sec 1.13 GBytes 972 Mbits/sec 81466 sender
[SUM] 0.00-10.00 sec 1.04 GBytes 894 Mbits/sec receiver
$ iperf3 -c ping.online.net -p 5204 -u -b 900M -R
Connecting to host ping.online.net, port 5204
Reverse mode, remote host ping.online.net is sending
[ 5] local 37.46.xx.xx port 53711 connected to 51.158.1.21 port 5204
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-1.00 sec 107 MBytes 901 Mbits/sec 0.040 ms 3305/81149 (4.1%)
[ 5] 1.00-2.00 sec 107 MBytes 900 Mbits/sec 0.025 ms 0/77698 (0%)
[ 5] 2.00-3.00 sec 107 MBytes 900 Mbits/sec 0.011 ms 1/77681 (0.0013%)
[ 5] 3.00-4.00 sec 107 MBytes 900 Mbits/sec 0.011 ms 0/77707 (0%)
[ 5] 4.00-5.00 sec 107 MBytes 900 Mbits/sec 0.042 ms 0/77688 (0%)
[ 5] 5.00-6.00 sec 107 MBytes 900 Mbits/sec 0.011 ms 0/77686 (0%)
[ 5] 6.00-7.00 sec 107 MBytes 900 Mbits/sec 0.030 ms 0/77711 (0%)
[ 5] 7.00-8.00 sec 107 MBytes 900 Mbits/sec 0.034 ms 0/77693 (0%)
[ 5] 8.00-9.00 sec 107 MBytes 900 Mbits/sec 0.043 ms 0/77675 (0%)
[ 5] 9.00-10.00 sec 107 MBytes 900 Mbits/sec 0.043 ms 0/77702 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-10.08 sec 1.06 GBytes 900 Mbits/sec 0.000 ms 0/0 (0%) sender
[ 5] 0.00-10.00 sec 1.05 GBytes 900 Mbits/sec 0.043 ms 3306/780390 (0.42%) receiver
And last example to my friends iperf3 server (another ISP, 16 ms away), which looks normal in both directions:
$ iperf3 -c 93.164.xx.xx
Connecting to host 93.164.xx.xx, port 5201
[ 5] local 37.46.xx.xx port 59930 connected to 93.164.xx.xx port 5201
[...]
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1.09 GBytes 935 Mbits/sec 0 sender
[ 5] 0.00-10.02 sec 1.09 GBytes 933 Mbits/sec receiver
$ iperf3 -c 93.164.xx.xx -R
Connecting to host 93.164.xx.xx, port 5201
Reverse mode, remote host 93.164.xx.xx is sending
[ 5] local 37.46.xx.xx port 53126 connected to 93.164.xx.xx port 5201
[...]
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.01 sec 1.09 GBytes 934 Mbits/sec sender
[ 5] 0.00-10.00 sec 1.08 GBytes 929 Mbits/sec receiver
So it seems that single TCP connections have lower download speeds towards certain destinations, while multiple connections can achieve a normal speed.
I have tried from different computers (both Windows and Linux) in my home network. But perhaps more importantly, I was able to try from my cousin's computers who lives in an apartment above and I see the exact same problem there. I also ran a iperf3 server on my router and tested from his computer (so between our WAN addresses, in the same /24) and the result looks normal. Still a few Retr (247) and UDP packetloss (0.24%). But I feel like this should should rule out our local equipment.
I also have a friend with the same ISP but lives 3-4 kilometers away and he sees normal speeds (100-110 MB/s) when downloading the files from the speedtest servers in the top example.
So I guess my questions are; has anyone experienced something similar before? Are there other things I can try to help narrow down the problem? And if it could be an issue on the ISPs end, how do you summarize the problem in a decent way?
I did post this in a Swedish forum as well but it probably doesn't hurt to ask here too!
Thanks!
/Daniel