Sub topic 2
Choosing an Instance Family and Size
Assume you know basic EC2, CloudWatch, AWS CLI, Linux, and Docker concepts. Choose an instance from measured workload behavior, not from the current instance type alone.
Choosing an instance family and size
An instance family groups hardware for a workload profile. A size controls the amount of CPU, memory, network bandwidth, and sometimes local storage.
| Workload signal | Family direction |
|---|---|
| Balanced CPU and memory use | General purpose, such as `m7g` or `m7i` |
| CPU is the main limit | Compute optimized, such as `c7g` or `c7i` |
| Memory is the main limit | Memory optimized, such as `r7g` or `r7i` |
| High local storage or storage throughput | Storage optimized, such as `i4g` |
Compare peak and sustained CPU, memory pressure, network throughput, disk I/O, latency, and application error rates. A smaller instance is suitable only when its resource headroom remains acceptable during normal peaks. Also check limits such as network performance, EBS bandwidth, and maximum connections.
What AWS Graviton is and when it fits
AWS Graviton is AWS-designed processor hardware based on the Arm64 instruction set. Graviton instances often provide useful price-performance for Linux services, container workloads, web applications, and many managed runtimes.
The important comparison is completed work per dollar, not hourly price alone. A workload may need fewer or cheaper instances on Graviton, but performance depends on its language runtime, libraries, and bottleneck.
Checking Arm64 compatibility
Arm64 compatibility can fail when software contains an x86-64 binary or a native dependency compiled for the wrong architecture. Review these layers:
- Confirm that the language runtime and every native package support Arm64.
- Replace hard-coded
amd64downloads with architecture-aware installation. - Use an Arm64-compatible operating system image and container base image.
- Build native extensions on Arm64 or use a reproducible multi-architecture build.
- Run functional tests, performance tests, and deployment checks on a real Arm64 environment.
For a quick host check:
uname -m
# x86_64 means x86-64; aarch64 means Arm64A container tag can support both architectures when published as a manifest:
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t 111122223333.dkr.ecr.us-east-1.amazonaws.com/my-app:1.0.0 \
--push .Exercise
A service has low CPU use but frequent memory pressure. Should you first choose a compute-optimized instance?
Show answer
No. Test a memory-optimized family and select a size with enough memory headroom. Then compare latency, errors, and cost under representative load.