Autoscaling Controller  ·  View 23 of 37  ·  4 · Runtime

Scale-In

How removal is made safe, and the instance that is allowed to say no.

Editable source SVG draw.io All views
Decision Engine Desired State Reconciler Drain Coordinator Instance Load Balancer Journal 1. 6 intervals under band 2. desired 72 -> 66 3. delta capped at -10% 4. select 6 by lease state 5. may I stop? 6. lease held: refuse 7. deregister the rest 8. stop new work 9. wait to 120 s deadline 10. terminate 11. refusals + drains Scale-In — A Request the Workload May Refuse An instance holding a work lease refuses removal, and the reconciler re-derives the delta next interval rather than forcing it. Removing an instance still doing work is the failure this design exists to survive. v 1.0 · owner Data & AI Global Practice · date 2026-09

The decision

  • Scale-in is a request the workload may refuse, not an instruction. An instance holding a work lease refuses and stays.
  • Selection is by lease state first, connection count second — never by instance age or by whatever the provider picks.
  • Drain: stop new work, deregister, wait to the 120 s deadline, then terminate. The deadline is per target because the longest legitimate unit of work is per target.

Why a lease and not a timer alone

  • A timer is right for interruptible, idempotent, retryable work and wrong for a 20 minute batch item that has no checkpoint.
  • A lease lets the workload declare that fact at the moment it matters, and costs the controller one refused removal per interval when it does.

Risks

  • A workload that never releases its lease silently pins capacity. Lease age is a monitored signal, and a target whose refusals persist beyond the cooldown is alerted, not forced.