Spot diversification and commitment coverage for batch and API
A media-processing platform runs 100,000 vCPU-hours of batch transcoding each month plus a 24×7 API. Spot instances cost $0.012/vCPU-hour; on-demand costs $0.042. Last month 65% of batch hours ran on spot, while 35% fell back to on-demand after capacity shortages. Interruptions forced 12% of spot work to be re-run from the beginning because the pipeline has no checkpointing. The API runs on 18,000 vCPU-hours of on-demand because the team fears eviction. A one-year compute savings plan covers 40% of current on-demand usage and expires in four months. Finance asks whether to move the API to spot and whether to increase the batch spot share to 90%.
1. Calculate the current blended batch cost, the cost at 90% spot with 3% rework, and the break-even rework rate versus on-demand.
Read the worked answer
All-on-demand batch: 100,000 × $0.042 = $4,200/month.
Current blend: spot 65,000 × $0.012 = $780; rework 12% × 65,000 = 7,800 hours × $0.012 = $93.60; on-demand fallback 35,000 × $0.042 = $1,470. Total = $2,343.60, or 44.2% below all-on-demand.
At 90% spot with 3% rework: spot 90,000 × $0.012 = $1,080; rework 2,700 × $0.012 = $32.40; on-demand 10,000 × $0.042 = $420. Total = $1,532.40, or 63.5% below all-on-demand and $811.20/month better than today.
Break-even rework: spot is cheaper per completed unit while $0.012 × (1 + r) < $0.042, so r < 2.5, or 250%. Even 100% rework leaves spot cheaper on raw compute. The real constraint is deadline and completion time, not unit price. That means the decision should be driven by queue latency and SLA, not by the 12% rework figure alone. Checkpointing every few minutes reduces rework and protects deadlines, but do not justify spot only on the rework percentage.
2. Should the API move to spot? Recommend a target mix and the controls needed for both workloads.
Read the worked answer
Do not move the API fully to spot. Its on-demand cost is 18,000 × $0.042 = $756/month; all-spot would be $216, saving $540, but a single eviction wave can breach the API SLO. The saving is also small compared with batch, so sequence batch first.
A defensible API mix is 60% on-demand baseline and 40% spot for stateless workers, spread across at least three availability zones. That costs 10,800 × $0.042 = $453.60 plus 7,200 × $0.012 = $86.40, total $540, a $216/month saving with the baseline protected. Keep session state external, set pod disruption budgets, and give the API a two-minute graceful drain.
For batch, raise spot to 90% only after adding checkpointing, multiple instance families and zones, capacity-optimized allocation, and queue-based retries. Separate node pools with taints so batch cannot consume API capacity. Track interruption rate and queue delay by pool. If rework or delay rises, step back to 80% rather than accepting missed deadlines.
3. The savings plan expires in four months. How should coverage be resized after the spot changes?
Read the worked answer
Current on-demand usage is 53,000 vCPU-hours: 35,000 batch fallback plus 18,000 API. The plan covers 40%, about 21,200 vCPU-hours. After the changes, on-demand becomes 10,000 batch plus 10,800 API, or 20,800 vCPU-hours. The existing coverage would then equal 102% of on-demand, so renewing at the same level risks stranded commitment. If the API moved fully to spot, on-demand would fall to 10,000 and coverage would be 212%.
Right-size the plan to 70–80% of the forecast on-demand floor, not to current usage. At 75% of 20,800, the target is about 15,600 vCPU-hours of coverage. Buy in tranches: a one-year base tranche for the API floor, and a smaller tranche after two months of observed batch fallback. Do not use savings plans for spot capacity; they do not apply to it. Monitor commitment utilization monthly, and set an alert if on-demand falls below the committed level. The plan is a discount instrument, not a hedge against an architectural migration.