Node.js runs your code on one event loop per process, so one blocked loop or one busy core caps your throughput. These recipes spread the load across cores, size the heap and catch event loop lag. Start with Use Every CPU Core with Node.js Cluster Mode.
- Node.js Event Loop Lag Monitoring with Prometheus
Alert on prom-client event loop lag, loop utilization and failed scrapes, so a blocked Node.js event loop pages you before your health checks start failing.
- Fix JavaScript Heap Out of Memory in Node.js
Size the V8 heap to the container with max-old-space-size, then find what grows at peak, so Node.js stops crashing with JavaScript heap out of memory.
- Fix Socket Hang Up and ECONNRESET Behind a Load Balancer
Keep idle connections open longer on the side that should close them last, so Node.js and the load balancer stop racing to reuse a socket the other has closed.
- Next.js SSR Slow at Peak? Fix It with Caching and ISR
Turn per-request rendering into Next.js ISR caching with a cache that every replica shares, so peak traffic reads cached pages instead of rendering each one.
- Use Every CPU Core with Node.js Cluster Mode
Run one Node.js worker per CPU core, as pods or node:cluster workers, so peak traffic spreads across every core instead of queuing on one event loop.