Web / NGINX Interview questions
What are the types of load balancing methods in NGINX?
NGINX supports several load-balancing algorithms, selected by a directive inside the upstream block:
| Method | Behavior |
| Round robin (default) | Requests are distributed sequentially across servers in order. |
least_conn | Sends the next request to the server with the fewest active connections. |
ip_hash | Routes a given client IP to the same server consistently, useful for session persistence. |
hash | Distributes based on a custom key, such as a URL or header value. |
Weighted variants of round robin and least_conn are also common, using the weight parameter on each server line to send proportionally more traffic to more powerful backends.
More Related questions...