Load-Balancing Node.js in Production
System processes, Systemd, PM2, Nginx, Docker...? How should you run Node.js in production? Here's a performance guide to minimize downtime.
There are many ways to run Node.js applications. Some of them good, some not so much. This talk will walk you through three optimal configurations for production-ready Node.js applications.
The first is by using the built-in
cluster module to create worker processes and distribute traffic between the forks. A similar approach can be used with Nginx acting as a load balancer, distributing traffic to multiple Node.js instances. The last configuration is by using Docker and orchestrating containers with Kubernetes to handle load balancing.
Each approach will showcase how to load-balance traffic and make the most of your server's performance. The goal of this talk is to explain the benefits of each setup and the overhead that follows. I want to show what you can use, and why, so you can choose the configuration that fits your use-case.
> Skill level: intermediate
> Duration: 25 min
Apart from talking at events and teaching in person, Adnan also writes programming tutorials and articles for some of the largest tech publications on Medium, including freeCodeCamp and Hackernoon.