EC2 - EC2 101 Flashcards
Amazon EC2 is…
…a web service that provides resizable compute capacity in the cloud
EC2 reduces the time required to obtain and boot new server instances to…
…minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change
EC2 changes the economies of computing by…
…allowing you to pay only for the capacity that you actually use
EC2 provides developers the tools to…
…build failure resilient apps and isolate themselves from common failure scenarios
EC2 pricing options
On Demand, Reserved, Spot, Dedicated Hosts
On Demand
allow you to pay a fixed rate by the hour with no commitment.
On Demand use case example
If you’re a startup, you can pay for instances by the hour with no long term commitment for experimentation, terminate instances when you are complete.
Reserved
provide you with a capacity reservation, and offer a significant discount on the hourly charge for an instance. 1-year or 3-year terms
Reserved use case example
If you need a minimum of 2 webservers to serve your customers
Spot
enable you to bid whatever price you want for instance capacity, providing for even greater savings if your apps have flexible start and end times. engineering, pharma companies use these
If bid price > spot price…
…instances can be provisioned
If spot price > bid price…
…instances will be terminated
Dedicated Hosts
physical EC2 server dedicated for your use (hourly rate). Dedicated hosts can help you reduce costs by allowing you to use your existing server-bound software licenses
On Demand Use Cases
Users that want the low cost and flexibility of EC2 without any up-front payment or long-term commitment
Apps with short term, spiky, or unpredictable workloads that cannot be interrupted
Apps being developed or tested on EC2 for the first time
Reserved Use Cases
Apps with steady state or predictable usage
Apps that require reserved capacity
users able to make upfront payments to reduce their total computing costs even further
Example of combining reserved + on demand instances
2 webservers = reserved. Need more for Black Friday = on demand
Spot Use Cases
Apps that have flexible start and end times
Apps that are only feasible at very low compute prices
Users with urgent computing needs for large amounts of additional capacity
Spot Use Case Examples
Large pharma company saves money by using compute capacity during very low demand times
Large world events, e.g. Brexit, analysts need to find solutions really quickly
Dedicated Hosts Use Cases
Useful for regulatory requirements that may not support multi-tenant virtualization
Great for licensing which does not support multi-tenancy or cloud deployments (e.g. Microsoft, SQL, Oracle)
Can be purchased on demand (hourly)
can be purchased as a reservation for up to 70% off the on-demand price
Termination of Spot Instances - EXAM TIP
If the spot instance is terminated by Amazon EC2, you will not be charged for a partial hour of usage. However, if you terminate the instance yourself, you will be charged for any hour in which the instance ran
Instance Types
D = Dense R = Memory-optimized (RAM) M = General Purpose (main choice) C = Compute-optimized G = Graphics-Intensive I = High Speed Storage (I/O) F = Field Programmable Gate Array T = Lowest Cost, General Purpose (t2 micro) P = Graphics/General Purpose CPU (pics) X = Memory-optimized (extreme RAM)
Dense Storage use case
Fileservers/Data Warehousing/Hadoop
Memory Optimized use case
Memory Intensive apps/DBs
General Purpose use case
Application Servers
Compute Optimized use case
CPU Intensive apps/DBs
Graphics Intensive use case
Video Encoding/3D application streaming
Field Programmable Gate Array use case
Hardware acceleration for your code
Lowest Cost, General Purpose use case
Web Servers/small DBs
Graphics/General Purpose GPU use case
Machine Learning, Bit Coin Mining, etc
Memory Optimized use case
SAP HANA, Apache Spark, etc
What is EBS?
EBS allows you to create storage volumes and attach them to EC2 instances.
Once a volume is attached…
…you can create a file system on top of these volumes, run a database, or use them in any other way you would use a block device
EBS volumes are placed…
…in a specific AZ, where they are automatically replicated to protect you from the failure of a single component
single component?
storage array
EBS volume types
General Purpose SSD (GP2) Provisioned IOPS SSD (IO1) Throughput Optimized HDD (ST1) Cold HDD (SC1) Magnetic (Standard)
General Purpose SSD (GP2)
General purpose, balances both price and performance
Ratio of 3 IOPS per GB with up to 10K IOPS and the ability to burst up to 3000 IOPS for extended periods of time for volumes under 1 Gib
Provisioned IOPS SSD (IO1)
Designed for I/O intensive apps such as large relational or NoSQL databases
Use if you need more than 10K IOPS
Can provision up to 20K IOPS per volume
Highest-performance SSD volume designed for mission-critical applications
Throughput Optimized HDD (ST1)
Big data Data warehousing Log processing Sequential data Cannot be a boot volume
Cold HDD (SC1)
Lowest cost storage for infrequently accessed workloads
File Server
Cannot be boot volumes
Magnetic (Standard)
Lowest cost per GB of all EBS volumes types that is bootable.
Ideal for workloads where data is accessed infrequently, and apps where the lowest storage cost is important
Can you mount 1 EBS volume to multiple EC2 instances?
No, use EFS instead
General Purpose SSD (GP2) Use Cases
- Recommended for most workloads
- System boot volumes
- Virtual desktops
- Low-latency interactive apps
- Development and test environments
Provisioned IOPS SSD (IO1) Use Cases
-Critical business applications that require sustained IOPS performance, or more than 10,000 IOPS or 160 MiB/s of throughput per volume
-Large database workloads, such as:
MongoDB
Cassandra
Microsoft SQL Server
MySQL
PostgreSQL
Oracle
Throughput Optimized HDD (ST1) Use Cases
- Streaming workloads requiring consistent, fast throughput at a low price
- Big data
- Data warehouses
- Log processing
- Cannot be a boot volume
Cold HDD (SC1) Use Cases
- Throughput-oriented storage for large volumes of data that is infrequently accessed
- Scenarios where the lowest storage cost is important
- Cannot be a boot volume
By default, if an EC2 instance is terminated, what happens to the EBS root volume attached to it?
The volume will be deleted since “Delete on Termination” is checked by default
Bootstrap scripts are placed in…
…User Data under “Advanced Details”