Learn about the various load balancing methods and how you can modify them.
The OVHcloud Load Balancer service supports a variety of load balancing algorithms for your services. This setting determines how the OVHcloud Load Balancer distributes incoming client requests among the servers in a farm.
Requirements
- An OVHcloud Load Balancer service in your OVHcloud account
- Access to the OVHcloud Control Panel
- You need to have created a server cluster (farm)
Instructions
Available Load Balancing algorithms
The load balancing setting is applied at the server farm level and defines the method by which client requests are distributed among the servers within that farm.
For an overview of the OVHcloud Load Balancer service components, please refer to our Introduction to the OVHcloud Load Balancer guide.
| Algorithm | Features |
|---|---|
| First | Directs the connection to the first available server based on its ID (smallest to largest). |
| LeastConn | Selects the server that has the lowest number of active connections. This setting is recommended for long-duration sessions with light traffic. The RoundRobin algorithm is used for tire-breaking among equally loaded servers. |
| RoundRobin | Distributes connections sequentially, one after the other, for each new request. This is the default algorithm. |
| Source | Uses a hash of the source IP address to consistently redirect the same client IP to the same server, provided the server remains operational. |
| URI | Uses a hash of part or all of the URI path to consistently redirect identical URIs to the same server, provided the server remains operational. (Applicable to HTTP/HTTPS farms only.) |
Modify a server cluster’s load balancing method
Choose the Server clusters tab. Then click the more options ... button to the right of the cluster you wish to modify. From the drop-down menu, select Edit.
Scroll down to the Advanced settings area, where you can modify your Distribution mode.
Click Update to confirm your selection.
When the Server clusters page reloads, click Apply configuration in the yellow banner.
On the next screen select ☑ your Datacenter and click Apply configuration again.
View details of a server cluster
Use this API call to view the details of a specific server cluster:
| Setting | Meaning |
|---|---|
| ServiceName* | Your Load Balancer service ID |
| farmId* | The server cluster's ID number |
| Response (BackendHttp) | Meaning |
|---|---|
| farmId | The server cluster's ID number |
| balance | The load balancing algorithm currently set for the farm |
| zone | Name of the zone in which the cluster is configured |
| port | Port used to contact the servers configured on the cluster |
| probe | Type of probe currently configured on the cluster |
| displayName | Name given to this cluster |
| stickiness | Connection monitoring method currently set for the cluster |
Modify a server cluster's load balancing method
With this API call, you can edit the settings of a server cluster if you know its ID. In this example, we will work on an HTTP cluster. To modify the balancing method, update the BackendHttp.balance field with an available algorithm:
| Setting | Meaning |
|---|---|
| ServiceName* | Your Load Balancer service ID |
| farmId* | The server cluster's ID number |
| BackendHttp.balance | Preferred balancing method for this cluster |
Apply the modifications
| Setting | Meaning |
|---|---|
| ServiceName* | Your Load Balancer service ID |
| zone* | Name of the zone in which to deploy the configuration |
Go further
For more information and tutorials, please see our other OVHcloud Load Balancer guides or explore the guides for other OVHcloud products and services.