copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

[Bug]: memory in manifest is ignored in favor of cpu

Open chrisschaub opened this issue 2 years ago • 5 comments

Description:

Specifying a 4cpu 8g memory instance in my manifest

environments:
  ecs-production:
    count: 1
    cpu: 4096
    memory: 8192

When I exec to the instance, I see 4 cpus and 16g of ram using free -m and htop. It seems like it's using the EC2 standard sizing as a base, not this chart: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-tasks-services.html#fargate-tasks-size .... or is there a soft limit? Even though the container shows 16g, we only have access to 8g. And are paying for 8g? Thanks.

chrisschaub avatar Apr 11 '24 14:04 chrisschaub

Hello @chrisschaub. I assume 16g is for all tasks you run in the instance right (and you run 1 task normally)? How often do you see your instance using 16g of ram? I wonder if this is because when you update the service, ECS spins up a new task before deleting the old task.

iamhopaul123 avatar Apr 12 '24 18:04 iamhopaul123

I log into each instance with svc exec and saw that 16g. There are two tasks ... assuming each is a separate container? The container should be what is provisioned?

On Fri, Apr 12, 2024 at 2:36 PM Penghao He @.***> wrote:

Hello @chrisschaub https://github.com/chrisschaub. I assume 16g is for all tasks you run in the instance right (and you run 1 task normally)? How often do you see your instance using 16g of ram? I wonder if this is because when you update the service, ECS spins up a new task before deleting the old task.

— Reply to this email directly, view it on GitHub https://github.com/aws/copilot-cli/issues/5770#issuecomment-2052272033, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZKZMCQFPUHY3SF5YQHAHDY5ASUVAVCNFSM6AAAAABGCNBXY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJSGI3TEMBTGM . You are receiving this because you were mentioned.Message ID: @.***>

-- Christopher Schaub http://chris.schaub.com

chrisschaub avatar Apr 12 '24 19:04 chrisschaub

that's right. if you have two tasks running then 16g mem makes sense to me since 8g mem is supposed to be per task

iamhopaul123 avatar Apr 12 '24 19:04 iamhopaul123

So does it deploy all tasks to one instance?

On Fri, Apr 12, 2024, 3:26 PM Penghao He @.***> wrote:

that's right. if you have two tasks running then 16g mem makes sense to me since 8g mem is supposed to be per task

— Reply to this email directly, view it on GitHub https://github.com/aws/copilot-cli/issues/5770#issuecomment-2052403040, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZKZMHZPAX5SENQOD7X7WDY5AYNXAVCNFSM6AAAAABGCNBXY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJSGQYDGMBUGA . You are receiving this because you were mentioned.Message ID: @.***>

chrisschaub avatar Apr 12 '24 19:04 chrisschaub

TLDR not necessarily: https://www.youtube.com/watch?v=Vtymod0nPBo&t=545s.

If you use Fargate then the tasks provisioning is all handled by Fargate under the hood and you only pay for the resources you use rather than anything under some specific instance (and the instance is managed by fargate).

iamhopaul123 avatar Apr 12 '24 19:04 iamhopaul123