EC2 Basics Flashcards
What is the “Kernel” in an operating system?
A small piece of SW in the OS that runs in privileged mode and has full access to the HW components of the server:
CPU
Memory
Network Cards
What mode do Apps run in, in a sever without virtualization?
User Mode/Unprivileged Mode
They must go through the OS to access the HW components.
What mode does the Host OS run in on a virtualized server?
Privileged Mode - has access to the HW components with the Guest OS + Apps running on top of it (VM’s ).
REVIEW - there are (4) different types of Virtualization:
Emulated Virtualization - Guest OS is not aware it’s virtualized and looks to read/write to HW. The Hypervisor controls that process/intercepts the Privileged Calls to the HW in what’s called “Binary Translation.”
Paravirtualization - same as Emulated, but the Guest OS makes calls to the Hypervisor instead of the HW itself.
HW-Assisted Virtualization - HW is now virt-aware. When the Guest OS looks to make Privileged Calls, the CPU handles it. That way, there is no translation at the Hypervisor level to improve efficiency.
SR-IOV (single root I/O virt) - HW + HW devices are virt-aware. A network card can present itself as many logical cards to VMs. This means no translation because Guest OS has access to logical Network cards whenever it wants.
What is AWS Hypervisor called?
Nitro.
EC2’s are ____ Resilient?
AZ Resilient.
All functions and network access is done within the particular AZ the EC2 hosts are sitting in.
Typical use-cases for using EC2 (versus Lambda or Elastic Container Service).
FYI - this is the most used/default for VM requirements because it’s cost effective and fits this wide range of use cases:
○ Traditional OS + Application compute requirement
○ Long running compute needs (like if you have an app that runs 24/7 x 365)
○ Any apps that need server-style requirements (like VMs) that need a traditional OS
○ Any apps/services that need burst or steady-state requirements
○ Monolithic app stacks (like a DB)
○ Migrated app workloads or DR
REVIEW:
→ By selecting the EC2 instance type and size, you can have granular control over what the resource configuration is
→ When selecting the proper instance type, the things to consider are:
○ Raw amounts - CPU, memory, local storage capacity, storage type
○ Resource ratios (some are better suited for memory caching versus compute-heavy apps)
○ Storage, network, and data bandwidth requirements
○ System ARCH and vendor (ARM v x86, Intel v AMD, etc.)
○ Additional features/capabilities (GPUs for example)
What are the 5 main categories of EC2?
- General purpose - this is the default for diverse, steady-state workloads, equal resource ratios
- Compute optimized - media processing, high performance computing, gaming, etc.
- Memory optimized - opposite of compute-optimized, and have a ton of memory like database workloads
- Storage optimized - large amounts of super-fast local storage; massive amounts of I/O.. Good for data warehousing & analytics workloads
- Accelerated computing - hardware GPUs, FPGA’s
What are the 4 different types of Storage design options that we typically see?
→ Direct/local attached storage - storage on the EC2 host (physical disks);
○ AWS = Instance Store
→ Network attached storage - volumes are created and connected to a device over the network
○ AWS = Elastic Block Store (EBS)
→ Ephemeral Storage - temporary storage, not persistent
○ AWS = instance store
→ Persistent storage - permanent storage that lives on past the lifetime of the instance
AWS = EBS
What are the 5 main categories of EC2?
- General purpose - this is the default for diverse, steady-state workloads, equal resource ratios
- Compute optimized - media processing, high performance computing, gaming, etc.
- Memory optimized - opposite of compute-optimized, and have a ton of memory like database workloads
- Storage optimized - large amounts of super-fast local storage; massive amounts of I/O.. Good for data warehousing & analytics workloads
- Accelerated computing - hardware GPUs, FPGA’s
What are the 4 different types of Storage design options that we typically see?
→ Direct/local attached storage - storage on the EC2 host (physical disks);
○ AWS = Instance Store
→ Network attached storage - volumes are created and connected to a device over the network
○ AWS = Elastic Block Store (EBS)
→ Ephemeral Storage - temporary storage, not persistent
○ AWS = instance store
→ Persistent storage - permanent storage that lives on past the lifetime of the instance
AWS = EBS
What are the 3 main categories of Storage?
Briefly describe what each is.
Block - a collection of uniquely addressable storage “blocks” either presented as a Volume or as a blank physical hard drive.
File - storage provided by a file server that has a structured file system already made and ready to go.
Object - collection of objects, no organization, just flat storage; very scalable (pics, movies, files, videos ,etc)
What is EBS?
Elastic Block Store - this service creates Storage Volumes that are shared to EC2 instances over the network.
EBS and the EC2’s it servers must be in the SAME availability zone.
Is EBS AZ or Region Resilient?
AZ - volumes are tied to a single AZ you when they’re created you have to specify the AZ they’re going in.
You CANT have an EC2 in AZ-A attached to an EBS Volume in EZ-B
What are the 2 types of SSD-based EBS Volumes?
** Designed for IOPS as dominant attribute **
→ General Purpose SSD (gp2) - “g” = general purpose
○ This is the default for almost all normal EC2 usage
→ Provisioned IOPS (io1) - “io” = IOPS
○ This is designed for low latency, high performance, and high thrupt use cases
What are the 2 types of HDD-based EBS Volumes?
** Designed for Thrupt as dominant attribute **
→ Thrupt Optimized HDD (st1) - “t” = throughput
○ Designed for frequently accessed, Thrupt intensive workloads (like big data/data warehouses)
→ Cold HDD (sc1) - “c” = cold
○ Designed for data that is less frequently accessed
EBS Summary:
· Volumes are created in an AZ; isolated
· If AZ fails, then volumes in that AZ fails
· EBS is HA/resilient inside an AZ; replicates data to multiple storage areas inside an AZ
· Generally; ONE volume is attached to ONE instance (EC2 instance)
· 1 x GB per month billing fee $$$ regardless of the state (even if instance is shut down)
· MAX Performance:
○ EBS maxes out at 80K IOPS for an instance and 64K IOPS for a volume (assuming io1)
· Max 2375 Mbps per instance of throughput, and 1000 Mbps per volume (assuming io1)
· SDD is designed for small, fast reads/writes whereas HDD is designed for sequential reads/writes of large blocks of data
What is an Instance Store?
Instance Stores are local, physical storage that instances can utilize; they are present on a specific EC2 host.
Because they are local and aren’t shared over a network like EBS, they are much faster and better performing.
When are Instance Stores attached?
At the time of EC2 launch - you can’t add this feature later on.
You either turn it on, or you don’t - it comes with the price of the EC2 that you’re already paying for.
Instance Store Summary:
· Local to EC2 host
· Can be added at launch of an EC2 ONLY - either you use it or you don’t, but you can’t add it later
· Data in an instance volume is lost if the instance moves to a new host, is resized, or there is a HW failure
· They provide very high data performance (highest in AWS)
· Instance Volumes are NOT persistent - they are “ephemeral” (not long lasting); TEMPORARY
When would you choose EBS over Instance Store?
· Highly available and reliable; can self correct when there are HW issues - it only fails if the entire AZ fails (much better resilience than an Instance Store)
· Persistent storage volumes - created independently of EC2 instances; you can stop/start/terminate/move/etc. and the data is still persistent
· Clusters and “Multi-Attach” - attach an” io1” volume (Provisioned IOPS SSD) to multiple instances at a time
· You can create snapshots to serve as a backup of the data to make the data Regionally resilient
· If you only require (performance and throughput caps):
○ Up to 64K IOPS and 1K MiB/s per volume
○ Up to 80K IOPS and 2375 Mbps per instance