Skip to content

[Fargate] [request]: Add higher vCPU / Memory options #164

Closed

Description

@mbj

Tell us about your request

Increase maximum allowed vCPU / Memory resources of Fargate tasks.

Which service(s) is this request for?

Fargate

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?

I want to offload computationally heavy tasks, that can only be locally parallelized to Fargate. Without having to boot an EC2 instance and its associated maintenance overhead.

An example of such a task is the compilation of GHC (the Haskell compiler). Its build system allows parallel computation, but no distribution.

Are you currently working around this issue?

Considering to script the use of a bigger EC2 instance, with its associated maintenance overhead.

Additional context

None.

Activity

  1. changed the title [-][service] [request]: describe request here[/-] [+][Fargate] [request]: describe request here[/+] on Feb 13, 2019
  2. changed the title [-][Fargate] [request]: describe request here[/-] [+][Fargate] [request]: Add higher vCPU / Memory options[/+] on Feb 13, 2019
  3. fengyj commented on May 15, 2019

    @fengyj

    yes, pls support more cpu and more ebs. @abby-fuller , does AWS have any plan on this?

  4. srinivaspype commented on Dec 6, 2019

    @srinivaspype

    Any SLA for this? Currently Fargate implementation provides general-purpose CPU cycle speed (2.2GHz- 2.3GHz) for us and not capable of running CPU/GPU critical applications.

  5. mavericknavs commented on Jul 8, 2020

    @mavericknavs

    Please extend the current vCPUs limit. It will really help a lot of our Customers.

  6. Djolivald commented on Nov 20, 2020

    @Djolivald

    Any idea if other CPU option are even considered? This is 'proposed' for a while without feedback from AWS.
    Would love to have 8/16/32 vcpu options, without having to take care of EC2 maintenance.

  7. luxaritas commented on Jan 6, 2021

    @luxaritas

    Recently discovered Fargate and the idea of not having to manually provision instances, keep the underlying instance up to date, etc. is very attractive. However, a particular workload we have, which involves some ML model evaluation, requires somewhere from 60-100GB of RAM. Will likely fall back to a dedicated ECS/EC2 cluster with autoscaling, but would rather let Fargate handle the process...

  8. sreeninair commented on Feb 18, 2021

    @sreeninair

    I had similar cpu spikes issue when migrated to fargate. In the task definition I have specified 4 cores (maximum resources) initially and which was not sufficient for my app. After specifying cpu in the container >> Environment >> cpu to 4096, the cpu spike is comparatively less. This cpu field is optional for fargate launch type but without it I guess it will only allocating 4 cores for the total number of tasks running, though I am not sure. @luxaritas Similarly for memory if we specify the to 32G in container >> Environment >> memory, it might fix your issue.

    Aws definitely needs to upgrade cores to a minimum of 8.

  9. andreasunterhuber commented on May 19, 2021

    @andreasunterhuber

    @abby-fuller any update on this request? 8 vcpu would be a start!

  10. ostwalprasad commented on Jun 3, 2021

    @ostwalprasad

    Fargate Compute Optimized CPUs ftw!

  11. harshdubey-sb commented on Jun 7, 2021

    @harshdubey-sb

    Increase maximum allowed vCPU / Memory resources of Fargate tasks minimum to 8.

  12. sanjeevpande26 commented on Jun 7, 2021

    @sanjeevpande26

    any update on this ?

  13. ostwalprasad commented on Jun 7, 2021

    @ostwalprasad

    Can the newly launched AWS App Runner run on more CPUs? Is that an alternative to Fargate?

  14. 30 remaining items

  15. raniel90 commented on Aug 4, 2022

    @raniel90

    Hi, guys. To workaround this, I've built two callbacks on Apache Airflow to create ECS cluster using EC2 container instance. You can choose any desired hardware, but it's required use a default AMI with ECS capabilities. You can use boto3 directly to integrate with AWS too as alternative.

    Declare this constants:

    ECS_EC2_AMI = "ami-09ce6553a7f2ae75d"
    ECS_EC2_IAM_ROLE = "ecsInstanceRole"
    ECS_ARGS = {
        "region_name": "YOUR-REGION",
        "aws_conn_id": "aws_default",
        "task_definition": "taskdef",
        "cluster": "YOUR-CLUSTER-NAME",
        "launch_type": "FARGATE",
        "platform_version": "1.4.0",
        "network_configuration": {
            "awsvpcConfiguration": {
                "securityGroups": ["YOUR-SECURITY-GROUPS"],
                "subnets": ["YOUR-SUBNETS"],
                "assignPublicIp": "ENABLED",
            }
        },
        "retries": 0,
    }

    Function to create cluster (create cluster, create instance, associate EC2 instance, await instance state to ready):

    import pprint
    import traceback
    import time
    import boto3
    
    def on_success_callback_start_ecs_cluster_container_instance(kwargs, instance_type):
        try:
            has_container_instance = False
    
            if instance_type:
                ## Force delete before create to not create many EC2 Instances
                on_callback_stop_ecs_cluster_container_instance(kwargs)
    
                region_name = ECS_ARGS.get("region_name")
                ecs_client = boto3.client("ecs", region_name=region_name)
                ec2_client = boto3.client("ec2", region_name=region_name)
                ec2_resource = boto3.resource("ec2", region_name=region_name)
    
                cluster_name = kwargs["dag_run"].conf.get("cluster_name")
                ecs_client.create_cluster(
                    clusterName=cluster_name,
                    tags=[
                        {"key": "PROJECT", "value": str(cluster_name).upper()},
                    ],
                )
    
                pprint.pprint(
                    f"Cluster {cluster_name} created with success on {ECS_ARGS.get('region_name')}"
                )
    
                security_group_ids = (
                    ECS_ARGS.get("network_configuration")
                    .get("awsvpcConfiguration")
                    .get("securityGroups")
                )
                subnet_id = (
                    ECS_ARGS.get("network_configuration")
                    .get("awsvpcConfiguration")
                    .get("subnets")[1]
                )
    
                ec2_response = ec2_client.run_instances(
                    ImageId=ECS_EC2_AMI,
                    MinCount=1,
                    MaxCount=1,
                    SecurityGroupIds=security_group_ids,
                    SubnetId=subnet_id,
                    InstanceType=instance_type,
                    IamInstanceProfile={"Name": ECS_EC2_IAM_ROLE},
                    TagSpecifications=[
                        {
                            "ResourceType": "instance",
                            "Tags": [
                                {
                                    "Key": "PROJECT",
                                    "Value": str(cluster_name).upper(),
                                },
                            ],
                        },
                    ],
                    UserData=f"""
                    #!/bin/bash
                    echo ECS_CLUSTER={cluster_name} >> /etc/ecs/ecs.config
                    echo ECS_AVAILABLE_LOGGING_DRIVERS='["json-file","awslogs"]' >> /etc/ecs/ecs.config
                    echo ECS_ENABLE_AWSLOGS_EXECUTIONROLE_OVERRIDE=true >> /etc/ecs/ecs.config
                    """,
                )
    
                pprint.pprint(f"EC2 create response: {ec2_response}")
    
                instance_id = ec2_response.get("Instances")[0].get("InstanceId")
                instance = ec2_resource.Instance(instance_id)
    
                pprint.pprint(f"Waiting instance {instance_id} start on {region_name}...")
    
                instance.wait_until_running()
    
                pprint.pprint(
                    f"Instance {instance_id} is running on {ECS_ARGS.get('region_name')}"
                )
    
                while not has_container_instance:
                    response = ecs_client.list_container_instances(cluster=cluster_name)
    
                    if response["containerInstanceArns"]:
                        has_container_instance = True
                        print("Container instance installed on cluster.")
                    else:
                        print(
                            "There's not a container instance installed on cluster. Repeating..."
                        )
                        time.sleep(20)
        except Exception:
            traceback.print_exc()
            raise Exception("Internal error")

    Stop Cluster (drain EC2, delete EC2, await EC2 be deleted, drop cluster):

    import pprint
    import traceback
    import time
    import boto3
    
    def on_callback_stop_ecs_cluster_container_instance(kwargs):
        response = None
        region_name = ECS_ARGS.get("region_name")
        cluster_name = kwargs["dag_run"].conf.get("cluster_name")
        ecs_client = boto3.client("ecs", region_name=region_name)
        ec2_client = boto3.client("ec2", region_name=region_name)
        ec2_resource = boto3.resource("ec2", region_name=region_name)
    
        try:
            response = ecs_client.list_container_instances(cluster=cluster_name)
        except:
            print(f"Cluster {cluster_name} not found. Skipping delete cluster.")
    
        if response and response["containerInstanceArns"]:
            container_instance_resp = ecs_client.describe_container_instances(
                cluster=cluster_name, containerInstances=response["containerInstanceArns"]
            )
            for ec2_instance in container_instance_resp["containerInstances"]:
                ec2_client.terminate_instances(
                    DryRun=False,
                    InstanceIds=[
                        ec2_instance["ec2InstanceId"],
                    ],
                )
    
                instance_id = ec2_instance["ec2InstanceId"]
                instance = ec2_resource.Instance(instance_id)
    
                pprint.pprint(
                    f"Waiting instance {instance_id} be terminated on {region_name}..."
                )
    
                instance.wait_until_terminated()
    
                pprint.pprint(f"Instance {instance_id} was terminated on {region_name}")
    
            ecs_client.delete_cluster(cluster=cluster_name)
    
            pprint.pprint(f"Cluster {cluster_name} deleted with success on {region_name}")
  16. sanderv32 commented on Aug 8, 2022

    @sanderv32

    When can we expect the increase of vCPU's? 4 vCPU's is not enough for a workload we are running.

  17. yogendratamang48 commented on Aug 12, 2022

    @yogendratamang48

    Our testing and staging setups are running on FARGATE but the production needs higher limits. We added EC2 on prod but this is something we wanted to avoid. I hope AWS announces by this month.

  18. neer0089 commented on Aug 31, 2022

    @neer0089

    Hitting the vCPU limit doing some video transcoding tasks every now and then. Badly need the vCPU increase.

  19. innix commented on Sep 10, 2022

    @innix

    Seems like the delay is because they first need to migrate the old Fargate quota system to the new vCPU-based quota system:
    https://aws.amazon.com/blogs/containers/migrating-fargate-service-quotas-to-vcpu-based-quotas/

    The article explains good reasons for this:

    Over the past five years, quotas have been based on the total number of concurrent Amazon ECS tasks and Amazon EKS pods running at a given time. However, Fargate offers various task and pod sizes, from 0.25 vCPU per task/pod up to four vCPUs per task/pod. Additionally, many customers have asked for even larger task sizes for Fargate on our public roadmap. A quota that enforces an absolute task and pod count of 1,000 tasks and pods no longer makes sense given the wide range of task and pod sizes. If you are launching the 0.25 vCPU task size, then the task count limit of 1,000 tasks only allows you to launch 250 vCPUs. Meanwhile, someone launching 4 vCPU tasks can launch up to 4,000 vCPUs. So, the real amount of computing power available to you varies widely based on how you choose to size your tasks and pods.


    If I'm right, then I would guess that the higher vCPU's feature will be rolled out in either October or November, based on the transitional rollout dates for the new quota system (dates available in the linked blog post).

    Hopefully someone from AWS can give us an official update since we haven't had one since the start of July. @omieomye , do you have any new information you can share?

  20. ziXet commented on Sep 12, 2022

    @ziXet

    Seems like the delay is because they first need to migrate the old Fargate quota system to the new vCPU-based quota system: https://aws.amazon.com/blogs/containers/migrating-fargate-service-quotas-to-vcpu-based-quotas/

    The article explains good reasons for this:

    Over the past five years, quotas have been based on the total number of concurrent Amazon ECS tasks and Amazon EKS pods running at a given time. However, Fargate offers various task and pod sizes, from 0.25 vCPU per task/pod up to four vCPUs per task/pod. Additionally, many customers have asked for even larger task sizes for Fargate on our public roadmap. A quota that enforces an absolute task and pod count of 1,000 tasks and pods no longer makes sense given the wide range of task and pod sizes. If you are launching the 0.25 vCPU task size, then the task count limit of 1,000 tasks only allows you to launch 250 vCPUs. Meanwhile, someone launching 4 vCPU tasks can launch up to 4,000 vCPUs. So, the real amount of computing power available to you varies widely based on how you choose to size your tasks and pods.

    If I'm right, then I would guess that the higher vCPU's feature will be rolled out in either October or November, based on the transitional rollout dates for the new quota system (dates available in the linked blog post).

    Hopefully someone from AWS can give us an official update since we haven't had one since the start of July. @omieomye , do you have any new information you can share?

    Yeah. this is promising...

  21. LachlanMarnham commented on Sep 13, 2022

    @LachlanMarnham

    Following.

  22. nsht commented on Sep 15, 2022

    @nsht

    I now have an option to use up to 16vCPUs on Fargate, I can see this option in us-west-1 but west-2 only has a max of 4.

    image

  23. mreferre commented on Sep 15, 2022

    @mreferre

    The team (that has been working hard on this) appreciates the enthusiasm in this thread. Hang in there.

  24. omieomye commented on Sep 15, 2022

    @omieomye

    As many will notice, we've begun rolling out higher resource configurations (more vCPU and memory) options. We'll make a formal announcement soon. Ensure that you first opt-in your accounts to vCPU-based quotas, which we announced last week (post, FAQs) before using 8 and 16 vCPU tasks on Fargate.

    Opt'ing in to vCPU-based quotas for an ECS customer is simple, we recommend you use the ECS PutAccountSettingDefault API call. For EKS customers, or if you don't want to use the API to use vCPU-based quotas, file a request in the AWS Support Center console.

    Echo'ing what @mreferre said, thanks for the patience!

  25. gabrielkoo commented on Sep 15, 2022

    @gabrielkoo

    It’s facinating!!!

    02A6BED9-25A2-43CF-B05E-22865936F0F9

  26. shandrew commented on Sep 15, 2022

    @shandrew

    Thanks, that's all working well for me. Congrats on the launch.

  27. omieomye commented on Sep 16, 2022

    @omieomye

    Announcement. Thanks for the engagement, all!

    Please note that to use this, first opt-in your accounts to vCPU-based quotas. ECS Fargate customers can easily opt-in to vCPU-based quotas using the PutAccountSettingDefault API, before their accounts run larger tasks. EKS Fargate customers can cut us a ticket.

    Closing.

  28. epinzur commented on Oct 1, 2022

    @epinzur

    Has anyone been successful in opting-in to vCPU-based quotes on EKS? I created a customer support ticket for this on AWS, and they had no idea how to do it.

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

Metadata

Metadata

Assignees

Labels

FargateAWS FargateProposedCommunity submitted issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions