Hi Team,
We’ve been running multiple Mediasoup server instances in production (a server with 8 GB RAM). On one server, we hit HostOutOfMemory, and the server crashed, though user counts are balanced across servers.
Observations
-
mediasoup-workerprocesses steadily grow to ~10–12 GB RSS under load. -
RSS does not shrink when rooms or users disconnect.
-
Memory shows up as Inactive_anon (allocator/
libstdc++behavior). -
Questions
-
Is this memory plateau/retention expected behavior in Mediasoup under high fan-out + retransmission?
-
Are there recommended configuration tweaks (e.g., retransmission history buffer,
maxIncomingBitrate, auto-pause) that help reduce RSS footprint without impacting quality? -
For large deployments, is the standard approach to recycle workers (rolling restarts) to release memory back to the OS?
-
Any best practices from the community on room assignment (e.g., weighting rooms by producers/fan-out) to avoid uneven memory load across nodes?
Our current mitigations are:
-
Restart workers when RSS >70%
-
Plan rolling restarts off-peak
mediasoup: “3.12.0”
Node 20.14.0
Socket.io “4.4.0”
ioredis “^4.16.1”
Would appreciate confirmation if this is the expected lifecycle, or if we might be missing some tuning that would reduce memory retention.
Thanks in advance
Harjeet Singh



