EC2 (Virtual Machine)

Instance Types

General Purpose

  • General purpose instances provide a balance of compute, memory and networking resources, and can be used for a variety of diverse workloads. These instances are ideal for applications that use these resources in equal proportions such as web servers and code repositories.

Compute Optimized

  • Compute Optimized instances are ideal for compute bound applications that benefit from high performance processors. Instances belonging to this family are well suited for batch processing workloads, media transcoding, high performance web servers, high performance computing (HPC), scientific modeling, dedicated gaming servers and ad server engines, machine learning inference and other compute intensive applications.

Memory Optimized

  • Designed to deliver fast performance for workloads that process large data sets in memory, such as hosting database

Storage Optimized

  • Designed for workloads that require high, sequential read and write access to very large data sets on local storage. They are optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications.

Pricing Options

  • On Demand: Pay per second after first minute

  • Reserved Instances: Reserve the instance for at least 1 year for getting discount

  • Spot Instance: Instance can be lost at any time, if other works are needed for getting discount

  • Dedicated Host: A physical server is fully dedicated for your use, the most expensive option

Data Storage

EBS Volume

  • A network drive that attach to EC2 instance

  • Allow persisting data even after termination

  • Can be detached and attached to other instance quickly

  • Locked in a AZ, so the AZ of EC2 and EBS must be the same

EBS Snapshots

  • Make a backup of EBS at a point in time

  • can be restored across AZ or region

  • SSD: better i/o ops

  • HDD: higher volume

Multi-Attach

  • For io1/io2 class, the same volume can be attached to multiple instances

  • Up to 16 instances at a time

Instance Store

  • Advanced version of EBS

  • Better I/O performance

  • Lose the storage if EC2 are stopped so better for keeping temporary data

EFS (Elastic File System)

  • Managed network file system that can mounted in many EC2

  • Work with EC2s with multiple A-Z

  • Highly available and scalable

Placement Groups

Cluster

  • Put virtual machines into the same hardware to achieve low latency between them

Spread

  • Spread different virtual machines into different hardwares

Partition

  • Split the virtual machines into different partitions

  • Each partition belongs to different hardwares

  • Virtual machines in the same partition belongs to same hardware

Load Balancing

  • Provide high availbility across the zones

  • Expose single of access to application

  • Separate the public traffic from private traffic

Application Load Balancer

  • Layer 7 of load balancer

  • Based on the route, query params

Network Load Balancer

  • Layer 4 of load balancer

  • Based on port number

Gateway Load Balancer

Sticky Sessions

  • User with the cookie will always go to the same instances

Cross-Zone Load Balancing

  • Evenly disturb the traffic across all instances in all AZ

Last updated

Was this helpful?