While the default load balancing algorithm is round-robin, it doesn't take into consideration either the server load or the response times. With the least connected method, we distribute connections to the upstream server with the least number of active connections.
Least connected load balancing
Getting ready
To test the load balancing, you'll need to be able to run multiple versions of your app, each on different ports.
How to do it...
The upstream block directive looks exactly the same as the round-robin configuration, except we now explicitly tell NGINX to...