I am getting this warning in my kubernetes pod whe...
# ask-ai
q
I am getting this warning in my kubernetes pod where the agent is hosted - WARNING livekit.agents: process memory usage is high.
t
Thanks for reaching out, Harsh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're seeing the agent log: "WARNING livekit.agents: process memory usage is high." I can help troubleshoot—below are likely causes and next steps. Could you share the details requested at the end so I can give targeted guidance? What this warning means • The agent process has exceeded expected memory thresholds but it isn't necessarily a hard failure—it's an alert that memory usage is elevated for the process hosting the agent. Common causes and quick checks • Pod memory limits/requests too low. Production voice agents often need ~8GB RAM (and ~4 vCPUs) depending on workload. • High workload/features enabled: noise cancellation, VAD, STT, TTS, large local models, or realtime video significantly increase memory. • Multiple concurrent jobs per agent process can accumulate memory from spawned subprocesses. • Long-running sessions or buffering/logging can cause gradual growth and indicate a leak. • Running on burstable/low-performance instance types (t3/t4) can worsen memory/GC behavior. Immediate actions to reduce risk • Increase the pod memory request/limit (try 8GB as a baseline for voice-heavy agents). • Temporarily reduce concurrent jobs per agent or disable nonessential features (noise cancellation, large models) to see if memory drops. • Restart the pod to reclaim memory while you investigate (safe short-term mitigation). • Confirm you’re on a recent SDK: Python v1.3.0+ or Node v1.0.18+ (these provide improved telemetry). Monitoring and diagnosis • Enable/collect Agent metrics with the
metrics_collected
event to track memory trends over time. • Correlate memory spikes with job starts, STT/LLM/TTS usage, or subprocess spawn events. • Use
UsageCollector
or your process-level tools (top/ps, pmap, heap profilers) to identify which subsystems consume most memory. Longer-term fixes • Implement autoscaling (HPA) using memory and CPU; consider a
load_fnc
that factors memory pressure. • Move heavy workloads to dedicated agent servers or scale out agents so each handles fewer concurrent jobs. • If memory grows continuously over time, investigate buffering, logging volume, or model inference code for leaks. To provide precise recommendations, please share: • Agent SDK and version (Python or Node) • Kubernetes pod memory requests/limits and node instance type • Number of concurrent jobs handled by that agent pod • Whether noise cancellation, video, large local models, BVC, STT/TTS, or other heavy features are enabled • Whether this is LiveKit Cloud or self-hosted Would you like step-by-step commands/examples for checking pod memory and logs or for changing requests/limits? Sources: Observability data hooks | LiveKit docs | Deploying to custom environments | LiveKit Docs | Agent server options | LiveKit docs | Automation & Knowledge Management Tools | livekit/livekit_composite | DeepW... | Agent insights in LiveKit Cloud | LiveKit docs