Can a small SaaS use Spot instances safely?
By the Keel team · Last checked · 5 min read
Short answer
Yes, for the right workloads. Spot capacity runs on spare AWS compute at a discount, but AWS can reclaim it with a two-minute warning, so it suits queue workers, batch jobs, CI runners and non-production environments. It is a poor fit for anything that must always have at least one copy running, unless you keep an on-demand or standard Fargate base alongside it.
What is Spot capacity, and what is the catch?
Spot capacity is spare AWS compute sold at a discount, with the catch that AWS can take it back.
AWS describes Spot Instances as suited to stateless, fault-tolerant or flexible applications, and says EC2 can interrupt one when it needs the capacity back, or for reasons such as host maintenance or hardware decommission.
The warning is short. A Spot Instance interruption notice is issued two minutes before EC2 stops or terminates the instance, through an EventBridge event and through instance metadata, and AWS says notices are emitted on a best effort basis. Fargate Spot gives the same two-minute warning to a task. So the question is never whether an interruption will happen, only whether your workload shrugs it off.
Which workloads suit Spot, and which do not?
Workloads that can stop at any moment and pick up where they left off suit Spot, and workloads that cannot are better left on standard capacity.
AWS lists containers, CI/CD pipelines, test and development environments, big data and web servers among the examples, provided the application tolerates interruption.
| Workload | Spot? | Why |
|---|---|---|
| Queue and background job workers | Good fit | Jobs retry, and another worker picks up the message |
| CI runners and build agents | Good fit | A failed build is re-run |
| Staging and preview environments | Good fit | No customers are affected |
| Batch and data jobs | Good fit if they checkpoint | Work resumes instead of restarting |
| Web or API tasks | Only a share, with a standard base | Some capacity must always stay up |
| A single production task | Poor fit | AWS notes a service with one task is interrupted until capacity is available |
| Databases | Poor fit | State and long recovery times |
How do you run Spot safely on ECS?
Use capacity providers to keep a base of standard Fargate tasks and let extra tasks run on Fargate Spot.
In a capacity provider strategy only one provider can have a base value, the default base is zero, and at least one provider needs a weight above zero.
A strategy with a base of two on standard Fargate and a heavier weight on Spot sends the first two tasks to reliable capacity and most of the rest to Spot. The cluster needs both providers associated first:
aws ecs put-cluster-capacity-providers \
--cluster app \
--capacity-providers FARGATE FARGATE_SPOT \
--default-capacity-provider-strategy capacityProvider=FARGATE,weight=1
aws ecs create-service \
--cluster app \
--service-name worker \
--task-definition worker:1 \
--desired-count 6 \
--capacity-provider-strategy capacityProvider=FARGATE,base=2,weight=1 capacityProvider=FARGATE_SPOT,weight=3 \
--network-configuration "awsvpcConfiguration={subnets=[subnet-aaa],securityGroups=[sg-aaa]}"Illustrative only: with six desired tasks, two land on standard Fargate as the base, and the remaining four split one to three by weight between standard and Spot. If every Spot task were reclaimed at once, two tasks would still be running. For a web service, pair this with the rollout controls in ECS CI/CD for a small team.
How do you make an interruption harmless?
Handle the shutdown signal, make jobs safe to repeat and never depend on one task finishing.
On Fargate Spot the two-minute warning arrives as a task state change event in Amazon EventBridge and as a SIGTERM signal to the running task.
AWS warns that failing to process SIGTERM means the task receives SIGKILL after the configured stopTimeout, which may cause data loss or corruption. The default stopTimeout is 30 seconds and you can raise it to 120 seconds or less.
- Catch SIGTERM in the container, stop taking new work and finish or hand back what is in flight.
- Make jobs idempotent, so a retry after an interruption cannot double-charge or double-send.
- Set
stopTimeouthigh enough to finish a unit of work, up to 120 seconds. - On EC2, check the instance metadata
instance-actionitem, which AWS recommends doing every 5 seconds; it returns HTTP 404 until a notice is issued. - Alert if tasks cannot be placed on Spot for a long period, and let the standard base keep serving.
How do Spot, Savings Plans and on-demand compare?
On-demand costs the most and carries no commitment, Savings Plans reduce the price for a committed spend, and Spot is cheapest but interruptible.
AWS says Spot can save up to 90% against On-Demand rates, and says Fargate Spot is up to 70% off regular Fargate pricing; both are ceilings, and prices change with supply and demand.
| On-demand | Savings Plans | Spot | |
|---|---|---|---|
| Price | Standard rate | Reduced for a commitment | Deepest discount, varies |
| Can AWS reclaim it? | No | No | Yes, with a two-minute notice |
| Commitment | None | One or three years | None |
| Best for | New or spiky workloads | Steady baseline | Interruptible work |
Many teams combine them: a Savings Plan for the steady baseline, standard capacity for critical work, and Spot for the rest. Savings Plans or Reserved Instances covers the commitment side.
How do you test interruptions before relying on Spot?
Rehearse an interruption on purpose in staging before any production task runs on Spot.
Send your worker container the same SIGTERM it would receive, for example with docker stop, and check that it stops taking work and hands back what it holds.
Then stop a Spot task by hand in a staging service. On Fargate the stop reason for a real interruption is "Your Spot Task was interrupted" with stop code SpotInterruption, so you can search your logs and events for it later. If jobs are lost or run twice, fix that before moving anything else to Spot.
How much can a small SaaS save with Spot?
The saving depends on how much of your compute is interruptible, and AWS only publishes ceilings, not guarantees.
Move the share that can safely stop, such as queue workers, CI and staging, and leave everything else alone.
Illustrative only: if interruptible workers cost £400 a month on standard Fargate and Spot were 50% cheaper, the monthly saving would be £200. Your real figure depends on current Spot prices in your Region, which AWS adjusts with supply and demand. Check the Fargate pricing page before committing, and see how to reduce AWS costs at a small startup for the larger levers, including NAT gateway cost.
Is a workload ready for Spot?
Tick each item that is true for the workload you are considering.
- It can stop at any moment without losing customer data.
- Jobs are safe to repeat, so a retry cannot double-charge or double-send.
- The container handles SIGTERM and finishes or hands back work.
- A standard base of tasks keeps the service up if Spot is reclaimed.
- You have stopped a Spot task in staging and watched it recover.
- You will be alerted if Spot capacity cannot be found for a long time.
Decision point: Five or six ticks: it is ready for Spot. Three or fewer: keep it on standard capacity until interruptions are harmless.
Sources
- AWS docs, Spot Instance interruption notices (checked November 2026)
- AWS, Amazon EC2 Spot Instances (checked November 2026)
- AWS docs, Amazon ECS capacity providers for the Fargate launch type (checked November 2026)
- AWS, AWS Fargate pricing (checked November 2026)
- AWS docs, Spot Instance interruptions (checked November 2026)
Keep reading
Keel is an AWS release and recovery operations service for SaaS teams of 3 to 15 developers, provided by Bargainn Services Ltd, a UK company registered at Companies House (16497746). Registered office: 3rd Floor, 86-90 Paul Street, London, EC2A 4NE, United Kingdom.