<@ULVA73B9P> With an ECS cluster and a push worker...
# ask-marvin
t
@Marvin With an ECS cluster and a push worker pool, does the cluster autoscale itself based on the ASG settings, or does prefect request new instances when starting new jobs?
m
From the gathered information, here's how autoscaling works with ECS clusters and Prefect's push worker pools: 1. Prefect ECS Push Work Pools: These only support AWS Fargate, which is a serverless compute engine for containers. It simplifies the launch of containers without managing the underlying EC2 instances but does not directly handle autoscaling of an EC2-backed ECS cluster. The setup process emphasized focuses primarily on using Fargate due to its ease of use. Source 2. Autoscaling EC2 Instances: If GPU-based jobs are required, you must use EC2 instances because Fargate doesn't support GPU-based machines. This necessitates setting up an appropriate Auto Scaling Group (ASG) for EC2 instances. Prefect doesn't automatically request new instances; instead, it's crucial to configure the ASG to handle the autoscaling based on the workload. The desired capacity for the ASG should start at zero, and the ECS cluster should be configured with a capacity provider strategy (not a launch type) to manage the autoscaling. GitHub Issue Comment To summarize: - Prefect does not directly request new EC2 instances; autoscaling depends on the ASG configurations. - For GPU-based tasks, use a hybrid ECS pool with an ASG configured for EC2 instances. For further reading: - Prefect AWS ECS Guide: https://docs.prefect.io/latest/integrations/prefect-aws/ecs_guide/ - Work Pools in Prefect: https://docs.prefect.io/latest/concepts/work-pools/ Feel free to ask if you have more questions!