Running your AWS Batch on Spot Instances -

Running your AWS Batch on Spot Instances

Reading Time: 3 minutes

AWS Batch was introduced last December and has quickly become one of the most adopted ways to run batch computing on the cloud. By letting you run batch jobs with no batch software installation, it makes running batches in the cloud the quickest way to start running batches. It’s strong job scheduling and queuing capabilities, combined with its capability for handling complex interdependencies also make it the easiest way to run them.

To take it one step further, AWS Batch also offers managed compute environments, taking care of all of the provisioning and scheduling work for you. Even letting you run on Spot to save money. And with the recently announced per-second billing, they save you even more by shutting your resources down the moment they’re idle.

AWS Btach

Basically, AWS Batch is amazing. But as great as it is, many want more control over their compute environment, choosing to run unmanaged compute environments instead. Moreover, while AWS Batch’s managed compute environment can run on Spot, this capability is pretty limited.

And that’s where Elastigroups can help – by ensuring your compute environment is as cost-efficient as possible.

Running AWS Batches for Minimum Cost and Maximum Flexibility

Running AWS Batches with Elastigroup is the best way to take control over your Batch cost while minimizing interruptions. Managed AWS Batches run on Spot are already cost efficient, but they can be even more cost-efficient when Elastigroup takes the lead. Instead of running an AWS-managed compute environment, let Elastigroup take the lead to ensure your Batches proactively run on Spot.

Running your AWS Batch on Elastigroup gives you the flexibility to run your Batches in the way you best see fit. If you’re looking to minimize interruptions and get quicker results on your Batch job (also minimizing cost), Elastigroup’s Spot predictions will ensure you’re not only on the cheapest Spot but also find you the Spot Instance that won’t rise in price, increasing both cost savings and speed.

And if you’re just looking to save as much as possible, Elastigroup empowers you with the flexibility to pause your batch whenever Spot Instances are too expensive, automatically restarting the Batch once the Spot Market calms down again.

Elastigroup ECS

How to run your AWS Batch on Spot today

Once you create an AWS Batch with unmanaged_compute_environment, there is an ECS cluster created behind the scenes by AWS. Elastigroup takes full ownership over this cluster, then starts working its magic to proactively utilize Spot Instances whenever you run a new batch job. Practically, you just need to do the following:

  1. Run a batch job on AWS Batch
  2. Select “unmanaged compute environment”. This will create an ECS cluster behind the scenes.
  3. Locate the ECS cluster that was created by AWS Batch
  4. Now head over to the Spotinst console and create an Elastigroup
  5. Connect the Elastigroup to the ECS

ECS Integration

If you want your Batches only to run on Spot (absolute lowest cost but could delay job completion), be sure to unselect “fallback to On-Demand”. If you’re looking to emphasize speed, keep that selected. Now your Batch will run at the lowest cost and longest lasting Spot Instances (when available), ensuring the speediest results possible.