Here are some recommended optimal settings for your LiveKit agents that can help everything run smoothly:
•
Ping Timeout: The default is 60 seconds. If you’re working in high-latency environments or handling tasks that require a lot of computing power, it might be helpful to increase this value a bit to prevent any premature disconnections. Typically, the ping interval is 5 seconds, and the high ping threshold for inference processes is around 2.5 seconds.
•
Memory Limits: It’s a good idea to set a memory warning threshold (like 500 MB) and also configure a maximum memory limit for jobs if needed. For workloads that use a lot of memory, consider allocating enough memory—around 8 Gi works well for about 30 concurrent AI conversations.
•
Shutdown Process Timeout: The default here is 60 seconds. You’ll want to align this with your platform’s termination grace period (for example, 600 seconds if you’re using Kubernetes) so that shutdowns can happen gracefully. Also, the drain timeout, which defaults to 1800 seconds, controls how long current jobs have to finish when a worker is terminating.
These settings can be adjusted depending on your specific workload and available resources. If you’d like, I’m here to help you configure these parameters to fit your needs perfectly. Just let me know!
Sources:
livekit-agents/livekit/agents/ipc/proc_pool.py |
kubernetes/agent-manifest.yaml |
Job lifecycle | LiveKit Docs |
Worker options | LiveKit Docs |
Deploying to custom environments | LiveKit Docs