# Lambda Managed Instances (LMI) scaling decision matrix (2026)

Anchors from [AWS Lambda Managed Instances scaling docs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-instances-scaling.html) and What's New (Mar–May 2026): up to **32 GB / 16 vCPUs**, memory:vCPU ratios **2:1 / 4:1 / 8:1**, file descriptors **4,096**, EventBridge Scheduler → `PutFunctionScalingConfig`.

| Signal | Prefer classic Lambda | Prefer LMI | Prefer ECS/EKS instead |
|--------|----------------------|------------|-------------------------|
| Traffic doubles in &lt;5 min often | Provisioned concurrency / SnapStart | Pre-warm via **scheduled min EE** | Horizontal pod/task scale with proactive ALB targets |
| CPU-heavy JSON / media / batch steps | Rarely | **2:1** ratio, ≥2 vCPU | Fargate/EC2 if &gt;15 min wall time |
| Python multi-concurrency heavy memory | Rarely | **4:1 or 8:1**, lower max concurrency | Container if GIL + large heap dominate |
| Need cold-start=0 with idle → $0 | Scale to zero automatically | Set **min=0,max=0** off-hours via Scheduler | Scale-to-zero on Spot/Karpenter |
| Socket / FD exhaustion under multi-concurrency | Adjust keep-alive pools | LMI FD limit **4,096** (Mar 2026) | Raise `nofile` on AMI / container |
| Team owns AMI + patching | No | Capacity Provider + managed EC2 | Full cluster ownership |

## Controls to set (order)

1. **Memory / vCPU ratio** (`ExecutionEnvironmentMemoryGiBPerVCpu`) — 2:1 compute, 4:1 general, 8:1 memory.
2. **Per-EE max concurrency** — raise only if CPU stays low; max **64 per vCPU**.
3. **Min / Max execution environments** — min ≥3 for AZ spread; pair both values on `PutFunctionScalingConfig`.
4. **Scheduled scaling** — EventBridge Scheduler → `lambda:PutFunctionScalingConfig` before peaks; scale min/max to 0 to deactivate version without deleting function.

## Throttle metrics to watch

`ConcurrencyThrottles`, `CPUThrottles`, `MemoryThrottles`, `DiskThrottles` — pick the first that spikes before raising concurrency blindly.
