Skip to content

About AWS Fargate Reuested Configuration

0

I have a workload running in EKS Fargate with 2 vCPU & 4 GB memory and max at first provision is 6GB

But one time my workload peaked and used more than 6GB maybe 8GB.

What does AWS Fargate do? Does it stop the workload or scale more outside of the limit range of my specification.

1 Answer
0

In AWS Fargate, the behavior when a workload exceeds the allocated memory limit depends on the configured memory resource limits for the container. Here's what happens in your scenario:

Memory Usage Exceeds Configured Limits (e.g., 6GB):

  1. Container Memory Limit Configuration:
    • When you define a container in AWS Fargate, you specify its memory limits (memory or memoryReservation in the task definition).
  • memoryReservation is a soft limit, and memory is a hard limit
  • If the workload exceeds the memory limit, Fargate enforces these limits, leading to an Out Of Memory (OOM) error.

AWS Fargate 2 vCPU has a memory limit of up to 16GB. See the Fargate pricing details for more information: https://aws.amazon.com/fargate/pricing/

  1. Outcome When Limit is Exceeded:

    • The container is terminated by Fargate if it consumes more memory than its specified limit.
    • If your task is part of a service with auto-restart policies enabled (e.g., ECS Service with restartPolicy: always), Fargate will attempt to restart the task automatically.
  2. Scaling Behavior:

    • Fargate does not automatically scale memory or CPU resources beyond the configured task definition limits. You must manually adjust the task definition and redeploy or implement an external scaling mechanism
  3. Elasticity in EKS with Fargate:

    • Kubernetes itself does not dynamically increase the resource limits of a pod. In your case, if the workload's actual usage exceeded 6GB, the pod would likely be evicted (terminated) due to memory pressure, depending on how the resource requests and limits were configured in the Kubernetes pod spec.

Recommendations:

  • Adjust Resource Limits: If your workload can occasionally spike, adjust the requests and limits in the pod specification (or ECS task definition) to allocate more memory.
  • Horizontal Pod Autoscaler (HPA): Use Kubernetes HPA to scale the number of pods dynamically based on memory and CPU usage.
  • Monitor with CloudWatch: Use CloudWatch or Kubernetes monitoring tools to track resource usage and identify patterns to provision accordingly.
  • Graceful Degradation: Implement application-level logic to handle resource constraints gracefully, such as shedding load during high-memory usage scenarios.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.