kubernetes Pods running livekit workers are always...
# ask-ai
s
kubernetes Pods running livekit workers are always consuming too much memory around 6Gb even when no jobs are being executed. Any ideas?
t
Thanks for reaching out, Rida. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking why LiveKit worker pods sit at ~6GB memory even when idle. Here are the most likely causes and concrete steps to troubleshoot and reduce usage. What to check first • Confirm whether this is per-pod or cumulative: scale replicas to 1 and observe memory. If one pod still uses ~6GB, it’s a per-pod issue. • List processes inside the pod (e.g.,
ps aux
or
top
) to see how many child processes and which binaries are using memory. Likely causes and actions • Prewarmed/model caching: Large preloaded models (VAD, STT, LLM weights) or many idle processes can push baseline memory up. Reduce
num_idle_processes
in agent options to limit warmed processes. • Too many replicas or workers: Ensure you haven’t accidentally deployed extra replicas; each replica that preloads models multiplies baseline memory. • Large models being loaded unnecessarily: Check your prewarm routine and disable preloading of large models not needed at idle. Load heavy models on-demand if acceptable. • Environment/instance type effects: If running on burstable instances (t3/t4), CPU credit exhaustion can cause odd behavior—switch to non-burstable instance types (m5/c5) for predictable performance and monitoring. • Pod image or extra dependencies: Use a minimal agent image and remove unused libraries to shrink memory footprint. Debug steps (sequence) 1. Scale replicas to 1 and remeasure memory. 2. Exec into the pod and run
ps aux
/
top
to identify top memory consumers. 3. Temporarily set
num_idle_processes
to 0 or 1 and restart to see memory delta. 4. Disable prewarm of large models and observe memory. Add back components one-by-one to isolate the offender. 5. If on burstable VMs, check CPU credit balance; consider moving to non-burstable instances. If you’d like, share: • whether the 6GB is for a single replica or across replicas, • your
num_idle_processes
setting, and • whether you prewarm VAD/STT/LLM models. I can help interpret process output or suggest exact config edits once you provide those details. Sources: Deploying to custom environments | LiveKit docs | Agents (Node.js) | livekit/livekit_composite | DeepWiki | Agent server options | LiveKit docs | Troubleshooting Latency and Timeout Errors with Turn Detection on AWS | Agents Framework | livekit/livekit_composite | DeepWiki