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

Owncast & MediaMTX Docker Exit 137 OOM Kill Triage

Go MediaMTX alone takes 90-450 MB RSS, but spawning a 3-rung FFmpeg ABR pipeline plus /dev/shm HLS rings inside a 1-2 GB container triggers Linux cgroup Exit 137.

Measured MediaMTX & FFmpeg Telemetry

Because /dev/shm tmpfs counts directly toward a Docker container’s memory cgroup limit, writing uncompressed video frames in FFmpeg filter_complex plus storing HLS segments in /dev/shm can exceed a 2 GB RAM slice and trigger SIGKILL (137).

Subsystem / SignalMeasured TargetOperational Impact
Go MediaMTX Passthrough RSS90 - 450 MBSafe even on 2-4 GB RAM nodes
3-Rung FFmpeg + /dev/shm950 - 1,650 MB RSSNeeds >= 4-8 GB container memory
Owncast + SQLite + Chat Peak1.4 - 2.8 GB RSSNeeds 8-16 GB RAM for 500+ chatters

Step-by-Step Triage & Config Remediation

  1. Verify Exit 137 via docker inspect: Run docker inspect <container> State.OOMKilled to confirm kernel cgroup memory termination.
  2. Budget /dev/shm inside container RAM: Set shm_size: 512m and mem_limit >= 4g (passthrough) or >= 8g-16g (ABR transcoding).
  3. Move high-concurrency streams to 16-32 GB VDS: UltaHost VDS 16 ($37.50/mo) gives generous RAM headroom for FFmpeg + /dev/shm + reverse proxy.
# Check OOM kill and separate /dev/shm limit in docker-compose.yml:
shm_size: '512m'
mem_limit: 8g

Diagnostic FAQ

Does Go MediaMTX leak memory over 24/7 uptime?

No. MediaMTX typically stabilizes between 90 MB and 450 MB RSS depending on viewer count and writeQueueSize.

Why did my 2 GB VPS crash when I enabled /dev/shm HLS?

Default Linux /dev/shm is 50% of RAM, and FFmpeg libx264 3-rung encoding uses ~900 MB, leaving almost zero kernel margin.

Related Broadcast Errors Guides

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