I’m using to Run Task on AWS ECS for batch tasks.
Sometimes it takes 10 seconds for the task to be on pending start and move to running status and sometimes it can take 5 minutes to start running
between pending status to start running.
What can i do in order to prevent the 5 minutes delay issues?
Is there some settings or kind of “warm up” procedures?
The delay is due to your task starting on a container instance that doesn’t have your base image already downloaded. There are a few things you can do to help with this:
- Pre-load your instances by starting n number of tasks simultaneously, where n is the number of instances you have in your cluster. This will download your images onto each container instance, which will drastically improve the start times of subsequent tasks.
- Improve the networking throughput of your instances, by upgrading to larger instances with higher throughput. You can see a breakdown of each instance type on the ‘Amazon EC2 Instance Configuration’ page. You need to weigh up the increased cost against the delay.
- Reduce your image size.