Journal
Work
13 Feb 2026#aws#benchmarking#bash 1 min read

One launch script for every generation

Replacing a per-instance script matrix with detection at boot.


The first fleet had a script per instance type. It worked until the matrix had to change, and then every change was a dozen edits. The replacement is one script that decides at boot: swap sized from the memory it finds, CPU generation detected from the processor, compiler flags chosen per generation.

flowchart LR
  B[Boot] --> M[Read memory: size swap]
  B --> C[Read CPU: detect generation]
  C --> F[Pick compiler flags]
  M --> R[Run benchmark]
  F --> R

Detection got it wrong the first time, on a flag the smoke test caught.

The trade

One code path is easier to fix than twelve, and harder to get right the first time.

Client engagement, 2021 to 2026. Names, identifiers and internals are generalised.

Related