MiguelNdeCarvalho / speedtest-exporter

Speedtest Exporter made in python using the official speedtest bin
https://docs.miguelndecarvalho.pt/projects/speedtest-exporter/
GNU General Public License v3.0
190 stars 52 forks source link

Change needed #198

Closed DWomack closed 7 months ago

DWomack commented 1 year ago

The code needs to be a little more robust.

Speedtest-cli doesn't always connect.

I am using this under Jeff Geerling's internet-pi project. My isp is Verizon 5G Home Internet. The WAN address changes every 15 minutes to an hour.

Jeff's GitHub references a project called internet-monitoring, it also uses speedtest-exporter. It has the same problem.

Another project written in php uses speedtest-cli. It exhibits the same problem.

I think all the calls to speedtest-cli need to be retried if the call fails. 3 to 5 retries should be sufficient.

I am not a python or php programmer or I would fix it.

Thank you for look into this.

Dennis

DWomack commented 1 year ago

The code needs to be a little more robust.

Speedtest-cli doesn't always connect.

I am using this under Jeff Geerling's internet-pi project. My isp is Verizon 5G Home Internet. The WAN address changes every 15 minutes to an hour.

Jeff's GitHub references a project called internet-monitoring, it also uses speedtest-exporter. It has the same problem.

Another project written in php uses speedtest-cli. It exhibits the same problem.

I think all the calls to speedtest-cli need to be retried if the call fails. 3 to 5 retries should be sufficient.

I am not a python or php programmer or I would fix it.

Thank you for look into this.

Dennis

alexjustesen/speedtest-tracker uses php. Same issue.

DWomack commented 1 year ago

I think the WAN ip address might be changing in the process and that is causing the problem. It bounces around a lot on the cube.

DWomack commented 1 year ago

Question: Is the Speedtest-cli code downloaded from Ookla each time just before each execution? Or when the docker is started?

Just looking of similarities with another app showing the same symptoms.

Thanks.

DWomack commented 1 year ago

I have VZ 5G Home Internet via ASK Cube firmware fully patched.

The issues ie: failures are due to the way the exporter handles errors that are returned by speedtest cli.

Speedtest cli occasionally throws errors when on VZ.

I installed the latest speedtest cli from Ookla on a box with Ubuntu 22.04 fully patched for testing. Running it from the command line I see it error occasionally.

I suspect the exporter is not catching the error and retrying the test when speedtest cli is called.

Thank you for your efforts.

DWomack commented 1 year ago

dennis@xxxx:~$ speedtest --progress=no

Speedtest by Ookla

  Server: Verizon - Nashville, TN (id: 30809)
     ISP: Verizon Wireless

Idle Latency: 33.71 ms (jitter: 6.96ms, low: 28.28ms, high: 42.88ms) Download: 207.42 Mbps (data used: 374.1 MB)
113.92 ms (jitter: 37.85ms, low: 36.66ms, high: 615.84ms) Upload: 20.35 Mbps (data used: 26.3 MB)
83.73 ms (jitter: 18.81ms, low: 45.79ms, high: 287.21ms) Packet Loss: 0.0% Result URL: https://www.speedtest.net/result/c/dc596e4c-1e78-4c2f-9c9d-f9aea781045d dennis@xxxx:~$ speedtest --progress=no

Speedtest by Ookla

  Server: Verizon - Nashville, TN (id: 30809)
     ISP: Verizon Wireless

Idle Latency: 34.34 ms (jitter: 5.71ms, low: 29.98ms, high: 39.97ms) Latency: FAILED
[error] Cannot read:

DWomack commented 1 year ago

I have confirmed the issue is with Verizon's Nashville Speedtest server. That is the server that is auto selected. If I specify a different server the issue goes away.

Verizon may have under provisioned the server. A lot of C-Band is coming online in Nashville. Everybody and their brother may be testing their speeds against that server.