Cost Optimization - Compute Flashcards
1
Q
EC2 - Characteristics
A
- In general the charges are per hour or second while the instance is running
- Pricing also depends on purchase option selected, EBS storage provisioned, data transfer in and out of the service, EIP addresses, and other features
- CloudWatch Alarms actions can automatically stop, terminate, reboot or recover instances
2
Q
EC2 - Placement groups
A
- Cluster: packs instances close together inside an AZ. This strategy enables workloads to achieve the lowest latency and highest packet-per-second network performance
- Partition: spreads instances across different logical partitions. Used by large distributed and replicated workloads such as Hadoop, Cassandra, and Kafka
- Spread: places a small group of instances across distinct underlying hardware
3
Q
EC2 - On-Demand
A
- Pay by the second for the instances that you launch. Have full control over its lifecycle
- Great when you need uninterrupted compute. One of the most expensive options
4
Q
EC2 - Savings Plans
A
- You make a commitment to a consistent usage, in USD per hour, for a term of 1 or 3 years
- Offers more flexibility than reserved instances but it’s not cheaper than them
- Unlike Reserved Instances, it does not reserve capacity. You commit to an amount of compute usage
- Useful for mixed EC2 instances, Fargate, and Lambda
5
Q
EC2 - Savings Plans types
A
- Compute Savings Plans:
- Provide savings up to 66 percent off On-Demand
- This discount apply regardless of Region, instance family, instance size, OS, and tenancy
- EC2 Instance Savings Plans:
- Provide savings up to 72 percent off On-Demand, in exchange for a commitment to a specific instance family and a Region
- This discount apply regardless of instance size, OS, and tenancy
6
Q
EC2 - Reserved instances 1
A
- You make a commitment to a consistent instance configuration of On Demand instances, including instance type and Region, for a term of 1 or 3 years
- Up to 72% saving compared to On Demand instances
- Upfront payment can be: all, partial, or none
7
Q
EC2 - Reserved instances 2
A
- Have two types:
- Standard: offers more discount than Convertible, up to 66% compared to On-Demand, but can’t be exchanged for another instance
- Convertible: offers discount, up to 56% compared to On-Demand. Can be exchanged for another instance
- There’s instance size flexibility only on Linux VMs. For example, a large reserved instance can be used as two medium reserved instances
8
Q
EC2 - Reserved Instances: scopes
A
- Regional Reserved Instance:
- A reserved instance for a Region
- Doesn’t reserve capacity
- AZ and instance size flexibility are permitted
- Zonal Reserved Instance:
- A reserved instance for a specific AZ
- Reserves capacity in a specific AZ
- No AZ and instance size flexibility
9
Q
EC2 - Spot instances
A
- It’s an instance that uses spare EC2 capacity
- Spot price is the hourly price for a Spot instance. The Spot price is set by EC2
- It runs whenever capacity is available and your bid exceeds the Spot price
- Up to 90% savings compared to On Demand instances
10
Q
EC2 - Spot instances types
A
- Spot instance
- Spot fleets: set of Spot Instances and optionally On Demand Instances that are launched under a specific criteria
- Spot blocks: several VMs that are guaranteed to run for a specific number of hours
11
Q
EC2 - Spot instances termination
A
- When you lose a post bid: you receive a 2 minute warning. Can monitor those warnings with CloudWatch
- These instances can be terminated (no charges applied), hibernated (charges applied for EBS storage and memory) or stopped (charges applied for EBS storage and memory)
12
Q
EC2 - Dedicated hosts
A
- Pay for a physical host fully dedicated to running your instances
- Useful for existing per-socket, per-core, or per-VM software licenses
- Have visibility and control over how instances are placed on the server (number of sockets or physical cores)
13
Q
EC2 - Dedicated instances
A
- Pay, by the hour, for instances that run on single-tenant hardware. Cannot bring your own license
- Don’t have visibility and control over how instances are placed on the server (number of sockets or physical cores)
14
Q
EC2 - Capacity reservations
A
- It’s an On Demand instance with reserved compute capacity in a specific AZ for any duration
- It allows to ensure that always have access to EC2 capacity when you need it, for as long as you need it
- Doesn’t need a commitment as Reserved Instances or Savings Plans
- Doesn’t provide billing discount. To receive a discount can combine it with Savings Plans or Regional Reserved Instances
15
Q
EC2 - Instance types considerations
A
- Consider cost of every instance type. For example m5.2xlarge is twice as expensive as m5.xlarge
- If you need the highest I/O performance an instance store volume is better than an EBS volume. An instance store provides temporary block-level storage. It’s ideal to store temporary information that changes frequently
- Consider the usage of EBS-optimized instances. Fully use the IOPS provisioned on an EBS volume
16
Q
EC2 - Instance types families
A
- General purpose (T, M, A1 instances): provide a balance of compute, memory and networking resources
- Compute optimized (C instances): for applications that need high performance processors
- Memory optimized (R, X2, X1, z1 instances): deliver performance for workloads that process large data sets in memory
- Accelerated computing (P, DL, Trn, Inf, G, F, VT): use hardware accelerators, or co-processors, to perform more efficiently than CPUs
- Storage optimized (Img, Is, I, D, H): designed for workloads that require high sequential access to large data sets
17
Q
EC2 - Instance considerations
A
- Fixed performance instances are more expensive than burstable. Must indicate the used CPU capacity
- Burstable performance instances:
- Provide a baseline level of CPU with the ability to burst above that baseline
- If the CPU isn’t being used, tokens are backed on a token bucket. When you need CPU above baseline you can cash in those tokens
- Useful for intermittent operations
- A new public IPv4 address of an instance is reassigned when its stopped and started again
18
Q
EC2 - Enhanced Networking
A
- It has two mechanisms:
- Elastic Network Adapter (ENA)
- Intel 82599 Virtual Function Interface (VF)
- Elastic Fabric Adapter (EFA):
- It’s an ENA with added capabilities
- It’s a network device that you can attach to an EC2 instance to accelerate HPC and ML applications
19
Q
EC2 - Burstable performance instance modes
A
- Standard: if you used all tokens you will be throttled back to the baseline
- Unlimited: if you used all tokens you will be charged on-demand for the extra power
20
Q
EC2 - Instances right sizing tools
A
- CloudWatch to monitor resources usage
- Cost Explorer: use optimization recommendations
- Trusted Advisor: use best practices on cost reductions
21
Q
EC2 - Right sizing tips
A
- Avoid conversions to older generations
- Before moving to a new instance:
- Monitor CPU, memory
- Monitor network throughput
- Consider if you are using ephemeral storage. Might lose it if you terminate that instance
22
Q
Serverless
A
- Lowers TCO and makes your app more agile
- Provides flexibility and automatic scaling
- Offers high availability and fault tolerance
- Platform:
- Compute: Lambda, Fargate
- Storage: S3
- Database: DynamoDB, Aurora
- API Proxy: API Gateway
- Integration: SNS, SQS