Skip to content
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

Allow specifying container parameters (cpu, memory) using ecs params #1149

Open
wralph opened this issue May 18, 2022 · 1 comment
Open

Allow specifying container parameters (cpu, memory) using ecs params #1149

wralph opened this issue May 18, 2022 · 1 comment

Comments

@wralph
Copy link

wralph commented May 18, 2022

With the current version of the ecs-cli (1.21.0) it is possible to specify CPU / memory requirements for the task but not for the actual container. This has an impact for Windows based containers as the default CPU value for a container is 0. This results in the container getting only 1% CPU cycles of the specified task CPU configuration as described in the documentation

On Windows container instances, the CPU limit is enforced as an 
absolute limit, or a quota. Windows containers only have access
 to the specified amount of CPU that is defined in the task definition. 
A null or zero CPU value is passed to Docker as 0, which Windows 
interprets as 1% of one CPU.

At the time of opening this issue, the documentation is not describing a possibility to specify the container CPU values.

Configurations used

The used service configuration:

version: '3'
services:
  auth:
    image: ralphw/ecs-lab4:windowsservercore-ltsc2019
    ports:
      - "80:80"
    security_opt: 
      - credentialspec:$credspec_param_arn

The ecs-params file:

version: 1
task_definition:
  ecs_network_mode: awsvpc
  task_execution_role: gmsa-task-execution-role
  task_size:
    mem_limit: 1024
    cpu_limit: 512 
run_params:
  network_configuration:
    awsvpc_configuration:
      subnets: 
        - $private_subnet3
        - $private_subnet4
      security_groups: 
        - $task_securitygroup_id
      assign_public_ip: DISABLED

The command to create the service

ecs-cli compose `
  --file auth-service.yml `
  --project-name auth-service `
  --ecs-params ecs-params.yml `
  service up `
  --target-group-arn $target_group_arn `
  --container-name auth `
  --container-port 80 `
  --timeout 10 `
  --cluster workshop-cluster

Context

I am trying to run Windows containers and am affected with containers getting not enough CPU resources to start properly.

Alternatives

A workaround is to use the aws cli and specify the task definition in the "traditional" way as there is a possibility to specify the container parameters.


This is a 🚀 Feature Request

@hqtoan94
Copy link

My one is with memory, I can't specify mem_limit for the container and then it always set to 512 which really inconvenient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants