azavea / pfb-network-connectivity

PFB Bicycle Network Connectivity
Other
39 stars 10 forks source link

Implement autoscaling for the Batch ECS cluster #151

Open CloudNiner opened 7 years ago

CloudNiner commented 7 years ago

Should probably scale on available vCPUs in the cluster. This allows us to limit each instance to only taking 1-2 jobs.

KlaasH commented 3 years ago

In PR #137, we switched to an unmanaged compute environment for the analysis Batch workers because

Our analysis jobs require large amounts of scratch space for the postgresql data dir. This required switching to unmanaged CE's so that we can mount the ephemeral storage space provided by the i3 EC2 instance class.

This was in March 2017. In November 2017, AWS added Launch Templates for EC2 instances.

That seems like it could make it possible for us to do the configuration we need within a managed compute environment. Which would be the ideal route to adding auto-scaling.

Note, though, that in PR #162 we had to add manual commands to deployment/terraform/cloud-config/ecs-batch-user-data.yml because the scatch space wasn't getting mounted properly.

So with all of that said, I think the first task toward setting up autoscaling for our Batch cluster is to figure out if it would work to switch to a managed compute environment.