Compute⚓︎
EC2⚓︎
Instance Purchasing Options⚓︎
EC2 On-Demand Instance⚓︎
- Pay by the second for instances launched after the first minute.
- Not suitable for existing server*bound software licenses.
EC2 Savings Plan Instance⚓︎
- Available for 1 or 3-year terms.
- Requires commitment to a specific usage amount for a long workload.
- Beyond the committed usage, billed at the On-Demand rate.
- Locked to a specific instance family/region.
- Offers flexibility in instance size, OS, and tenancy (Host, Dedicated, Default).
- Shareable across AWS Organization accounts.
EC2 Reserved Instance⚓︎
- Commits to a consistent instance configuration, including instance type and region, for 1 or 3 years.
- Ideal for cost optimization.
- Shareable across AWS Organization accounts.
- Not suitable for existing server-bound software licenses.
EC2 Convertible Reserved Instance⚓︎
- Similar to Reserved Instance but allows flexibility in instance type, family, OS, scope, and tenancy.
- Suitable for long workloads with the option to change EC2 attributes.
EC2 Dedicated Instance⚓︎
- Runs in a VPC on hardware dedicated to customer use.
- Physically isolated at the host hardware level but may share hardware with other instances from the same AWS account.
- Cannot be used for existing server-bound software licenses.
EC2 Dedicated Host Instance⚓︎
- Runs on physical servers dedicated for customer use.
- Provides additional visibility and control over instance placement on a physical server.
- Enables the use of existing server-bound software licenses.
- Offers both on-demand (pay per second) and reserved (1 or 3-year options) pricing.
EC2 Capacity Reserved Instance⚓︎
- Reserves On-Demand capacity in a specific AZ for any duration.
- No time commitment (create/cancel anytime), no billing discounts, charged at On-Demand rate.
- Combine with Regional Reserved Instances and Savings Plans for billing discounts.
- Suitable for short-term, uninterrupted workloads that need to be in a specific AZ.
EC2 Spot Instance⚓︎
- Most cost-efficient EC2 instance, up to 90% off On-Demand rate.
- Can be terminated if max price < current spot price.
- Not suitable for critical jobs or databases.
- Useful for batch jobs, data analysis, image processing, and flexible workloads.
- Can cancel Spot Requests (open, active, or disabled) but does not terminate instances.
EC2 Spot Fleets⚓︎
- Set of Spot Instances with optional On-Demand Instances.
- Tries to meet target capacity with price constraints defined via launch pools, instance type, OS, and AZ.
- Allows multiple launch pools to choose from.
- Stops launching instances when reaching capacity or max cost.
- Strategies: Lowest Price, Diversified, Capacity Optimized.
EC2 Spot Blocks (aka Spot Duration)⚓︎
- Blocks Spot Instances during a specified time frame (1 to 6 hours) without interruptions.
- Instances may be reclaimed in rare situations.
- Not available to new customers.
EC2 SG Configurations⚓︎
- Define source (inbound rules) or destination (outbound rules) for network traffic.
- Options include single IPv4/IPv6, range of addresses (CIDR block), Prefix List ID for AWS services, or another Security Group.
- Linked Security Groups can be specified for the same VPC, a different SG in the same VPC, or a different SG in a peer VPC in VPC peering connection.
EC2 Placement Groups⚓︎
Cluster Placement Group⚓︎
- Clusters instances into a low-latency group in a single AZ.
- Provides high network speeds (10 Gbps bandwidth between instances).
- If the rack fails, all instances fail at once.
- Use cases: Big data jobs, applications requiring low latency and high network throughput.
Partition Placement Group⚓︎
- Spreads instances across many partitions within an AZ.
- Scales to hundreds of instances per group.
- Up to 7 partitions per AZ, can span multiple AZs.
- Instances within a partition don't share racks with instances in other partitions.
- Use cases: HDFS, HBase, Cassandra, Kafka, Hadoop (distributed and replicated workloads).
Spread Placement Group⚓︎
- Spreads instances across underlying hardware (max 7 instances per group per AZ).
- Can span across AZs.
- Reduces the risk of simultaneous failure.
- Instances on different physical hardware.
- Use cases: High availability, critical applications requiring isolated instances.
EC2 Instance Recovery⚓︎
- Preserves the same private IP, public IP, elastic IP, metadata, placement group, and instance ID after failure.
EC2 User Data⚓︎
- Used for automated, dynamic configuration tasks and running scripts after an instance starts.
- Supports shell scripts and cloud-init directives.
- Default: Shell scripts run with root privileges.
- Default: User data runs only during the boot cycle; can be configured for every restart.
EC2 Hibernate⚓︎
- Preserves in-memory state.
- Faster boot time (OS is not stopped/restarted).
- Memory state is written to a file in root EBS.
- Root EBS must be encrypted.
- Hibernate usage limited to 60 days.
- Available for On-Demand, Reserved, and Spot Instances.
- Use cases: Long-running processing, saving memory state, services with slow initialization.
Elastic Fabric Adapter⚓︎
- Improves ENA for high-performance computing (HPC), Linux only.
- Enabled with AWS Parallel Cluster.
- Suitable for inter-node communications, tightly coupled workloads.
- Leverages MPI standard.
- Bypasses the underlying Linux OS for low-latency, reliable transport.
EC2 Enhanced Networking⚓︎
- Higher bandwidth, PPS, lower latency.
- Option 1: ENA up to 100 Gbps.
- Option 2: Intel 82599VF up to 10 Gbps (legacy).
AWS Scaling Policies⚓︎
- Dynamic Scaling:
- Target-Tracking scaling.
- Simple/Step scaling.
- Scheduled Actions: Anticipate scaling based on known usage patterns.
- Predictive Scaling: Continuously forecasts load and schedules scaling ahead.
- Scaling Cooldown: Ensures no further scaling in/out after an action.
- Good metrics: CPU utilization, Request Count Per Target, Average Network In/Out, custom CloudWatch metrics.
- ASG keywords: "dynamic," "change," "capacity."
Amazon EC2 Auto Scaling⚓︎
- Automatically launches/terminates EC2 instances based on configuration parameters.
- Utilizes predictive scaling for determining the right amount of resource capacity.
- Supports target tracking and simple scaling.
- Allows scheduled actions for anticipated scaling based on known patterns.
- Can't modify launch configurations once created.
- No service cost, pay for underlying resources and services.
AWS Auto Scaling⚓︎
- Centralized service for managing configuration across scalable resources.
- Manages EC2 instances, spot fleets, Auto Scaling groups, ECS, DynamoDB, and RDS read replicas.
- Introduces scaling plans for unified scaling policies.
- Prioritizes availability, cost optimization, or a combination.
- No service cost, pay for underlying resources and services.
ASG Not Terminating EC2 Instances⚓︎
- Doesn't terminate instances until grace period expires.
- Doesn't immediately terminate instances with impaired status or those failing to report data for status checks.
- Doesn't use ELB health checks when configured for EC2 health checks.
Amazon EC2 Autoscaling Termination⚓︎
- Determines termination based on AZ with the most instances and at least one unprotected instance.
- Considers instances closest to the next billing hour for termination.
- Considers instances using the oldest launch template or config.
- Follows precedence of Template/Config for terminating old versions.