Skip to main content
LIVE_HUD STREAMRELAY LAB // MEDIAMTX RTMP -> LL-HLS / WHEP / SRT AUDIT 2026-11-19 | GO RSS: 90-450 MB | EGRESS: UNMETERED VDS VS 10 GBPS
MediaMTXRTMP
MediaMTXRTMP Disclosure: Outbound /go/ links marked rel="sponsored" may earn a referral fee at zero checkout surcharge (Disclosures).
Broadcast Errors // StreamRelay Lab

LL-HLS Segment 404s & Disk I/O Thrash on Slow Storage

Writing 200ms LL-HLS parts every fifth of a second onto shared HDD/SSD volumes creates fsync stalls that cause players to fetch expired segments and hit HTTP 404.

Measured MediaMTX & FFmpeg Telemetry

Low-Latency HLS writes new partial segments every 200 ms and deletes old ones after hlsSegmentCount (7). Storing ephemeral 7-second live ring segments on physical disk wastes IOPS and triggers 404s during disk flush spikes.

Subsystem / SignalMeasured TargetOperational Impact
200ms LL-HLS Write Rate5 partial files/sec per stream432,000 ephemeral file writes/day
Ring Memory Footprint180 - 480 MB totalFits easily in /dev/shm RAM tmpfs
hlsSegmentCount Safe Floor7 segments x 1sGives 7s jitter window against 404s

Step-by-Step Triage & Config Remediation

  1. Point hlsDirectory to /dev/shm: Set hlsDirectory: /dev/shm/mediamtx-hls so every .m4s part stays strictly in RAM.
  2. Keep 7x 1s segments: Set hlsSegmentCount: 7 and hlsSegmentDuration: 1s so slow mobile clients never request evicted segments.
  3. Disable proxy caching on .m3u8: Ensure Nginx/Caddy sets Cache-Control: no-cache on playlists while caching .m4s/.ts segments for 10s.
# mediamtx.yml zero-disk LL-HLS configuration
hls: yes
hlsAddress: :8888
hlsVariant: lowLatency
hlsSegmentCount: 7
hlsSegmentDuration: 1s
hlsPartDuration: 200ms
hlsDirectory: /dev/shm/mediamtx-hls

Diagnostic FAQ

How much RAM does /dev/shm need for MediaMTX HLS?

A 7-second ring at 10 Mbps (even with 3 ABR rungs) uses under 50 MB of RAM; reserving 256-512 MB in /dev/shm is plenty.

What happens if the server reboots with /dev/shm?

Live HLS segments are ephemeral anyway; systemd ExecStartPre=mkdir -p /dev/shm/mediamtx-hls recreates the ring directory on boot.

Related Broadcast Errors Guides

MediaMTXRTMP: Size egress Mbps & ABR cores before go-live Launch UltaHost VDS