my worker health checks keep failing on ECS deploy...
# ask-ai
i
my worker health checks keep failing on ECS deploy, is there a recommended config for retired or timeouts since it seems like it’s failing because workers take a while to start up?
t
Thanks for reaching out, Ed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
For LiveKit workers running on ECS, if your health checks are failing due to slow worker startup, it is recommended to extend the ECS health check start period, timeout, and retries to allow more time for the workers to fully initialize. Here are the recommended ECS health check settings based on LiveKit deployment best practices: • command:
["CMD-SHELL", "curl -f <http://localhost:8081/> || exit 1"]
interval:
30
(seconds) • timeout:
10-15
(seconds) • retries:
5-6
startPeriod:
60-120
(seconds, increase for slow-starting workers) Additionally, ensure your ECS task definition includes a suitable stopTimeout (graceful shutdown period). For standard workers, use
300
seconds, and for voice agents or long-running jobs, consider
600
seconds or more. These adjustments ensure workers have sufficient time to start before ECS considers them unhealthy and help agents complete tasks during shutdowns. Let me know if you need example ECS task definition configuration or further details for your setup. Sources: livekit-agents/livekit/agents/ipc/supervised_proc.py | WorkerOptions | LiveKit Agents | Deployment and scaling | LiveKit Docs | fly.io/fly.toml | Deploying to production | LiveKit Docs
i
this is what i had: healthCheck: { healthyThresholdCount: 2, unhealthyThresholdCount: 3, timeout: cdk.Duration.seconds(5), interval: cdk.Duration.seconds(30), }, with a startPeriod of 60 and it was failing
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!