[Bug] Built-in speedtest shows anomalously low upload speed for Hysteria2 configs
Operating system
Windows
System version
11
Installation type
exe
Version
1.3.2
Description
When running the built-in Speed Test on Hysteria2 profiles, the upload speed is anomalously low (e.g. 1–5 Mbps), while download speed and latency are measured properly.
However, when connected to the same Hysteria2 profile (via TUN / System Proxy) and testing through a browser (e.g., speedtest.net), the upload speed is completely normal (90–200+ Mbps).
Root Cause / Technical Context:
- The default speed test timeout is only 5000 ms (
speed_test_timeout_ms = 5000). - For each profile tested, a fresh sing-box core instance is started (cold QUIC connection).
speedtest-goimmediately spawns multiple parallel upload workers (runtime.NumCPU()), blasting concurrent 1MB POST chunks over a single multiplexed QUIC connection.- On Windows, this initial packet burst causes socket/buffer drops on a cold connection. Hysteria2's BBR congestion control detects packet loss during slow start and slashes the sending rate. Within the 5-second timeout, BBR never has enough time to recover and probe full bandwidth.
- Manually increasing
speed_test_timeout_msto 15–20s in settings completely fixes the issue on my machine and speeds return to normal (90–200+ Mbps), confirming the root cause.
Suggested Improvements:
-
Increase default speed test timeout (or upload timeout) for QUIC/UDP protocols.
-
Add gentle pacing/warm-up for upload workers in
speedtest-go. -
Tune UDP socket send buffer (
SO_SNDBUF) for Windows.Note: Technical explanation drafted with the help of AI, but fully reproduced and verified on my machine.
Reproduction
- Add any working Hysteria2 profile (without hardcoded
up_mbps). - Run built-in Speed Test (Download + Upload).
- Observe upload speed showing ~1–5 Mbps.
- Connect to the profile and run speedtest.net in browser -> observe 100+ Mbps upload.
- Increase "Speed test timeout" in Basic Settings to 15000 ms -> re-run test -> upload speed becomes normal.
Logs
N/A
Try the newest beta. Also you need to increase your server's receive buffer too. You should also take a look at your congestion control settings for hysteria.
I traced a reproducible application-limited classification problem in the pinned QUIC dependency and opened a draft fix: https://github.com/SagerNet/quic-go/pull/2.
Pure ACK traffic could repeatedly discard the empty-application observation, leaving BBR with misleading low-rate history before a later upload. The follow-up also bounds idle time at the first outgoing-data publication, so time spent queued behind pacing is not counted as application-empty.
The focused regressions, full module tests, twenty race repetitions and vet pass. In a socket-free Hysteria2 test using eight workers, a calibrated 100 Mbps / 40 ms RTT model and independent receiver-byte counts, post-download upload measured 16.364/21.424 Mbps upstream versus 92.890/93.106 Mbps with the change. Fresh-upload controls stayed around 93 Mbps. All eight planned runs had zero observed QUIC or emulated-link loss. Earlier runs on a different link model had receive-queue drops and were excluded, not treated as proof.
This confirms a dependency defect and a controlled reproduction, but does not establish that this defect caused the Windows/server result reported here. The PR remains a draft, and this change is not yet included in a Throne release. Once a build incorporating the reviewed dependency change is available, a retest against the same server, comparing upload-only with download followed by upload, would help confirm the effect in the original environment.
A follow-up to https://github.com/SagerNet/quic-go/pull/2 corrects a flow-credit edge case found during review: MAX_DATA or MAX_STREAM_DATA could prematurely end an idle interval without making queued data sendable. The updated code checks useful credit restoration, including both GSO paths and both connection/stream restoration orders. The previous head fails 28 new regression subcases; the updated full suite, twenty race repetitions, vet and a small real Hysteria2 TLS/auth/HTTP smoke pass.
The earlier controlled throughput numbers were measured on the previous head (31ec554); they have not been rerun for this follow-up. This remains a draft dependency fix and has not been released in Throne. The original Windows/server case is still unverified; these tests do not establish that this defect caused that result.