[ECS] [request]: Add task warmup time option like EC2 autoscaling to ECS
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
I would like ECS to have a task warmup-time feature that excludes initializing tasks from scaling metrics to avoid overprovisioning.
**Which service(s) is this request for?**
ECS
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
We may encounter a scaling issue when implementing [ECS AutoScaling](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html) considering CPU-utilization metric. The problem occurs in the following scenario:
1. Tasks consume high CPU resources during their initialization process
2. When a new task is added, especially in services with few tasks, its initialization process significantly increases the service's overall CPU utilization
3. This increased CPU usage triggers AutoScaling to add more tasks unnecessarily, resulting in over-provisioning
EC2 AutoScaling already has a solution for this - [a default warmup-time option](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-default-instance-warmup.html) that excludes new resources from scaling metrics for a certain period after launch.
To solve this issue, I propose adding one of these features:
1. An option in ECS to exclude newly added tasks from metric collection during their warmup period
2. A new CloudWatch Metric for AutoScaling that excludes newly added tasks from its calculations
**Are you currently working around this issue?**
We can use alternative metrics if any were available that are not affected by task initialization.
**Additional context**
Anything else we should know?
**Attachments**
If you think you might have additional information that you'd like to include via an attachment, please do - we'll take a look. (Remember to remove any personally-identifiable information.)
Contributor guide
Assessment
This issue has not been assessed yet.