SysPadLessons › compute lessons › AWS Batch

How AWS Batch works

Managed batch job scheduler. Jobs queue and run on an auto-scaling compute environment up to a vCPU ceiling. Throughput depends on per-job vCPU, the vCPU cap, and job duration.

Some work isn’t a request to answer in milliseconds, it’s a mountain of jobs to grind through: render 10,000 frames, process a genomics batch, run a nightly analytics sweep. AWS Batch is the manager for that: you throw jobs at a queue, and it spins up exactly enough compute to chew through them, then spins it back down to zero.

What you will learn

What "batch" means

Batch workloads are large numbers of non-interactive jobs: each runs to completion (seconds to hours), no user waiting on a live response. Think simulations, media transcoding, ETL, scientific computing.

Lambda’s 15-minute limit and a single web server’s fixed size both fight this; Batch is built for it.

Job queues and compute environments

You submit jobs (a container image plus CPU/memory needs, and optional dependencies between jobs) into a job queue. A compute environment attached to the queue provisions the actual compute, EC2 or Fargate, and Batch places jobs onto it.

You declare what to run and the resources it needs; Batch decides where and when, packing jobs onto instances efficiently.

Scale to the work, then to zero

Batch sizes compute to the queue: lots of jobs, lots of instances; empty queue, it scales down, potentially to zero. You aren’t paying for idle capacity between runs.

Genomics, rendering/VFX, financial risk runs, large ETL and ML preprocessing.

Why Spot fits batch perfectly

A compute environment can use Spot capacity for big savings. Batch jobs are usually retryable and interruptible, so if AWS reclaims a Spot instance, Batch just reruns the affected jobs elsewhere.

Flashcards

What makes a workload a good fit for AWS Batch?
Lots of non-interactive jobs that run to completion (no live user waiting), simulations, transcoding, ETL, scientific computing.
Job queue vs compute environment in Batch?
Jobs wait in the job queue; the compute environment provisions EC2/Fargate capacity to run them and scales it with the queue.
What happens to Batch compute when the queue is empty?
It scales down, potentially to zero, so you don’t pay for idle capacity between runs (trade: cold spin-up when work returns).
Why is Spot a natural fit for Batch?
Batch jobs are typically retryable/interruptible; if Spot capacity is reclaimed, Batch reruns those jobs, so you get big savings safely.
Why not just use Lambda for these jobs?
Lambda caps at 15 minutes and is sized for short events. Batch handles long-running, resource-heavy jobs at large scale.

Sources

Open the SysPad canvas · Official AWS Batch documentation

Other compute lessons