KMS & Stack Tuning
Tuning Infisical Node.js --max-old-space-size & Container Limits
Align V8 garbage collection ceilings with Docker memory limits so burst bulk-decryption never triggers silent OOM kills.
75% Container Limit Heap · Zero Swap Thrash · Graceful SIGTERM
Why Container Limit Must Exceed V8 Heap
Node.js allocates native crypto buffers, libuv thread pools, and C++ OpenSSL structures outside V8 heap. Always leave 25% headroom inside Docker deploy.resources.limits.memory.
Zero-Downtime Rolling Restarts
Configure stop_grace_period: 30s so active secret requests drain cleanly during image upgrades.
Measured Thresholds & KMS Configuration
| Container Limit | NODE_OPTIONS Heap | Headroom Purpose |
|---|---|---|
| 1024M (Startup) | --max-old-space-size=768 | Buffers + native crypto allocations |
| 2048M (Growth) | --max-old-space-size=1536 | Handles 1,500+ req/min + webhooks |
| 4096M (Enterprise) | --max-old-space-size=3072 | Large bulk secret export & rotation |