billimek/prometheus-speedtest-exporter

Speedtest Showing Wrong Speeds

branttaylor opened this issue · 4 comments

I'm not really sure how this is the case, but within the pod I am seeing download speeds that are roughly double what I'm actually getting. For example, inside the pod I'm getting this:

bash-5.0# speedtest

   Speedtest by Ookla

     Server: Comcast - Nashville, TN (id = 1764)
        ISP: Comcast Business
    Latency:    13.17 ms   (2.89 ms jitter)
   Download:   934.82 Mbps (data used: 1.4 GB)
     Upload:    33.24 Mbps (data used: 42.2 MB)
Packet Loss: Not available.
 Result URL: https://www.speedtest.net/result/c/f0b5583c-87ce-4b35-96ff-0c3d01874584

But outside of the pod, I run speedtest-cli on the node itself and I get this:

administrator@server:~$ speedtest
Retrieving speedtest.net configuration...
Testing from Comcast Business (redacted)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Comcast (Nashville, TN) [26.01 km]: 16.491 ms
Testing download speed................................................................................
Download: 426.06 Mbit/s
Testing upload speed......................................................................................................
Upload: 41.40 Mbit/s

I'm located in Middle Tennessee, as you can tell. Any thoughts on why this is the case? I've even tried running speedtest inside the pod using different speedtest servers and they're all way higher than I'm actually getting.

Have you tried running multiple tests to see if the results are consistently different?

Speedtest-cli and speedtest are 2 different utilities, for me speedtest-cli almost never reaches real speeds
As far as I know speedtest is the official one by Ookla

I'm seeing similar results using running the commands myself within the pod. speedtest vs speedtest --accept-license --accept-gdpr -f tsv (the one that the script runs) show different results, where only the speedtest one is correct. It's almost like the -f tsv messes with the numbers somehow

bash-5.1# speedtest

   Speedtest by Ookla

      Server: <redacted>
         ISP: <redacted>
Idle Latency:    20.73 ms   (jitter: 1.08ms, low: 20.09ms, high: 21.91ms)
    Download:   933.82 Mbps (data used: 1.1 GB)                                                   
                 32.16 ms   (jitter: 8.07ms, low: 21.22ms, high: 281.60ms)
      Upload:    36.72 Mbps (data used: 17.0 MB)                                                   
                 97.10 ms   (jitter: 24.00ms, low: 33.28ms, high: 163.35ms)
 Packet Loss:     0.0%
bash-5.1# speedtest --accept-license --accept-gdpr -f tsv
<redacted>	<redacted>	21.5695	3.04925	0	116287460	5046878	1092256677	35664240	https://www.speedtest.net/result/c/c5d35b3c-bb02-4930-b696-566dde77e2e3	1	31.1629	5.98725	18.154	90.816	94.3902	20.8857	28.776	154.854	20.393	27.144

@twodarek It's a little hidden with --help, but it looks like default output is human readable Mbps (Mbits/sec) and machine readable formats use bytes as the unit of measure.

Download 116287460 bytes/sec x 8 = 930,299,680 bits/sec (930.3 Mbps)
Upload 5046878 bytes/sec x 8 = 40,375,024 bits/sec (40.38 Mbps)

@branttaylor as mentioned by @basistam speedtest-cli is another project written in python. For the slower output, see performance notes here https://github.com/sivel/speedtest-cli#inconsistency If I run the official ookla tool, I see almost full line speed down (1Gbps) but if I run speedtest-cli from the other repo on my raspberry pi 4's, I'm always below 500mbps.