Skip to content
This repository was archived by the owner on Jul 4, 2023. It is now read-only.

speedtest behind nginx upload numbers wrong? #29

Open
santowiryaman opened this issue Feb 4, 2021 · 4 comments
Open

speedtest behind nginx upload numbers wrong? #29

santowiryaman opened this issue Feb 4, 2021 · 4 comments
Assignees
Labels

Comments

@santowiryaman
Copy link

Hi e7d,
I am very new to speedtest. I was able to run it on my debian system from the docker container. It listens at port 8081. I also configured nginx port 8443 (hhtps) to proxy-pass to port 8081. Seems to work but when going through nginx (port 8443) the upload numbers are twice as high. When going direct to port 8081, the numbers are more reasonable. My client is on a 1Gbps NIC and the server on 10Gbps. As you can see in the attached picture, the upload speed was reported as high as 1.9Gbps, which is not possible (see history in attached picture). Have you run into this problem? Thank you.
Kind regards,
-santo

Slide3

@e7d e7d added the bug label Feb 19, 2021
@e7d
Copy link
Owner

e7d commented Feb 19, 2021

Hi @santowiryamann

I'm sadly aware the speedtest is not running as expected behind a proxy.
This is something I would be able to fix, but to be honest, which is not in top of my list.

I definitely reckon it as a bug, and will try to investigate at some point.

Regards.

@e7d e7d self-assigned this Feb 19, 2021
@e7d
Copy link
Owner

e7d commented Feb 19, 2021

I found an irregularity in the bandwidth test part.
I tagged a version 0.5.4-alpha.0 that you may try.
I'm not sure that it was the root coause, but let me know if it helps.

Also built and available through Docker: https://hub.docker.com/layers/e7db/speedtest/v0.5.4-alpha.0/images/sha256-35ccac2eca91e63f46e706d9630353dfa0e498f1abc6e3b8c9b52cf5ad73ab74?context=repo

@maltechx
Copy link

I am getting correct numbers without the patch, so for me there is no need to change anything. I think it is important to disable any buffer/caching in your nginx config.
This is my nginx config:

location / {
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-Host $http_host;
       proxy_set_header X-Forwarded-Server $http_host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       gzip off;
       proxy_redirect off;
       proxy_buffering off;
       client_max_body_size 256M;
       proxy_pass http://localhost:8181/;
    }

@rgriffogoes
Copy link

I'm using speedtest with docker, behind Traefik proxy (also docker, same docker host). As I was having similar issues, I decided to test out the 4 combinations

Master + Traefik = 2000+- Mbps
Tag + Traefik = 1200+- Mbps

Master + direct = 360 Mbps
Tag + direct = 223 Mbps

Running iperf3 between client machine and docker host I got 375Mbps.

So I guess that the master is giving out correct numbers if the proxy is not messing up the values.

I can't look deeper now but besides knowing the specific settings for the proxy (as mentioned by @maltechx), maybe the test can be updated to generate unbufferable/compressible random text? As not everyone will be able/allowed to change their reverse proxy settings

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants