Double vCPU units to the number configured are used in EKS Fargate

0

Hi We are running 500 instances in EKS Fargate profile. Here is the k8s configuration as per https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html resources: limits: cpu: '2' memory: 16Gi requests: cpu: '2' memory: 16Gi Expectation: 1000 vCPUs should be used

Actual: Cloudwatch shows 2000 vCPUs getting consumed.

Cost is double than than estimated amount.

Any help is much appreciated.

Thanks

1개 답변
2

WS Fargate allocates CPU resources in terms of AWS vCPU units. For each vCPU, Fargate provides 1024 CPU units. The CPU value you specify in your pod configuration is converted to an equivalent number of vCPU units.

In your configuration, you've specified '2' for the CPU limit and request, which means you're requesting 2 vCPUs for each pod. If you're running 500 such instances, you would indeed expect a total of 1000 vCPUs to be used.

However, EKS on Fargate has a different method for vCPU calculation. As per the official AWS documentation, the actual number of vCPUs available for your application to use is 1/2 of what is specified in the CPU value. The remaining half is reserved for system-level processes.

This could be the reason why CloudWatch shows 2000 vCPUs getting consumed. Your application is using 1000 vCPUs (2 vCPUs for each of the 500 instances), and the same amount is being used by system-level processes, leading to a total of 2000 vCPUs.

Unfortunately, there is not much you can do about this since it's a feature of how EKS on Fargate works. If the cost is higher than what you're willing to pay, you might need to consider other options like using EC2 instances for your EKS clusters or optimizing your application to use fewer resources.

profile picture
전문가
답변함 일 년 전
  • Thanks for your explanation. Can you please point me to the documentation that mentions about the system level processes that is accounted in the billing. Also will the memory also be doubled? In our case, we specified 16GB. Does it account for 32 GB ?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠