At scale, "how long does a new instance take" directly affects the business experience. Waiting time usually comes from three parts: image transfer, system initialisation and application readiness. This note discusses the first two.
1. Image layering: store common parts once
If every instance carries a complete system image, storage and distribution cost grows linearly with instance count. A better approach splits the image into a base layer, a dependency layer and a writable layer:
- Base layer: system and common services, shared by all instances;
- Dependency layer: runtime libraries and configuration by business type;
- Writable layer: instance-specific data produced at runtime.
With layering, creating an instance only mounts common layers and initialises the writable layer, significantly reducing transmitted data.
2. Runtime initialisation: from serial to parallel
Many initialisation steps do not depend on predecessors. Running them earlier or in parallel shortens time to first usable frame. The key condition is that failures remain rollbackable: fast but uncertain is not acceptable.
Optimisation requires observability. Without stage-level timing data, any "optimisation" is a guess.
3. Warm capacity: predictable cost for speed
For latency-sensitive business, maintain a small warm pool of pre-created instances that are bound on request. Pool size must balance peak demand against cost.
4. Boundaries
These are engineering notes, not performance commitments. Benefits vary by hardware platform, system version and workload, and must be measured.