Recall & Review
beginner
What does the 'least connections' load balancing method do in NGINX?
It sends new requests to the server with the fewest active connections, helping to balance load evenly.
Click to reveal answer
beginner
How do you enable 'least connections' load balancing in NGINX?
Use the directive
least_conn; inside the upstream block.Click to reveal answer
intermediate
Why might 'least connections' be better than 'round robin' in some cases?
Because it considers current load on servers, sending traffic to the least busy server rather than cycling evenly.
Click to reveal answer
beginner
Write a simple NGINX upstream block using 'least connections' for two backend servers.
upstream backend {
least_conn;
server backend1.example.com;
server backend2.example.com;
}Click to reveal answer
intermediate
What happens if all backend servers have the same number of active connections in 'least connections' mode?
NGINX will choose one of them, usually the first in the list, since they are equally loaded.
Click to reveal answer
What directive enables 'least connections' load balancing in NGINX?
✗ Incorrect
The directive
least_conn; activates the least connections load balancing method.In 'least connections' mode, NGINX sends new requests to:
✗ Incorrect
Least connections mode picks the server with the fewest active connections to balance load.
Which scenario benefits most from 'least connections' load balancing?
✗ Incorrect
Least connections helps when request times vary, by sending new requests to less busy servers.
If two servers have equal active connections, how does NGINX choose in 'least connections' mode?
✗ Incorrect
NGINX defaults to the first server in the list if active connections are equal.
Which of these is NOT a valid load balancing method in NGINX?
✗ Incorrect
'cpu_load' is not a valid NGINX load balancing method.
Explain how the 'least connections' load balancing method works in NGINX and when it is useful.
Think about how NGINX decides which server to pick based on current load.
You got /3 concepts.
Describe how to configure 'least connections' load balancing in an NGINX upstream block.
Look at the syntax inside the upstream block.
You got /3 concepts.