Compute Performance
- Choose EC2 instance families based on workload: compute-optimized (C-series) for CPU-intensive tasks, memory-optimized (R/X-series) for in-memory databases, storage-optimized (I/D-series) for high IOPS workloads.
- Use Auto Scaling to match capacity to demand and avoid over- or under-provisioning.
- AWS Lambda removes server management and scales automatically for event-driven workloads.
Storage Performance
- Amazon EBS volume types matter: gp3 provides baseline 3,000 IOPS; io2 Block Express supports up to 256,000 IOPS for latency-sensitive databases.
- Amazon S3 supports high throughput for object storage; use S3 Transfer Acceleration for faster uploads over long distances.
- Amazon EFS provides scalable shared file storage; use Max I/O mode for highly parallel workloads.
Database Performance
- Amazon RDS Read Replicas offload read traffic from the primary instance.
- Amazon ElastiCache (Redis or Memcached) caches frequently accessed data, reducing database load and latency.
- Amazon DynamoDB offers single-digit millisecond performance; use DynamoDB Accelerator (DAX) for microsecond read latency.
- Amazon Aurora is up to 5× faster than standard MySQL and supports Aurora Replicas for read scaling.
Network Performance
- Amazon CloudFront caches content at edge locations, reducing latency for end users globally.
- Use Elastic Load Balancing (ALB/NLB) to distribute traffic and prevent single-instance bottlenecks.
- Enhanced Networking (ENA) and placement groups (cluster placement) reduce network latency between EC2 instances.
- AWS Global Accelerator routes traffic over the AWS backbone for improved global performance.
Key Design Principles
- Decouple components using Amazon SQS or SNS to prevent one slow component from blocking others.
- Use caching at multiple layers: CloudFront (edge), ElastiCache (application), and DAX (database).
- Select the right storage tier: frequently accessed data on EBS or EFS; infrequent access on S3-IA or Glacier.
- Monitor with Amazon CloudWatch and use metrics to identify and resolve performance bottlenecks proactively.