← All cloud projects
CASE STUDY us-east-1 2026
CLOUD PROJECT · 2026

What a deploy actually costs in dropped requests

Blue/green and rolling deployments on one fleet, with a request loop running throughout. Both planned changes lost nothing. An abrupt instance termination lost 4% — and the difference is entirely deregistration. Also: 'instant rollback' isn't instant, and a rolling deploy serves two versions at once by definition.

Auto ScalingLaunch TemplatesInstance RefreshALBTerraform

Built, measured and torn down on 5 August 2026 in us-east-1. Total cost $0.20. The infrastructure no longer exists — the code and the raw samples behind every number are in the repo.

The setup

Two Auto Scaling Groups behind one load balancer, each on its own launch template version and target group. Traffic moves by changing a single listener action. Then the live environment gets upgraded in place with an Instance Refresh.

Each instance serves a plain-text endpoint naming its environment, version and instance ID, which is what makes any of this measurable from a shell loop rather than a guess.

OperatorRequest looplogs every replyTerraformactive_environmentAWS CLIscriptsus-east-1ALBone listenerBlue ASG · target groupEC2blueEC2blueGreen ASG · target groupEC2greenEC2greenswitch listenerHTTPforwardafter switchinstance refreshterminate-instances

Request path: request loop → ALB listener → blue or green target group. Deploy paths: Terraform switches the listener; an instance refresh rolls the live group in place. Failure path: an out-of-band terminate-instances.

requestdeploy / controlfailure / failover Hover, tap or Tab to a component to see what it does and why. Swipe sideways for the whole diagram.

Three scenarios, one fleet

Blue → green cutover. 62 requests, all 200:

Blue-green cutover62 requests across a listener swap, all HTTP 200. Zero requests lost.switch issued
Zero requests lost. The dashed line is the moment the switch was issued.

Rolling instance refresh. 43 requests across a 430-second roll, all 200:

Rolling instance refresh43 requests across a 430-second instance refresh, all HTTP 200. Both v1.0 and v1.1 served during the roll.
Zero lost — but both v1.0 and v1.1 answered during the roll.

Abrupt termination. An in-service instance killed out of band, 638 requests at ~5/s:

Abrupt termination638 requests while an in-service instance was terminated out of band. 26 failed — 19 HTTP 502 and 7 connection failures.terminatedfirst 502recovered
26 failed — 19 HTTP 502 and 7 connection failures. First failure 16 samples after the kill.

The finding

Only the unplanned change lost requests. 0%, 0%, then 4%.

The difference is deregistration. A planned change tells the load balancer to stop using a target and lets in-flight connections finish — that’s deregistration_delay, one line of configuration. An out-of-band terminate-instances gives it no warning, so the balancer keeps routing to a dead host until its own health checks fail. Two checks at a 10-second interval matches the observed 16-sample gap before the first 502.

This is the argument for connection draining and lifecycle hooks, and it’s the one result here that a diagram wouldn’t have told you.

Two things that surprised me

“Instant rollback” is instant to issue, not to take effect. The cutover lost nothing, but 44 requests were still served by the old environment after the switch was issued — a listener change propagates over roughly 40 seconds. If you’re rolling back because production is broken, users keep hitting the broken version for another half-minute. That’s a number worth knowing before you promise one in an incident review.

A rolling deploy serves mixed versions by definition. Both v1.0 and v1.1 answered during the seven-minute roll. That isn’t a defect — it’s what rolling is, and it’s the constraint blue/green doesn’t have. If a release changes an API contract or a session format, consecutive versions have to be compatible or you can’t roll at all. Blue/green has no such requirement, and that’s what the double capacity buys you.

Also worth knowing: pointing an ASG at a new launch template version changes nothing until a refresh runs. The template is desired state, not running state.

The same thing as code

The stack is also written as Terraform, where the interesting part is what happens to the cutover. In the shell version it’s an imperative call. In Terraform it’s one variable:

terraform apply -var active_environment=green

var.active_environment is read by exactly one resource — the listener. Both launch templates, both target groups, both ASGs and the load balancer are identical either way. The switch becomes a one-resource in-place update and the rollback is the same command with the other value.

Blue/green stops being a procedure you have to execute correctly and becomes something the configuration guarantees.