Fargate Spot Capacity rack – DEV Community

Fargate Spot Capacity rack – DEV Community


As AWS Community Builder 2025 ( Container category ) First post.

I am using Fargate ondemand and Fargate Spot together, but
it seems that the resources are running low, and the frequency of Spot interruptions has increased compared to three months ago. I am using it in the Tokyo region.

service xxxx was unable to place a task. Reason: Capacity is unavailable at this time. Please try again later or in a different availability zone.



Fargate Spot

You can give yourself more time after the SIGKILL event. The default time you have to wait before replacing a spot is 30 seconds, so you can change it to 120 seconds.
Can be set using the stopTimeout in the task definition

From Sep 6, 2204 Fargate Spot can use in ARM architecture.

Amazon ECS now supports AWS Graviton-based Spot compute with AWS Fargate



ECS Capacity Provider

Base
Do not specify the minimum number of tasks for the specified capacity provider. Default: 0
It seems better not to specify this in Spot. Do not specify the minimum number of tasks for the specified capacity provider. Default: 0

Weight
Set the startup ratio for Capacity Provider



Setting

Image description



ECS Trouble Shooting



Checking the occurrence status of FargateSpot

If the following event occurs in EventBridge, it is output to Cloudwatch Logs.

source aws.ecs
detail-type ECS Task State Change
stopCode SpotInterruption
Enter fullscreen mode

Exit fullscreen mode

Amazon ECS task state change events

Use the Metrics filter to set the number of occurrences to a custom metric.

You can check this on the console, but if the task stops, you won’t be able to check it.
Recently, the reason why a task has stopped has started to be displayed in detail, but it disappears, so we recommend that you keep it in Cloudwatch Logs.

Linkedln and check out my blog for all my blog posts. Blog content is almost in Japanese.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *