# Pool's algorithm

Load balancing is one of the key features of GreenNode's Load Balancer (vLB) service. It is the process of receiving client requests at the listener and distributing them across multiple members (servers) according to established algorithms. This feature allows you to increase the processing capacity of your services by creating multiple or a cluster of servers behind the Load Balancer.

The load balancing algorithm determines which member (server) is chosen for each incoming request. GreenNode's Load Balancer offers three types of load balancing algorithms:

1. **Round Robin**

   Round Robin is a simple algorithm that selects members (servers) in a sequential order. The Load Balancer starts with the first member in its list for the first request, then moves down the list in order, starting again at the top when it reaches the last member. ![](/files/rsLPWhh3yJ1L0zXClZQv)
2. **Least Connections**

   Requests are directed to the server with the fewest active connections at the current time. This algorithm is considered dynamic, as it constantly tracks the number of active connections on each server.

   **How it Works (Example):**

   Imagine you have 5 clients connected to 2 servers. When a 6th client sends a request:

   * **Scenario 1: No Disconnections:** If no clients have disconnected, client 6 will be sent to Server 2 because the connection ratio between the two servers is 3:2. ![](/files/ekFptthnBEFEfaLH6l9y)
   * **Scenario 2: Disconnections:** If clients 1 and 3 disconnect before client 6 sends a request, client 6 will be sent to Server 1 because the connection ratio is now 1:2. ![](/files/JZYrkjvlsQsWyIIw93In)
3. **Source IP**

   This algorithm combines the source and destination IP addresses of the client and server to create a unique hash key. This key is used to assign the client to a specific server, and it can be recreated if the session times out or is disconnected for any reason. This ensures that the client's requests are consistently directed to the same server, which is useful for maintaining things like shopping cart items across sessions.

<figure><img src="/files/WgoeNXviX4BBrhoHfeUZ" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vngcloud.vn/vng-cloud-document/load-balancer/application-load-balancer/pool/pools-algorithm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
