Speed-Test icon indicating copy to clipboard operation
Speed-Test copied to clipboard

Feature Request: Ping measurements also during load

Open zR-JB opened this issue 1 year ago • 6 comments

Maybe never stop the ping measurement, and let it run continuously also during the upload and download phase. And then have a simple graph, or just the average during the different load scenarios. With this, one could investigate buffer bloat issues very easy!

Even ookla with speedtest.net had this feature for quite some time now: image

zR-JB avatar Jul 26 '24 09:07 zR-JB

I'll address this in a future version, but there are known limitations as outlined in https://github.com/openspeedtest/Speed-Test/issues/33. Otherwise, we'd need to overhaul the entire setup and potentially use something like webtransfer. I'll seriously consider this for the next major rewrite, which will support multiple protocols.

openspeedtest avatar Jul 26 '24 09:07 openspeedtest

When looking at what is transferred during the speedtest.net test, I noticed that the downloads and uploads are also XHR, and the ping measurements are done via a websocket, so I think you are right.

image

zR-JB avatar Jul 26 '24 10:07 zR-JB

So I did a bit more testing a made small POC with a simple node.js echo websocket server. And then performance.now() on the client side. Turns out Firefox does by default also only provide millisecond accuracy, even with performance.now(). Chromium based browsers, at least, have 100 μs. I think there is still a bit much overhead for extremely accurate results.

websocket_latency_test.zip

zR-JB avatar Jul 26 '24 10:07 zR-JB

So here is what I found:

  1. The Browser Web socket Implementation adds around 0.1 ms of latency compared to a native rust websocket client when running on the same machine
  2. Using a Rust websocket-server instead of a node.js server only saves about 0.02 ms
  3. When being in the same network but another machine, with native rust <->rust websockets I get around 0.3 ms (between 0.24 and 0.4)
  4. With this setup and the browser implementation client and rust websocket server, I get around 0.9ms.
  5. Real Latency via ICMP, in this scenario, is about 0.2 ms.
  6. So this is not ideal, but I am not sure if any other protocol can achieve anything better than that

zR-JB avatar Jul 26 '24 12:07 zR-JB

When you add browser extensions, web filters, antivirus software, and other busy tabs to the mix, you'll see a much higher RTT.

openspeedtest avatar Jul 26 '24 13:07 openspeedtest

Yes, I think a websocket approach to measure latency similar to:

grafik is probably still the best compromise

zR-JB avatar Jul 26 '24 13:07 zR-JB