Skip to content

EC2 cold boot benchmarking research - measuring and optimizing instance launch times

Notifications You must be signed in to change notification settings

brevdev/ec2-coldboot-research

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentation

Bash spike to measure EC2 deployment speed. Goal: learn where time goes, apply to brownfield backend.

Key Findings

The ~16s Pending→Running phase is fixed AWS infrastructure overhead. It cannot be reduced by:

  • Instance type selection (680ms variance across t3→r7i)
  • Region selection (2.1s variance, mostly network latency)
  • Stripping cloud-init (made it slower!)
  • Hibernate vs stop/start (only 0.5s difference)

The only way to achieve <10s startup is warm pools with running instances.

Results Summary

Technique Time vs Baseline
Cold launch 25.8s baseline
Stop/start 21.2s -18%
Hibernate 20.7s -20%
Minimal AMI 28.8s +12% (slower!)
Warm pool (EIC) 3.9s -85%
Warm pool (SSH) 1.9s -92%

Detailed Results

Quick Start

# 1. Setup AWS resources
./scripts/setup-security-group.sh
./scripts/setup-keypair.sh

# 2. Run baseline benchmark
./bench/cold.sh ~/.ssh/instant-env-admin.pem

# 3. Run warm pool benchmark (production approach)
./bench/warm-pool-eic.sh

# 4. Cleanup when done
./scripts/cleanup-all.sh

Timing Phases

T0  Script starts
 │
 ├─ aws ec2 run-instances
 │
T1  Instance ID returned (~5s)
 │
 ├─ aws ec2 wait instance-running
 │
T2  State = "running" (~18s) ← THE BOTTLENECK
 │
 ├─ nc -z (TCP probe)
 │
T3  TCP port 22 open
 │
 ├─ ssh (auth handshake)
 │
T4  SSH auth success (~3s)

Cold Total = ~26s
Warm Pool = ~4s (skips T0→T2)

Recommendation

For production: Use EC2 Instance Connect with warm pools

  • 3.9s access time (85% faster than cold)
  • No pre-existing SSH access needed
  • Ephemeral keys (60s validity)
  • IAM-integrated, auditable

About

EC2 cold boot benchmarking research - measuring and optimizing instance launch times

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages