EC2 runs virtual servers called instances. Use Amazon Machine Images (AMIs) to launch their software, instance store for temporary local data, and automatic recovery to restore supported instances after an underlying host failure.
Instance types
An EC2 instance typeThe choice that determines an EC2 instance's compute, memory and storage hardware capabilities. sets the CPU, memory, storage and networking of a virtual server. Types are grouped into categories by what they’re good at, so the first choice is the category that matches the workload.
How it works
- Identify the workload’s bottleneck: CPU, memory, local disk, or specialized math such as graphics.
- Pick the matching category, then the family and size inside it.
- Measure and resize as usage changes (right-sizing).
| Category | Strength | Example workloads |
|---|---|---|
| General purpose | Balanced compute, memory and network | Web servers, code repositories |
| Compute optimized | High-performance processors | Batch processing, media transcoding, gaming servers, ML inference |
| Memory optimized | Large data sets in memory | In-memory databases, real-time analytics |
| Storage optimized | High sequential I/O on local storageTemporary instance storage provided by disks physically attached to its host. | Data warehousing, large data sets on local disks |
| Accelerated computing | Hardware accelerators such as GPUs | Graphics, ML training, pattern matching |
| High-performance computing | Price performance for HPC at scale | Large simulations, deep learning |
Exam cues
- If the question says balanced or general web workload, think general purpose.
- If the question says CPU-bound processing, think compute optimized.
- If the question says large in-memory data sets, think memory optimized.
- If the question says high I/O on local storage, think storage optimized.
- If the question says GPUs or graphics, think accelerated computing.
Remember
- Six categories: general purpose, compute, memory, storage, accelerated computing, HPC.
Trap: “Storage optimized” is about fast local instance storage, not about the most EBS capacity. Large EBS volumes attach to any category.
Da documentação da AWS (17)
- An EC2 instance type determines the hardware of the host computer; each type offers different compute, memory and storage capabilities and belongs to an instance family grouped by those capabilities.
- General purpose instances balance compute, memory and networking, which suits applications that use them in equal proportions, such as web servers and code repositories.
- Compute optimized instances suit compute-intensive applications that benefit from high-performance processors, such as batch processing, media transcoding, high-performance web servers, scientific modeling, dedicated gaming servers and machine learning inference.
- Memory optimized instances deliver fast performance for workloads that process large data sets in memory.
- Storage optimized instances suit workloads that need high, sequential read and write access to very large data sets on local storage, delivering tens of thousands of low-latency random IOPS.
- Accelerated computing instances use hardware accelerators, or co-processors, for functions such as floating point calculations, graphics processing or data pattern matching more efficiently than CPUs.
- High-performance computing instances offer the best price performance for HPC workloads at scale, such as large, complex simulations and deep learning.
- Amazon EC2 provides scalable compute capacity in the AWS Cloud as virtual servers (instances) that you configure and manage, including the operating system.
- EC2 Mac instances run macOS on Apple hardware for building, testing and signing apps for Apple platforms such as iPhone, iPad and Mac; they run only on Dedicated Hosts with a 24-hour minimum allocation.
- On Linux, EC2 user data scripts run as root on the first boot by default; the instance can be configured to run them again on later restarts.
- Stopping, hibernating or terminating an instance erases its instance store data.
- Instance store suits temporary data such as caches, buffers and scratch files.
- To preserve instance store data beyond the instance lifetime, copy it to persistent storage such as EBS, S3 or EFS.
- Instance store is temporary block storage on disks physically attached to the host computer, suited to buffers, caches and scratch data.
- Instance store volumes have no additional charge; they are included in the instance usage cost.
- An Amazon Machine Image (AMI) supplies the software used to set up and boot an EC2 instance.
- An AMI must be compatible with the instance type selected for launch.
Purchasing options
Amazon EC2 charges the same instance in different ways depending on how much you commit and how much interruption you accept. Choosing well can cut compute costs sharply.
How it works
| Option | You commit to | Best for |
|---|---|---|
| On-Demand | Nothing; pay per second | Short, unpredictable or new workloads |
| Savings Plans | USD per hour of usage for 1 or 3 years | Steady usage that may change shape; up to 72% off |
| Reserved Instances | An instance configuration for 1 or 3 years | Steady usage of one configuration; up to 72% off |
| Spot Instances | Nothing, but instances can be interrupted | Fault-tolerant, flexible jobs; steepest discounts |
| Dedicated HostsThe physical computer on which an EC2 instance runs. | A physical server | Server-bound licenses, compliance |
| Dedicated Instances | Single-tenant hardware | Hardware isolation without host control |
| Capacity Reservations | Capacity in one AZAn isolated location within an AWS Region. | Guaranteed capacity |
- Start with On-Demand while usage is unknown.
- Cover steady usage with Savings Plans; AWS recommends them over Reserved Instances.
- Move fault-tolerant work to Spot. Notices are best effort; stop and termination notices give two minutes, while hibernationStopping an instance after saving its working memory to its EBS root volume so it can resume later. begins immediately.
- Use Dedicated Hosts when licenses are tied to sockets or cores.
Exam cues
- If the question says steady usage for one or three years, think Savings Plans or Reserved Instances.
- If the question says can be interrupted or flexible start times, think Spot.
- If the question says short-term, unpredictable, no commitment, think On-Demand.
- If the question says bring per-core licenses or physical server, think Dedicated Hosts.
- If the question says guaranteed capacity in a specific AZ, think Capacity Reservations (or zonal RIs).
Remember
- Savings Plans and RIs: 1 or 3 years, up to 72% off.
- Spot notices: best effort; two minutes for stop or termination, immediate hibernation.
- Savings Plans payment: All Upfront, Partial Upfront or No Upfront.
- On-Demand: per second, 60-second minimum.
- Spot: up to 90% off.
- EC2 Instance Savings Plans up to 72%; Compute Savings Plans up to 66%.
Trap: A Reserved Instance is a billing discount, not a server. It applies automatically to matching On-Demand usage.
Da documentação da AWS (22)
- EC2 purchasing options are On-Demand Instances, Savings Plans, Reserved Instances, Spot Instances, Dedicated Hosts, Dedicated Instances and Capacity Reservations.
- On-Demand Instances are paid by the second for the instances you launch, with no commitment.
- Savings Plans give lower prices in exchange for a commitment to a consistent amount of usage, in USD per hour, for 1 or 3 years.
- Savings Plans can save up to 72% on compute; Compute Savings Plans apply regardless of instance family, size, OS, tenancy or Region, and also to AWS Fargate and AWS Lambda.
- Reserved Instances lower costs in exchange for a commitment to a consistent instance configuration, including instance type and Region, for 1 or 3 years; they are a billing discount, not physical instances.
- AWS recommends Savings Plans over Reserved Instances; both offer up to 72% off On-Demand, but Savings Plans don't tie you to an instance configuration.
- Spot Instances use spare EC2 capacity at steep discounts and suit applications that are flexible about when they run and can be interrupted, such as batch jobs, data analysis and background processing.
- EC2 Spot interruption notices are best effort: stop and termination notices give two minutes of warning, while a hibernation notice arrives as hibernation begins.
- A Dedicated Host is a physical server fully dedicated to your instances, which lets you bring per-socket, per-core or per-VM software licenses.
- Dedicated Instances run on single-tenant hardware; they don't give the host-level visibility, placement control or per-core licensing of Dedicated Hosts.
- Capacity Reservations reserve capacity for EC2 instances in a specific Availability Zone.
- Savings Plans can be paid All Upfront, Partial Upfront or No Upfront.
- On-Demand Instances are billed per second while running, with a 60-second minimum.
- Spot Instances are available at up to a 90% discount compared with On-Demand prices.
- There are four Savings Plans types: Compute, EC2 Instance, Database and SageMaker AI Savings Plans.
- EC2 Instance Savings Plans save up to 72% for a commitment to one instance family in one Region; Compute Savings Plans save up to 66% but apply across instance families, Regions, Fargate and Lambda.
- A stopped EC2 instance is not billed for usage or data transfer, but its attached EBS volumes keep being charged.
- EC2 instances can run Microsoft SQL Server with the license included from AWS, launched from license-included Windows AMIs, or with licenses you bring yourself.
- On-Demand Instance quotas are counted in vCPUs per account per Region, whatever the instance types; launches that would exceed the quota fail until you request an increase.
- A Capacity Reservation is billed at the On-Demand rate whether or not instances run in it; Savings Plans and Regional Reserved Instances can apply their discount to it.
- An open Capacity Reservation is used automatically by any running or new instance with matching type, platform and Availability Zone; a targeted one only by instances that name it, and future-dated reservations start as targeted.
- Savings Plans are a commitment to a set amount of compute usage per hour for one or three years, in exchange for lower prices than On-Demand; they are a pricing model, not reserved capacity.
Reserved Instance flexibility and sharing
Reserved Instances are discounts on EC2 usage that matches their attributes. Their scope decides how flexible the discount is and whether it reserves capacity. In AWS Organizations, the discount can be shared across accounts.
How it works
- Buy for one or three years; three years saves more.
- Pick the class: Standard (biggest discount, modify only) or Convertible (exchangeable).
- Pick the scope: regional for flexibility, zonal for a capacity reservation.
- In an organization, the management account decides how discounts are shared among accounts.
| Scope | Reserves capacity | AZAn isolated location within an AWS Region. flexibility | Size flexibility |
|---|---|---|---|
| Regional | No | Any AZ in the RegionA separate geographic area containing AWS infrastructure. | Within the family (Linux/Unix, default tenancy) |
| Zonal | Yes, in one AZ | No | No |
Exam cues
- If the question says RI discount across instance sizes, think regional RI size flexibility.
- If the question says reserve capacity in an AZ, think zonal RI or Capacity Reservation.
- If the question says share RI discounts across accounts, think AWS Organizations consolidated billing.
- If the question says change instance family during the term, think Convertible RIs or Savings Plans.
Remember
- Scope doesn’t change the price.
- Standard: modify only; Convertible: exchange.
- RI payment: All Upfront, Partial Upfront, No Upfront.
Trap: Size flexibility applies only to regional RIs on Linux/Unix with default tenancy, not to Windows or zonal RIs.
Da documentação da AWS (8)
- A Reserved Instance's scope is regional or zonal, and the scope doesn't change its price.
- A regional Reserved Instance doesn't reserve capacity, but its discount applies in any Availability Zone of the Region and, for Linux/Unix with default tenancy, to any size within the instance family.
- A zonal Reserved Instance reserves capacity in a specific Availability Zone, and its discount applies only to that AZ, instance family and size.
- Reserved Instances are bought for one or three years; the three-year term gives a bigger discount.
- Standard Reserved Instances give the biggest discount and can only be modified; Convertible Reserved Instances give a lower discount and can be exchanged.
- The management account of an organization controls Reserved Instance and Savings Plans discount sharing across its accounts, organization-wide, by account group or per account.
- Reserved Instances can be paid All Upfront, Partial Upfront or No Upfront; with Partial or No Upfront the rest is billed monthly over the term.
- A Convertible Reserved Instance can be exchanged any number of times for a different instance family, operating system or tenancy, as long as the new reservation is of equal or higher value.
Flashcards
Nada para revisar aqui agora. Escolha outros tópicos ou outro filtro.
·
Todos os 34 flashcards em lista
A company runs a web server that uses CPU, memory and network in roughly equal amounts. Which EC2 instance category fits?
General purpose.
A media company transcodes video and needs fast processors. Which EC2 instance category fits?
Compute optimized.
An in-memory database processes very large data sets in RAM. Which EC2 instance category fits?
Memory optimized.
A data warehouse needs very high sequential read and write throughput on local disks. Which EC2 instance category fits?
Storage optimized.
A team trains machine learning models and renders graphics on GPUs. Which EC2 instance category fits?
Accelerated computing, which uses hardware accelerators such as GPUs.
Does choosing a bigger general purpose EC2 instance give the same result as choosing a memory optimized one for a large in-memory data set?
No. Memory optimized instances are built for large in-memory data sets; the category, not only the size, should match the workload.
A company needs virtual servers in AWS where it controls the operating system and installed software. Which service fits?
Amazon EC2, which provides virtual servers (instances) that you configure and manage.
A team needs cloud machines to build and sign its iOS app. Which EC2 option fits?
EC2 Mac instances, which run macOS on Apple hardware. They run on Dedicated Hosts, billed per host with a 24-hour minimum.
A user data script on an EC2 instance uses sudo, and an admin expects it to run on every reboot. What is wrong with both assumptions?
On Linux, user data runs as root and only on first boot by default. Configure repeated execution if it must run on later restarts.
What happens to EC2 instance store data when its instance stops, hibernates or terminates?
It is erased. Use instance store for temporary data, and copy anything that must survive to persistent storage.
An application needs very fast temporary block storage for scratch data, at no extra storage cost. Which EC2 storage option fits?
Instance store.
Its disks are attached to the host and are included in the instance price, but data is lost when the instance stops or terminates.
What does an EC2 AMI provide, and what compatibility must a launch satisfy?
The software to set up and boot an instance. The AMI must support the chosen instance type.
A company runs a steady workload on EC2 for the next three years but may change instance families. Which purchasing option saves the most while staying flexible?
A Compute Savings Plan, which applies across instance family, size, OS, tenancy and Region, plus Fargate and Lambda.
A batch job can stop and restart at any time. Which EC2 purchasing option is cheapest?
Spot Instances, which use spare capacity at steep discounts and can be interrupted.
A developer needs an EC2 instance for a short test of unknown length with no commitment. Which purchasing option fits?
On-Demand Instances, billed by the second with no commitment.
A company must use its existing per-core SQL Server licenses on EC2. Which purchasing option supports this?
Dedicated Hosts, which give a physical server and support per-socket, per-core and per-VM licenses.
A company needs guaranteed EC2 capacity in one Availability Zone for a launch event, without a long-term commitment. Which option fits?
On-Demand Capacity Reservations, which reserve capacity in a specific AZ.
Should a production database that must never stop run on Spot Instances to save money?
No. Spot capacity can be interrupted, and interruption notices are best effort. Use On-Demand capacity with a suitable discount if needed.
Which is AWS's recommended commitment-based discount for EC2 today, Savings Plans or Reserved Instances?
Savings Plans. Both offer up to 72% off On-Demand, but Savings Plans don't lock you into an instance configuration.
What is the minimum billing period when an EC2 On-Demand Instance starts?
60 seconds. After that, On-Demand Instances are billed per second.
Which EC2 purchasing option can give up to a 90% discount compared with On-Demand?
Spot Instances.
Which Savings Plans type gives the largest EC2 discount, and what does it tie you to?
EC2 Instance Savings Plans, up to 72%. They tie you to one instance family in one Region; Compute Savings Plans (up to 66%) are more flexible.
Which four Savings Plans types does AWS offer?
Compute, EC2 Instance, Database and SageMaker AI Savings Plans.
In which instance state is only EBS storage billed, not the instance itself?
Stopped. Instance usage stops being billed, but attached EBS volumes are still charged.
A DBA needs SQL Server Standard on a server reachable by RDP, must not buy a license separately, and is unsure about sizing. What fits?
An EC2 instance from a Windows Server AMI with SQL Server Standard license included. AWS bills the license with the instance, and the instance type can be changed later.
A script launching many On-Demand instances in one Region fails after a few dozen succeed. What limit is likely involved?
The On-Demand Instance quota, measured in vCPUs per account per Region. Request an increase through Service Quotas.
A team buys a Compute Savings Plan to be sure capacity exists for a big launch. Is that enough?
No. Savings Plans only lower prices for committed hourly usage; to hold capacity in an Availability Zone, use an On-Demand Capacity Reservation.
What is the difference between a regional and a zonal EC2 Reserved Instance?
- Regional: no capacity reservation; discount applies in any AZ and, for Linux, any size in the family
- Zonal: reserves capacity in one AZ; discount only for that AZ, family and size
A company bought a regional Linux Reserved Instance for m5.xlarge and now runs two m5.large instances in the same Region. Does the discount still apply?
Yes. Regional Linux/Unix Reserved Instances with default tenancy have instance size flexibility within the family.
Which EC2 Reserved Instance class can be exchanged for a different configuration?
Convertible. Standard RIs give a bigger discount but can only be modified, not exchanged.
A company has Reserved Instances in one account of an AWS Organization. Can other accounts in the organization benefit from the discount?
Yes. The management account controls RI and Savings Plans discount sharing across the organization's accounts.
Does a regional Reserved Instance guarantee EC2 capacity?
No. Only a zonal Reserved Instance (or a Capacity Reservation) reserves capacity, in one AZ.
What payment options can a company choose when it buys EC2 Reserved Instances?
All Upfront, Partial Upfront or No Upfront.
With Partial or No Upfront, the remaining balance is billed monthly over the term.
What limits an exchange of a Convertible Reserved Instance?
The new reservation must be of equal or higher value. Family, operating system and tenancy can change, with no limit on the number of exchanges.