Commit 03c5a00
authored
feat: increase webapp Lambda memory from 512MB to 1024MB (#116)
## Summary
Increase the webapp Lambda function memory from 512MB to 1024MB to
improve cold start performance.
## Problem
With 512MB (0.29 vCPU), Next.js cold starts take over 20 seconds due to
CPU-bound operations (JS bundle parsing, DNS resolution, TLS handshake).
## Measurement Results
| Memory | vCPU | Cold Start P50 | Monthly Cost | vs 512MB |
|--------|------|----------------|-------------|----------|
| 512MB | 0.29 | 21.7s | $0.074 | — |
| **1024MB** | **0.58** | **7.1s** | **$0.051** | **-32%** |
| 1536MB | 0.87 | 5.6s | $0.060 | -19% |
| 3008MB | 1.7 | 4.0s | $0.084 | +14% |
1024MB is the sweet spot: 3x faster cold starts and 32% cost reduction
due to lower billed duration.
## Changes
- `cdk/lib/constructs/webapp.ts`: memorySize 512 → 1024
- CDK test snapshots updated
- README cost table updated
Closes #1011 parent 401f7ce commit 03c5a00
4 files changed
Lines changed: 4 additions & 4 deletions
File tree
- cdk
- lib/constructs
- test/__snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3466 | 3466 | | |
3467 | 3467 | | |
3468 | 3468 | | |
3469 | | - | |
| 3469 | + | |
3470 | 3470 | | |
3471 | 3471 | | |
3472 | 3472 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3296 | 3296 | | |
3297 | 3297 | | |
3298 | 3298 | | |
3299 | | - | |
| 3299 | + | |
3300 | 3300 | | |
3301 | 3301 | | |
3302 | 3302 | | |
| |||
0 commit comments