nesk / network.js

Make accurate network measures (like Speedtest) in your browser
MIT License
297 stars 89 forks source link

Questions #37

Closed afritsch closed 9 years ago

afritsch commented 9 years ago

Since you state on your demopage that your server has a low bandwidth (and my home connection is faster than that [VDSL 50/10] ), I deployed the example page on my VPS which has 100M symmetrical.

Some questions arose:

Very nice test, basically what I wanted for a self-hosted speedtest. Keep up the good work!

nesk commented 9 years ago

Implementing dynamically sized data is pretty hard with current browser technologies, there is no API to stream data. The new fetch API is interesting because it adds data streaming for download, however there is no streaming implementation for upload. Also, fetch isn't really supported for the moment.

Another solution would be Websockets, but I never really used this technology before so I'm not sure of what's possible or not.

Concerning your latency issue, PHP can't easily override HTTP headers defined by Nginx. Check the server.php file to see what headers your Nginx server should apply to the responses. If you have any trouble to understand the procedure, tell me, I will go deeper into explanations.

afritsch commented 9 years ago

Looks to me as if the most recent browsers support fetch ;-) (Chrome 42+, Firefox 39+, Opera 30+, maybe also Vivaldi)

What about a simple time based approach? E.g. double the file size each iteration. Start with 1MB and if the download/upload takes less than 5 seconds (this value has to be determined by some experimentaion) double the file size. Try again. This I think the approach http://speedof.me/ uses.

Taking a look at the server.php did not help, more directions would be appreciated. Excerpt from my nginx cofig: https://ouwsome.eu/stikked/view/aa2b43a5

nesk commented 9 years ago

What about a simple time based approach? E.g. double the file size each iteration. Start with 1MB and if the download/upload takes less than 5 seconds (this value has to be determined by some experimentaion) double the file size.

This is already what is done, the documented settings explain how it works.

Taking a look at the server.php did not help, more directions would be appreciated.

Here's what your server configuration must respect:

This should be enough.

nesk commented 9 years ago

Well, I've just checked out my code and found the bandwidth delays were broken. That's probably why you talked about this, thinking it wasn't implemented:

What about a simple time based approach? E.g. double the file size each iteration. Start with 1MB and if the download/upload takes less than 5 seconds (this value has to be determined by some experimentaion) double the file size.

As of v2.0.2, this is fixed.