lively-horse-90722
12/23/2025, 7:39 AMtall-airline-16756
12/23/2025, 7:39 AMtall-airline-16756
12/23/2025, 7:40 AMCPUCreditBalance. If it’s near zero, throttling is the cause.
2. Check CPU usage vs. system load and any throttling metrics in CloudWatch over the time the issue appears.
3. Inspect agent logs for timeouts, queuing, or inference latency spikes (latency >500ms suggests throttling/backpressure).
Recommended actions
• For production, move to a non-burstable compute-optimized instance (for example `c5`/`c6i` family or m5.xlarge) for stable CPU performance.
• If switching isn’t possible immediately, scale horizontally (more agents) to distribute load.
• Review agent workload: confirm you aren’t running unnecessary CPU-heavy tasks (large models, video processing on audio-only flows, or multiple heavy tasks per agent).
• Monitor inference latency for any STT/TTS/VAD/LLM models — sustained high latency points to resource starvation.
To help further, please share:
• Agent type (voice or video)
• Models in use (STT, TTS, VAD, LLM, etc.)
• Approximate concurrent sessions and average session duration
• Any recent config or traffic changes
• Relevant agent logs showing CPU, latency, or timeout errors
Send those details and I’ll give targeted next steps (instance sizing recommendation, config changes, or workload optimizations).
Sources: Troubleshooting Latency and Timeout Errors with Turn Detection on AWS | LiveKit turn detector plugin | LiveKit docslively-horse-90722
12/23/2025, 8:12 AMtall-airline-16756
12/23/2025, 8:12 AMCPUCreditBalance for the instance during the error window. If it’s near zero, throttling is happening.
2. Check agent logs around the same timestamps for inference latency spikes, queuing, or repeated initialization attempts.
3. Confirm how many agents/processes you run on that instance and current concurrency—oversubscription can cause similar timeouts.
Short-term mitigations
• Enable t3.unlimited (if acceptable for cost) to avoid immediate credit exhaustion.
• Reduce agent concurrency on that host or move some agents off the instance.
• Increase the IPC/init timeout temporarily if you need more time while fixing capacity (only as a stopgap).
Recommended long-term fixes
• Move agents to non-burstable compute-optimized instances (for example c5.large, c6i.large, or m5.xlarge) to avoid CPU credit throttling and get stable latency.
• Scale horizontally (more agents on separate instances) so each process has predictable CPU headroom.
To give a precise remediation plan, please share:
• Agent type (voice or video)
• Models in use (STT/TTS/VAD/LLM/ONNX inference)
• Number of agents/processes on the t3.xlarge and typical concurrent sessions
• CloudWatch CPUCreditBalance around the error time (or tell me if it was near zero)
• Any recent config/traffic changes and a short snippet of the agent log around the timeout
Send those details and I’ll recommend exact instance sizing, timeout config changes, and next steps.
Sources: Troubleshooting Latency and Timeout Errors with Turn Detection on AWS | Deploy and scale agents on LiveKit Cloudlively-horse-90722
12/23/2025, 8:14 AMtall-airline-16756
12/23/2025, 8:14 AMlively-horse-90722
12/23/2025, 8:20 AMtall-airline-16756
12/23/2025, 8:20 AMlively-horse-90722
12/23/2025, 8:23 AMtall-airline-16756
12/23/2025, 8:24 AMload_fnc / load_threshold) to better reflect your environment.
If you want, tell me which fallback behavior you prefer (queue, voicemail, retry) and I’ll outline a simple architecture and implementation options.
Sources: Agents Framework | livekit/livekit_composite | DeepWiki | Server lifecycle | LiveKit docs | Agent server options | LiveKit docs | Deploy and scale agents on LiveKit Cloud | Deploy and scale agents on LiveKit Cloudlively-horse-90722
12/23/2025, 8:25 AMtall-airline-16756
12/23/2025, 8:25 AMlively-horse-90722
12/23/2025, 8:27 AMtall-airline-16756
12/23/2025, 8:27 AMagent.py with your agent binary/script name:
◦ Count:
pgrep -f agent.py | wc -l
• Or list:
ps aux | grep agent.py | grep -v grep
2) If using containers
• Docker:
docker ps --filter "name=agent" --format "{{.Names}}" | wc -l
• Kubernetes:
kubectl get pods -l app=livekit-agent --no-headers | wc -l
3) Use system monitors
• Run htop or top and filter/search for the agent process name to see each process and its CPU/memory.
4) From agent logs
• Start the agent with debug logging (--log-level=DEBUG) and inspect lifecycle logs — each job run creates a process and debug logs will show process spawn/exit events.
Notes
• Each agent job runs in its own process, so counting those processes gives the number of active agent jobs on the host.
• For LiveKit Cloud, process-level counts aren’t exposed; use the Cloud dashboard metrics for session/worker counts.
If you tell me your agent process name or whether you run in Docker/Kubernetes, I’ll give the exact command tuned to your setup.
Sources: Agent server options | LiveKit docs | Server lifecycle | LiveKit docs | Deploy and scale agents on LiveKit Cloudlively-horse-90722
12/23/2025, 8:32 AMtall-airline-16756
12/23/2025, 8:32 AMc5.large, c6i.large, or m5.xlarge) to avoid CPU-credit throttling and reduce timeouts.
• If you must stay on t3, enable t3.unlimited and monitor CPUCreditBalance and per-request inference latency closely.
• Remove strict pinning or implement session handoff if you want automatic failover. Options:
◦ Unpin sessions so dispatch can place jobs on healthy workers.
◦ Implement application-level handoff: detect host overload and transfer sessions (requires application logic and careful state sync).
• Implement external queuing or retry logic for new calls — LiveKit does not provide built-in call queuing. Use a queue/dispatcher or backoff/retry in your caller flow to avoid immediate rejection when the pinned host is saturated.
Monitoring to collect now
• Per-request inference latencies (p50/p95/p99) for STT/TTS/VAD/BVC.
• CPU% and 1m/5m load during TimeoutErrors.
• Agent process logs around IPC/init timeouts.
• CPUCreditBalance if still on t3.
If you’d like, I can:
• Recommend exact instance sizing for your 10 sessions/host and model mix,
• Outline a simple architecture to remove pinning while preserving session affinity,
• Provide commands and metrics to collect the latency and load traces.
Which of those would you like next?