[ECS] [request]: Implement ECS_RESERVED_CPU
- 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**
ecs-agent to implement CPU equivalent of ECS_RESERVED_MEMORY
**Which service(s) is this request for?**
ECS (ecs-agent)
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
I want to make disparate nodes within a ECS cluster appear the same so I can more reliably scale under both Spot and On-Demand conditions.
Absent Capacity Providers, the most convenient way to scale a EC2 ASG underneath a ECS cluster is on CPU%Reservation or Memory%Reservation. These calculations work best when the cluster is homogenous. Particularly when using Spot, or in general when you expect wild scaling swings, it is best practice to accept disparate instance types within a ASG. Some types have several equivalent variations (c5.2xl -> c5a/c5n/c5d.2xl) but this is not always the case. When I know my cluster requires at least $X cpu / $Y GB ram, I _could_ accept c5.2xl/c5.4xl as well as some of the m and r series that meet my needs. However if I do that and the nodes do not appear the same to ECS it'll throw off the autoscaling calculations.
For memory I can tweak the value of ECS_RESERVED_MEMORY at boot to make all the nodes appear the same (given a target), but I lack this for CPU.
**Are you currently working around this issue?**
Limiting myself to instance-type variations that have the same CPU capacity.
Contributor guide
Research direction
Start by locating how ecs-agent handles ECS_RESERVED_MEMORY and compare that behavior with the requested ECS_RESERVED_CPU setting. Review how CPU%Reservation is calculated for EC2-backed ECS clusters and define the equivalent CPU reservation behavior. Done means ECS provides a configurable CPU reservation value that makes heterogeneous instances comparable for scaling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100