7 · Compute Choices — Revise¶
Performance · 24% · Compressed recall. Read the Learn guide first.
Pick the compute¶
Long-running (>15 min) / OS control / steady high use? → EC2
Short, event-driven, ≤15 min, scale to zero? → Lambda
Containers, no servers to manage? → Fargate (ECS or EKS)
Containers + need node control / max density? → ECS/EKS on EC2
Standardized on Kubernetes? → EKS
Large-scale batch? → AWS Batch
EC2 family → bottleneck¶
| Family | Optimized for |
|---|---|
| T / M | General purpose (T = burstable) |
| C | Compute (CPU-bound, batch, HPC) |
| R / X | Memory (in-memory DB, big cache) |
| I / D | Storage (high local disk IOPS/throughput) |
| P / G | GPU (ML, graphics) |
Lambda limits¶
| Limit | Value |
|---|---|
| Max timeout | 15 min (900 s) |
| Memory | 128 MB – 10 GB |
/tmp |
512 MB – 10 GB |
| Package | 50 MB zip / 250 MB unzip / 10 GB image |
| Default concurrency | 1,000 / Region (soft) |
Containers¶
| ECS | EKS | |
|---|---|---|
| Orchestrator | AWS-native | Kubernetes |
| Launch types | Fargate (serverless) or EC2 (you manage nodes) | same |
Flashcards¶
Job runs 40 minutes, want no servers. Lambda?
No — Lambda caps at 15 min. Use Fargate (or EC2/Batch)."Serverless containers" vs "serverless functions"?
Serverless containers = Fargate. Serverless functions = Lambda.Need Kubernetes without managing the control plane?
Amazon EKS (with Fargate to also drop node management).In-memory database needs lots of RAM — which EC2 family?
Memory optimized: R or X.Latency-sensitive Lambda hit by cold starts. Fix?
Provisioned concurrency.Steady, always-on, high-utilization compute — cheapest?
EC2 with a Savings Plan / Reserved Instances (Topic 11).Common traps¶
- Lambda = 15-minute cap — the top rule-out; longer ⇒ Fargate/EC2/Batch.
- Fargate = serverless containers; Lambda = serverless functions.
- EKS = Kubernetes; ECS = AWS-native — both run on Fargate or EC2.
- Match EC2 family to bottleneck (R/X memory, C CPU, P/G GPU, T burstable).
- Spiky/event-driven → serverless; steady high use → EC2 + commitment.