amazon-web-servicesclouddevopsamazon-ecsaws-fargate

ECS Fargate Issues


I have a fargate task with 8vCPU and 16gb memory. This fargate task currently runs a dockerfile on ECR which is about 7gb. It runs successfully. However, when I do a performance test on JMeter, the fargate task does not scale pass 10 threads. I assume the reason for this is because after a particular number of threads, the cpu utilization gets very high(about 87%) and then it begins to fail health check. Currently my ECS is behind a load balancer and I configured service autoscaling. However, as the traffic increases, the CPU utilization goes from about 30% to 80% in about 10 seconds, leaving the ECS tasks unhealthy before the autoscaling starts which takes about 2-3 mins.

What is the best way to scale this workload and make it handle a lot of concurrent requests.


Solution

  • What is the best way to scale this workload and make it handle a lot of concurrent requests.

    Place your ECS service behind a load balancer, and configure application auto-scaling which will spin up more instances of your ECS task as needed.