-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ECS Agent should allow for more control over task cleanup #2968
Comments
Thanks for filing the issue - we're looking into it |
Our current thought of how to fix this issue is: We will introduce a new ecs agent environment variable Feel free to let us know if you have any comment about the above proposed fix.
|
Fix has been added in version 1.55.0 - https://github.com/aws/amazon-ecs-agent/releases/tag/v1.55.0. Closing |
When ECS stops a Task/container it seems to do a
docker stop
and then wait by default three hours before it does thedocker rm
to clean up the Task.There is an option today in the agent, ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION, that will allow you to change that 3 hour default delay between the stop and the clean up.
With Images the agent exposes more granular control of that process - the number of images deleted per cycle etc. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/automated_image_cleanup.html
In my customer's use-case they are stopping thousands of Tasks at nearly the same time as part of their deployment and would like to stagger the cleanups of them more - as at exactly 3 hours after their deployment their EC2 Instances, and all the Tasks on them, are highly impacted by these mass cleanups. In this case they highly use docker ephemeral local volumes so these task cleanups trigger lots of IO cleaning up these temporary volumes when ECS Agent does the
docker rm
on it.Since the ECS Agent owns this operation, and the logic around it, they were hoping for more control to throttle/stagger these Task cleanups to minimise their level of disruption via similar new options to what is available for the Images.
The text was updated successfully, but these errors were encountered: