Skip to content

Upload speed inflated on low-latency connections (v6.1.0) #819

Description

@EmanuelPeixoto

Description

Upload speed is massively inflated (7-10 Gbps reported) on low-latency connections. The v6.1.0 speedtest.js no longer uses XMLHttpRequest.upload.onprogress to track actual bytes sent over TCP. Instead it appears to measure time-to-HTTP-response. On LAN (<1ms latency), empty.php returns 200 OK immediately before the request body is fully transmitted, so the reported upload speed is wildly wrong.

The old v5.x speedtest_worker.js used xhr.upload.onprogress and was accurate. This is a regression.

Server

  • OS: NixOS 26.11 (kernel 6.18.38)
  • Web server: nginx 1.30.3
  • PHP: 8.4.22 (php-fpm, unix socket)
  • Speedtest: LibreSpeed v6.1.0 (self-hosted, latest release)
  • Mode: Modern UI (index-modern.html), single server, HTTP/2 + HTTPS
  • Server latency: <1ms (same physical switch)

Client

  • Browser: Zen (Firefox-based) on Linux
  • Connection: 1 Gbps Ethernet to same switch as server
  • Latency to server: ~0.5ms

Steps to reproduce

  1. Self-host LibreSpeed v6.1.0 on a LAN server
  2. Access modern UI from another machine on same LAN (<1ms latency)
  3. Run upload test against local server
  4. Observe upload speeds of 7-10 Gbps on gigabit hardware

Expected behaviour

Upload speed should reflect actual TCP throughput (~940 Mbps on gigabit LAN), as it did in v5.x with xhr.upload.onprogress.

Notes

  • Download test is unaffected — garbage.php actually sends data before closing the connection
  • The issue diminishes on high-latency connections (WAN) because the HTTP response roundtrip is slower than the upload, masking the problem
  • empty.php returns headers immediately without consuming the POST body. With onprogress this didn't matter because timing was driven by TCP progress events, not HTTP response time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions