enough-arm-57696
07/10/2025, 8:47 PMtall-airline-16756
07/10/2025, 8:48 PMtall-airline-16756
07/10/2025, 8:49 PMstopTimeout
to 120 seconds to use the full ECS grace window.
• Set drain_timeout
(in worker options or environment variable) to 90–110 seconds, providing time for in-progress calls to end gracefully.
• For critical workloads, slow down scale-down operations with conservative autoscaling cooldown periods to give more time for workers to drain without being terminated abruptly.
Be aware that ECS's 120-second termination is much shorter than the default LiveKit drain period (typically 30 minutes for voice agent apps). If your application often has longer sessions, consider designing for session handoff or look into platforms like Kubernetes, which permit longer termination grace periods (up to hours). Calls ongoing beyond the 120s window will be ended by ECS.
Summary of recommended settings and considerations:
• drain_timeout: 90–110 seconds
• ECS stopTimeout: 120 seconds
• Autoscaling: Conservative downscale cooldowns
• For longer sessions: Explore session handoff or alternative orchestration like Kubernetes Sources: Worker options | LiveKit Docs | Deploying to production | LiveKit Docs | Deploy to Kubernetes | LiveKit Docs