Reputation: 422
We are using AWS ECS with launch type "Fargate" manage our containers. We have memory leak issues which we're actively investigating, however, in the meantime we need a solution to take down tasks that pass a certain memory threshold.
Using the AWS cli to run "update-service force-new-deployment" takes all the tasks down. We could target individual tasks using "aws ecs stop-task", however, I cannot find a metric in cloudwatch that gives us this task-specific information. We can only seem to find cluster or service level averages.
Any helps would be appreciated.
Upvotes: 1
Views: 2586
Reputation: 7
"update-service force-new-deployment" with a configuration of Min task running and Max task running will not take all tasks down.
It will create new tasks and old one will be down only after new ones are alive.
Upvotes: 0
Reputation: 11
could not comment so posting as an answer.
You could work it around with a hard memory limit set for the container with the memory param.
If your container attempts to exceed the memory specified here, the container is killed.
https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html
Upvotes: 1