Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low speed values with selected server in config.yml #35

Closed
alexdelprete opened this issue Sep 28, 2022 · 43 comments
Closed

Low speed values with selected server in config.yml #35

alexdelprete opened this issue Sep 28, 2022 · 43 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@alexdelprete
Copy link
Contributor

I noticed really low speed values reported in the admin panel, I just did a manual test with the server 4302 I configured in config.yml:

speedtest:
  enabled: true
  schedule: '*/40 * * * *' # every hour
  ookla_server_id: 4302 # specify a server ID to use a sepecific server
tz: 'Europe/Rome'
   Speedtest by Ookla

      Server: Vodafone IT - Milan (id: 4302)
         ISP: Tecno General S.r.l
Idle Latency:     8.64 ms   (jitter: 0.31ms, low: 8.36ms, high: 9.29ms)
    Download:   813.10 Mbps (data used: 874.1 MB)
                 42.38 ms   (jitter: 38.70ms, low: 9.66ms, high: 941.40ms)
      Upload:   261.07 Mbps (data used: 150.7 MB)
                  9.76 ms   (jitter: 0.77ms, low: 8.44ms, high: 12.24ms)
 Packet Loss:     0.0%
  Result URL: https://www.speedtest.net/result/c/158c6f1d-3278-4606-b24a-fbd142c6deec

Is alpha.6 still using config.yml? If that's the case, I'm worried about the performance within docker, but the old speedtest-tracker worked fine in that regard. How do I check detailed info of a single test (server used, etc.)?

@alexjustesen
Copy link
Owner

This might be related to docker networking, can you try running the container on the host network? Looks like an issue was opened on the original repo too henrywhitaker3/Speedtest-Tracker#919 (comment)

@alexjustesen alexjustesen added the 🐛 bug Something isn't working label Sep 29, 2022
@alexjustesen alexjustesen self-assigned this Sep 29, 2022
@Kostecki
Copy link

Kostecki commented Sep 29, 2022

I'm experiencing this as well. Messing with docker networking doesn't seem to improve anything. Speeds are consistently 8-10 times lower than expected.

I have a container with the original repo running alongside - here i don't have any problems maxing my connection.

@alexdelprete
Copy link
Contributor Author

alexdelprete commented Sep 30, 2022

This might be related to docker networking, can you try running the container on the host network? Looks like an issue was opened on the original repo too

Tried with host network, made no difference. My suspicion is that it's not using the server I configured, or something related to the version of speedtest-cli, I remember I had this problem on the original project version, shelled in the container and updated speedtest-cli manually, it used a very old version of it, and after the upgrade, speeds were fine.

@alexdelprete
Copy link
Contributor Author

I have a container with the original repo running alongside - here i don't have any problems maxing my connection.

Yup, same for me. But I remember I had this issue with the old project too, and fixed it upgrading speedtest-cli. Since then, everything was ok.

@alexjustesen
Copy link
Owner

I've got family in town for a couple of days but I'll look into this ASAP. It's happening for me as well

@alexdelprete
Copy link
Contributor Author

It's happening for me as well

Glad you have the same issue, so you can trace it. No worries about timing, no emergency.

@Kostecki
Copy link

I get the expected results when i run the speedtest directly inside the container. Same server for both tests and the test themselves are run pretty much back to back.

The current version of the speedtest binary (1.2.0.84) also seems to be the latest version available from Ookla, so probably no issues there.

@alexdelprete
Copy link
Contributor Author

I get the expected results when i run the speedtest directly inside the container. Same server for both tests and the test themselves are run pretty much back to back.

My suspect is that the scheduled tests are not run against the configured server. From the UI there's no column indicating which server ID has been used for each test.

The current version of the speedtest binary (1.2.0.84) also seems to be the latest version available from Ookla, so probably no issues there.

Yes 1.2.0.84 is the latest. Thanks for reporting this, at least we can exclude that problem.

@Kostecki
Copy link

My suspect is that the scheduled tests are not run against the configured server. From the UI there's no column indicating which server ID has been used for each test.

There is in the database though (i use MariaDB) and the server_id/server_name columns do match with the value i provided in the config.yml - at least for me.

@alexdelprete
Copy link
Contributor Author

Thanks. So that's weird...I hope Alex finds the issue.

@alexjustesen
Copy link
Owner

Next release will contain the server info in the results table #38.

Still working on the speed issue

@alexjustesen
Copy link
Owner

I've also confirmed speed tests are running slow from within the container, not a clue why just yet but documenting results below...

Internet plan 1gbps/1gbps

CLI from WSL

   Speedtest by Ookla

      Server: Frontier - Wallingford, CT (id: 14235)
         ISP: Frontier Communications
Idle Latency:     5.66 ms   (jitter: 0.54ms, low: 5.03ms, high: 6.41ms)
    Download:   937.26 Mbps (data used: 1.3 GB)
                 11.83 ms   (jitter: 1.23ms, low: 4.36ms, high: 19.07ms)
      Upload:   922.49 Mbps (data used: 497.1 MB)
                  6.97 ms   (jitter: 1.05ms, low: 4.67ms, high: 10.50ms)
 Packet Loss:     0.0%

CLI from within the container

Speedtest by Ookla

      Server: Frontier - Wallingford, CT (id: 14235)
         ISP: Frontier Communications
Idle Latency:     5.77 ms   (jitter: 0.21ms, low: 5.67ms, high: 5.99ms)
    Download:   238.27 Mbps (data used: 212.5 MB)                                                   
                  6.25 ms   (jitter: 1.49ms, low: 4.34ms, high: 15.75ms)
      Upload:   237.21 Mbps (data used: 390.4 MB)                                                   
                  6.26 ms   (jitter: 1.94ms, low: 4.25ms, high: 33.07ms)
 Packet Loss:     0.0%

@michealespinola
Copy link

Although we are all referring to docker, it may be valuable to know which OS people are having issues with. I believe there are inherent performance issues with docker on Windows that this may involve. It could be useful to distinguish and/or isolate the issue with.

@bverkron
Copy link

I have really inconsistent results in the container, but the host is very consistent.

Container results (easier to show a history of results from the web UI than the CLI output, but they're basically the same)
image

Host results (get very close to this every single time)

Idle Latency:     2.47 ms   (jitter: 0.41ms, low: 1.80ms, high: 2.93ms)
    Download:   919.62 Mbps (data used: 1.4 GB)                                                   
                  8.75 ms   (jitter: 5.43ms, low: 3.45ms, high: 464.80ms)
      Upload:   759.28 Mbps (data used: 1.4 GB)                                                   
                  4.96 ms   (jitter: 1.95ms, low: 1.30ms, high: 18.65ms)
 Packet Loss:     0.0%

I'm running with the following configuration (switched to host networking during troubleshooting in this issue )

version: '3.6'
services:   
  speedtest:
      container_name: speedtest
      image: henrywhitaker3/speedtest-tracker
      # required to get full speed
      network_mode: host
      # not required when running in host mode as the ports are defined by the built in nginx instance in nginx/site-confs/default
      # ports:
      #  - 8765:80
      volumes:
          - /home/master/speedtest/mount_config:/config
      environment:
           - TZ=America/Vancouver
           - OOKLA_EULA_GDPR=true
      logging:
          driver: "json-file"
          options:
              max-file: "10"
              max-size: "200k"
      restart: unless-stopped   

nginx/site-confs/default

server {
        listen 8888 default_server;
... rest of file is defaults...
}

FYI one of the first things I checked was whether it was using the correct Ookla server and it was. It's within the same city as me and the same one that gets used in the Ookla web UI and on the host where I get the consistent fast speeds.

@alexdelprete
Copy link
Contributor Author

alexdelprete commented Sep 30, 2022

Although we are all referring to docker, it may be valuable to know which OS people are having issues with. I believe there are inherent performance issues with docker on Windows that this may involve. It could be useful to distinguish and/or isolate the issue with.

Ubuntu 22.10 (Kinetic Kudu). In the past I used the old project container also on a docker for windows, no performance issues.

@alexdelprete
Copy link
Contributor Author

alexdelprete commented Sep 30, 2022

I have really inconsistent results in the container, but the host is very consistent.

from what I see in the docker-compose, you're using the old project container. We're discussing about the new one in this repo.

@alexjustesen
Copy link
Owner

I have really inconsistent results in the container, but the host is very consistent.

from what I see in the docker-compose, you're using the old project container. We're discussing about the new one in this repo.

Old repo is having the same issue it looks like so I directed @bverkron here so they can follow along with the new stuffs.

@alexjustesen
Copy link
Owner

Although we are all referring to docker, it may be valuable to know which OS people are having issues with. I believe there are inherent performance issues with docker on Windows that this may involve. It could be useful to distinguish and/or isolate the issue with.

Worth a shot... I am currently running this on Windows 11 version 22H2, -> WSL -> Docker. I'll try running the container on my lab machine Ubuntu 22.04 and see if it has the same issues.

@bverkron
Copy link

bverkron commented Sep 30, 2022

I have really inconsistent results in the container, but the host is very consistent.

from what I see in the docker-compose, you're using the old project container. We're discussing about the new one in this repo.

Old repo is having the same issue it looks like so I directed @bverkron here so they can follow along with the new stuffs.

Ah, you're correct! I started this setup / journey with the original repo (as that's referenced in most places online) and didn't think to convert to migrate one this one when I found out about it. 😅.

I did a fresh setup with the following but get 500 | SERVER ERROR in the UI :(

services:   
  speedtest:
      container_name: speedtest-tracker
      image: ghcr.io/alexjustesen/speedtest-tracker:latest
      ports:
        - 8888:80
      volumes:
          - /home/master/speedtest/mount_app:/app
      environment:
           - HP_POOL_NAME=speedtest-tracker_php
           - DB_CONNECTION=sqlite
           - DB_DATABASE=/app/database.sqlite
      restart: unless-stopped 

I'll do some troubleshooting and open a separate issues if necessary.

@bverkron
Copy link

Although we are all referring to docker, it may be valuable to know which OS people are having issues with. I believe there are inherent performance issues with docker on Windows that this may involve. It could be useful to distinguish and/or isolate the issue with.

OS:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic

Docker:

Client: Docker Engine - Community
 Version:           20.10.18
 API version:       1.40
 Go version:        go1.18.6
 Git commit:        b40c2f6
 Built:             Thu Sep  8 23:11:34 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.1
...

@alexdelprete
Copy link
Contributor Author

I did a fresh setup with the following but get 500 | SERVER ERROR in the UI

There's already an issue open for that: #33

Since that blocking issue is only relevant to sqlite, if you want to test it, switch to mysql instead.

    environment:
      TZ: Europe/Rome
      PHP_POOL_NAME: speedtest-tracker_php
      DB_CONNECTION: mysql
      DB_HOST: mariadb.axel.dom
      DB_PORT: 3306
      DB_DATABASE: speedtest_tracker
      DB_USERNAME: *******
      DB_PASSWORD: *******

@alexdelprete
Copy link
Contributor Author

alexdelprete commented Sep 30, 2022

Old repo is having the same issue it looks like so I directed @bverkron here so they can follow along with the new stuffs.

I know, but I guess he wanted to test this new project. :)

I'll try running the container on my lab machine Ubuntu 22.04 and see if it has the same issues.

I'm running it on Ubuntu:

❯ inxi -b
System:
  Host: docker Kernel: 5.19.0-15-generic arch: x86_64 bits: 64 Console: pty pts/0 Distro: Ubuntu 22.10 (Kinetic Kudu)

@alexjustesen alexjustesen pinned this issue Oct 16, 2022
@alexjustesen
Copy link
Owner

So I've spent on and off a couple weeks now trying to figure out why it seems like networking is slow. If anyone has any ideas that would be great, especially for a #hacktoberfest PR

@alexjustesen alexjustesen added the 😕 help wanted Extra attention is needed label Oct 16, 2022
@michealespinola
Copy link

michealespinola commented Oct 16, 2022

@alexjustesen did you confirm you are having this issue with Windows and Ubuntu? Are we tracking any demographics about this? Such as ISP, bandwidth limits, etc?

I don't see any issues on my end (running on a Synology NAS) My bandwidth cap (w/Cox) is 500 600 Mbps, and speedtest-tracker measures it accurately.

Maybe this issue only affecting people test higher-end bandwidths? Certain ISPs? Por que no los dos, etc.

@alexdelprete
Copy link
Contributor Author

So I've spent on and off a couple weeks now trying to figure out why it seems like networking is slow

The only time I saw this with the old project, I upgraded speedtest-cli inside the container manually and since then I never experienced it anymore. Since your project already uses latest version, I don't know what else could cause it. Maybe something related to php performance in the container with highspeed connections?

@alexdelprete
Copy link
Contributor Author

alexdelprete commented Oct 19, 2022

Because math is hard, I'm going to probably write it bits on create...

Are you using the -u flag when calling speedtest?

  -u, --unit[=ARG]                  Output unit for displaying speeds (Note: this is only applicable
                                    for ‘human-readable’ output format and the default unit is Mbps)
  -a                                Shortcut for [-u auto-decimal-bits]
  -A                                Shortcut for [-u auto-decimal-bytes]
  -b                                Shortcut for [-u auto-binary-bits]
  -B                                Shortcut for [-u auto-binary-bytes]

 Valid units for [-u] flag:
   Decimal prefix, bits per second:  bps, kbps, Mbps, Gbps
   Decimal prefix, bytes per second: B/s, kB/s, MB/s, GB/s
   Binary prefix, bits per second:   kibps, Mibps, Gibps
   Binary prefix, bytes per second:  kiB/s, MiB/s, GiB/s
   Auto-scaled prefix: auto-binary-bits, auto-binary-bytes, auto-decimal-bits, auto-decimal-bytes

@alexjustesen
Copy link
Owner

Are you using the -u flag when calling speedtest?

My understanding was this is only for user output and didn't effect what was returned as json

@alexdelprete
Copy link
Contributor Author

alexdelprete commented Oct 19, 2022

You're right, machine-readable formats use bytes:

Machine readable formats (csv, tsv, json, jsonl, json-pretty) use bytes as the unit of measure with max precision

Question, how is it possible that @michealespinola reports correct values?

@alexdelprete
Copy link
Contributor Author

My connection is currently 600/30

Michael, are you sure you're using Alex's speedtest-tracker image? Because my UI is different vs the one of your screenshot:

image

@alexjustesen
Copy link
Owner

Question, how is it possible that @michealespinola reports correct values?

They're using the one that seems to be abandoned right now

@alexdelprete
Copy link
Contributor Author

They're using the one that seems to be abandoned right now

That's what I thought. You should've changed the project name...it will create confusion for a while. :)

@alexjustesen alexjustesen removed the 😕 help wanted Extra attention is needed label Oct 24, 2022
@alexjustesen
Copy link
Owner

Issue resolved, just a note Docker on wsl run slow so make sure you're not evaluating tests from there.

@alexjustesen alexjustesen unpinned this issue Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants