Live HLS Buffering: 1 Gbps Port Saturation & Egress Throttling
At 6 Mbps ingest, just 160 concurrent viewers saturate a 1 Gbps NIC (1,037 Mbps with framing overhead), causing .ts/.m4s segment fetch timeouts across every player.
Measured MediaMTX & FFmpeg Telemetry
StreamRelay Lab telemetry shows Go MediaMTX handles 2,000+ HTTP connections in ~160-360 MB RSS, so buffering rarely stems from MediaMTX memory. Instead, standard 1 Gbps VPS ports saturate around 880-920 Mbps effective TCP throughput, or metered providers throttle egress after 10-20 TB.
| Subsystem / Signal | Measured Target | Operational Impact |
|---|---|---|
| 160 Viewers @ 6 Mbps | ~1,037 Mbps Fan-Out | Saturates a 1 Gbps VPS interface completely |
| 350 Viewers @ 6 Mbps | ~2,268 Mbps (122 TB/mo) | Requires 10 Gbps NIC or Unmetered VDS |
| Go MediaMTX Relay RSS | 140 - 360 MB | CPU/RAM stays low while NIC queues back up |
Step-by-Step Triage & Config Remediation
- Measure live NIC throughput: Run sar -n DEV 1 or nload during viewer peaks to confirm txkB/s is hitting port ceiling.
- Enable TCP BBR pacing: Activate net.ipv4.tcp_congestion_control=bbr so bursty HLS segment downloads do not collapse cwnd.
- Move to Unmetered VDS or 10 Gbps: Provision UltaHost Unmetered VDS ($37.50-$54.50/mo) for >15 TB/mo or InterServer 10 Gbps ($12-$24/mo) for bursty low-TB streams.
# Check real-time NIC egress saturation (1,000,000 kbit = 1 Gbps) sar -n DEV 1 5 # Enable BBR congestion control for smooth HLS segment delivery: sysctl -w net.core.default_qdisc=fq sysctl -w net.ipv4.tcp_congestion_control=bbr
Diagnostic FAQ
Why does MediaMTX buffer even when CPU is under 15%?
Go HLS muxing is lightweight (~15% of 2 cores at 1 Gbps). Buffering at low CPU almost always points to 1 Gbps port saturation, disk I/O stalls on segment writes, or ISP peering congestion.
Does lowering HLS segment duration fix egress buffering?
Shorter segments (1s) reduce startup latency, but they actually increase HTTP request rate. Fix port throughput and /dev/shm disk speed first.