Learn about the various load balancing methods and how you can modify them.
The new OVHcloud Load Balancer service offers a variety of load balancing methods for your services. This process determines how the OVHcloud Load Balancer distributes the requests received by your servers.
Requirements
- you must be logged in to the OVHcloud Control Panel
- you need to have created a server cluster
Instructions
Different load balancing methods
Load balancing is used in server clusters. This setting defines how requests are distributed between the servers within the cluster.
To understand the basics of the OVHcloud Load Balancer service, please refer to our Introduction to the OVHcloud Load Balancer.
Algorithm | Features |
---|---|
RoundRobin | Selects the servers one after the other for each connection. This is the default algorithm. |
First | The first available server receives the connection. The server is chosen according to its ID, from smallest to largest. |
Least | Selects the server that has the lowest number of active connections. This setting is recommended for long sessions, with low levels of traffic. The RoundRobin algorithm is applied to groups of servers with the same number of active connections. |
Source | This algorithm hashes the source IP address and then divides the result by the number of servers currently running. The same source IP address will then still be redirected to the same server, provided that it continues to run. |
URI | This algorithm hashes part or all of the URI and then divides the result by the number of servers currently running. The same URI will then still be redirected to the same server, provided that it continues to run. |
Access your OVHcloud Load Balancer service
From the OVHcloud Control Panel:
- Select
Bare Metal Cloud
from the top navigation bar. - Expand the
Network
section in the left-hand menu. - Click
Load Balancer
and select your service.
On the Home screen, you will see the following:
Navigate to the GET /ipLoadbalancing section of the OVHcloud API.
For more information on the API’s features, you can refer to the following guide.
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
.
In Advanced settings
, 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 on a server cluster
With this call instruction, you can view details on a server cluster if you know its ID. In this example, we will work on an HTTP cluster:
GET /ipLoadbalancing/{serviceName}/http/farm/{farmId}
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 | Balance type currently set for the cluster |
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 call instruction, 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, the BackendHttp.balance
field must be updated with an available balancing method:
PUT /ipLoadbalancing/{serviceName}/http/farm/{farmId}
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
POST /ipLoadbalancing/{serviceName}/refresh
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.