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

Ability to double ping measurement. #34

Closed
ssamjh opened this issue Jun 3, 2017 · 8 comments
Closed

Ability to double ping measurement. #34

ssamjh opened this issue Jun 3, 2017 · 8 comments

Comments

@ssamjh
Copy link

ssamjh commented Jun 3, 2017

So in #33 it is mentioned that the ping amount is incorrect, and then the user says it's solved but not explaining how.

I am not very tech savvy, but is there anyway to double the ping amount shown on the page?

Speedtest site: https://speedtest.mineswine.com

@adolfintel
Copy link
Member

Try asking him how he solved it. My guess is that it was incorrect server config.

@adolfintel
Copy link
Member

...or you can just remove the /2 at line 325 in worker.js

@n-st
Copy link

n-st commented Jun 14, 2017

@adolfintel Why do you divide the time by 2 anyway?

@adolfintel
Copy link
Member

adolfintel commented Jun 14, 2017

Because of how HTTP works. When you make a XHR request, here's what typically happens:

  • TCP connection is created (1 RTT)
  • HTTP request is sent (0.5 RTT)
  • HTTP response is received (0.5 RTT)

In total, that's 2 RTT, hence the /2.
The problem is if you're using a persistent HTTP connection because only the first request takes 2 RTT, then the next ones take only 1 RTT. This typically doesn't happen for XHR though.

@n-st
Copy link

n-st commented Jun 14, 2017

A good idea in theory, but not when your server sends a Connection: keep-alive header:
2017-06-14_12-17-01

I'd suggest making keep-alive mandatory for the server setup and then just discarding the first ping result (the one that establishes the connection).

@adolfintel
Copy link
Member

Yes, that's probably a good idea.
I'll add that in the next version

@n-st
Copy link

n-st commented Jun 14, 2017

You might also want to mention the limitations of the ping test more clearly: I came here after a hosting provider got called out for false advertising on a forum because the ping results from his speedtest page were half of what you would get from normal ping commands.

Disclaimer: I'm not that provider, just a curious bystander. ;)

@adolfintel
Copy link
Member

I'm sure I had that in the old version of the documentation.
Anyways, expect an update in the next few hours.

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

No branches or pull requests

3 participants