INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: EC2: launch and operation

How to choose an EC2 instance type: CPU, memory and workload requirements

An EC2 instance type combines compute, memory, storage and networking capabilities. Filter for what the application can use, then test representative load; a name or hourly price is not enough. Learn a selection process: compatibility → resource requirements → sustained behavior → complete cost.

What you will learn

Build a shortlist and evaluation plan that accounts for architecture, CPU credits and I/O constraints.

Prerequisite

Know the roles of an EC2 instance, AMI and EBS. Example numbers are fictional requirements, not measured performance or a recommendation for a particular type.

Separate the requirements before choosing a name

Selection order: verify compatibility first, then evaluate representative load
Selection order: verify compatibility first, then evaluate representative load1: Compatibility — Start from compatible configurations. — Resources. 2: Resources — Include peaks and their duration, not just averages. — Sustained load. 3: Sustained load — Evaluate suitable candidates with the same workload. — Test and cost123CompatibilityResourcesSustained loadTest and costSelection order: verify compatibility first, then evaluate representative load1: Compatibility — Start from compatible configurations. — Resources. 2: Resources — Include peaks and their duration, not just averages. — Sustained load. 3: Sustained load — Evaluate suitable candidates with the same workload. — Test and cost123CompatibilityResourcesSustained loadTest and cost
  1. Compatibility → ResourcesStart from compatible configurations.
  2. Resources → Sustained loadInclude peaks and their duration, not just averages.
  3. Sustained load → Test and costEvaluate suitable candidates with the same workload.
Compatibility
Match OS, AMI, architecture and software.
Resources
Specify CPU, memory, storage and network needs.
Sustained load
Check peak duration, credits and I/O limits.
Test and cost
Compare runtime, failures and complete costs.

A family describes a resource profile; a size specifies a configuration within it. Equal vCPU counts do not imply identical processors, memory, networking or EBS limits. Do not treat a vCPU count as a measured application speed.

Use the name as a clue, then inspect the specifications

Example: read m7g.large in four parts; this is not a recommendation
PartMeaning
mGeneral-purpose series; inspect its resource balance
7Generation within the series
gAWS Graviton processor option; check Arm compatibility
largeSize within this family; look up actual vCPU, GiB and other specifications
Example starting points; actual suitability depends on specifications and load
SeriesWhy investigate itDo not overlook
M: general purposeA starting point for balanced resource needsGeneral purpose does not mean optimal for every workload
C: compute optimizedCPU-intensive processingRequired memory and usable parallelism
R: memory optimizedLarger in-memory working setsBottlenecks other than memory
T: burstableLower baseline use with temporary CPU peaksCredits and costs under sustained demand

Record both average and peak requirements

Requirements to record before comparison
DimensionWhat to establishPitfall
CPURuntime, usable parallelism and peak durationAssuming twice the vCPUs means twice the speed
MemoryPeak working set, concurrency and headroomChoosing from averages and exhausting memory at peaks
Storage I/OIOPS, throughput, latency and retentionAssuming faster EBS alone fixes total performance
NetworkingTransfer volume, destinations, latency and sustained bandwidthReading a maximum as a constant guarantee
AvailabilityRegion/AZ, OS and offered typesTreating an offering as a guarantee of immediate launch capacity

EBS performance is constrained by both the volumes and the instance. A faster volume cannot overcome an instance-side limit. IOPS counts I/O operations per second; throughput measures transferred data over time. Include I/O size when comparing them.

Choose an option to see the result and explanation.

A higher-performance EBS volume does not improve throughput. What is a useful next check?
Read the answer and reason

Answer: Instance-side EBS limits and application I/O behavior · The storage path has several limits. Compare instance specifications with actual I/O behavior before deciding what to change.

For burstable types, review credits and sustained demand

CPU credits govern CPU use on burstable types. Credits accrue when use is below the baseline and are consumed above it. A short peak test is insufficient to establish sustained performance.

Behavior when earned credits are insufficient; verify the selected type and settings
ModeConceptEvaluation check
StandardAfter accrued credits are exhausted, CPU use gradually returns to baselineRuntime and credit balance after a sustained peak
UnlimitedSurplus credits can sustain use above baseline, with conditional additional chargesSustained use, surplus credits and billing conditions

Worked example: do not solve a memory requirement with CPU alone

Filter fictional candidates against requirements; these are not benchmark or pricing results
CandidateGiven factsDecision in this exercise
Ax86_64, 4 GiB memory; the app requires at least 8 GiBReject: insufficient memory
BArm, 16 GiB; a required library supports x86_64 onlyReject under the current compatibility requirement
Cx86_64, 16 GiB; other performance is unmeasuredKeep for evaluation; optimality remains unproven

Choose an option to see the result and explanation.

Candidate C meets compatibility and memory requirements. Is it proven optimal?
Read the answer and reason

Answer: No: compare CPU, I/O, sustained load and costs · Meeting necessary conditions is different from establishing adequate performance and acceptable cost. List and test the remaining requirements.

Compare the same workload and the complete configuration cost

  1. Define the workload, data volume, concurrency and completion-time criterion.
  2. Compare candidates with consistent AMI, app and storage conditions; record what changes.
  3. Inspect runtime, errors, peak memory, credits and I/O across representative duration.
  4. Include EBS, IPv4, transfer and necessary surrounding services, not just EC2.
  5. Record established criteria and unknowns, then clean up test resources.

A smaller type may have a lower hourly rate yet take longer to complete the same work. Compare Region, OS, purchasing option, added resources and CPU-credit conditions consistently. This lesson does not guarantee a price or price/performance ratio for any type.

Check, then explain in your own words

  1. Explain how compatibility and minimum resources exclude candidates.
  2. Identify average/peak duration and constraints beyond CPU.
  3. Compare completion criteria and complete configuration costs.
Check your understanding: Can an instance-type name prove the best configuration for your app?

No. The name helps find candidates; requirements, specifications and workload evaluation determine suitability.

Check compatibility and resources first, then sustained behavior, I/O and costs. Neither vCPU count nor hourly price is sufficient.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.