-
Notifications
You must be signed in to change notification settings - Fork 617
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
Options to set hard cap on CPU for ECS tasks #1093
Comments
Hi @kssaril, Thanks for reaching out to us! We've recently added the 'cpu' field to the task definition at the task level. The task level cpu will function as a hard cap. In order to use this, you will need to be running a container instance with the newest agent release (1.16.0). More info can be found here. This should address both of your example scenarios. Feel free to reopen this issue if you have additional questions. |
Quick question: Thanks Source: https://stackoverflow.com/questions/26841846/how-to-allocate-50-cpu-resource-to-docker-container |
The task-level CPU field is a hard limit, implemented with CPU quotas (not CPU shares). We do not currently use a cpuset to pin tasks to specific vCPUs. |
@samuelkarp I am looking at the aws documentation here
which is infact a soft limit . Can you please clarify your above comment ? Is there any other options other than |
Hi @kssaril , Check the section "container_definitions", there is a "cpu" setting for each container. So the options are both called "cpu" but they are at different level of the task definition, the other answer in this post should taken in that context. "task-level" and "container-level" cpu setting. |
@hyksos "each task would be guaranteed a minimum ... when needed, and each container could float to higher CPU usage if the other container was not using it" CloudFormation documentation prob need update. |
Currently there is no options available to set hard cap on CPU for ECS Docker containers
Description
Docker 1.13 added and option --cpus to set a hard cap of the CPU which a docker container can allocate on host machine but AWS ECS task definitions doesn't seems to be supporting that .
ECS doesn't have support for --cpu-quota and cpu-period options too which can be leveraged to get the same results
An option for setting maximum cpu a task can utilize will be desirable in situations where multiple ecs (docker) containers are running on an EC2 instance in below example scenarios
Expected Behavior
A hard cap on CPU for newly placed ECS containers will make sure the existing containers are not impacted during startup of new Containers or when another containers becomes faulty .
Observed Behavior
ECS container startup utilizing all the CPU of the instance which its running causing other tasks to suffer
Any faulty ECS task can cause other healthy tasks to suffer if it tries to USE all the available CPUs
The text was updated successfully, but these errors were encountered: