×

Creating a new load balancer

 
The network balancer service can be enabled only after connecting an external IP address for an objective KVM virtual network.
1. Go to the section Network balancers of the Elastic Cloud KVM and click «Add» or create a balancer from the section 
Virtual networks for a certain network.
 
2. Select the parameters while creating a balancer.
 
2.1 TCP or HTTP operating mode.
 
2.1.1 TCP mode: traffic balancing on a transportation level according to the signified ports.
2.1.2 HTTP mode: such parameters as SSL certificate usage, the ability to download certificates for the balancer frontend and the optional ability to communicate with target services via HTTPS are added.
 
2.2 An incoming address and a port, where the balancer will wait for the incoming traffic. You can use an external IP address that is already used in other KVM services or connect another one.
 
3. Create or select a Target host group (for example, a group of virtual machines) for traffic balancing. The groups are linked to a certain virtual network. It is necessary to consider this when creating a new host group. You can manage them from the common page of the virtual network balancers or from the page of all network balancers.
 
4. Set the rules for checking availability of the hosts in the group: how often, which requests will be performed and which criteria will be used to evaluate the availability of each host in the target group. You can use TCP or HTTP protocol for checking.  With an HTTP protocol you can also set a URI (that will be added to the host IP address to perform the HTTP request) and a code in the heading of the HTTP response. You can use multiple response codes in one verification rule.
 
5. Select the Balancing algorithm – the way the traffic will be switched to the next available host in a group. There are several algorithms available.
 
5.1 Round Robin: This algorithm evenly distributes the requests between all available servers in turn. A new request is assigned to each server in turn, which provides uniform workload distribution. Round Robin is simple and effective in situations when all servers have the same resources and efficiency.
 
5.2 Least Connections: This algorithm directs a new request to a server with the least number of active connections. This approach allows to distribute the workload more evenly in the situations when servers have different efficiency or when the requests take different amounts of time. Least Connections is especially useful for long-term or resource intensive connections.
 
5.3 Source IP Hash: This algorithm decides on which server to send the request based on the client’s IP address. The IP Hash distributes the requests so that the requests from the same IP address are always directed to the same server. This can be useful for the applications that require maintaining the condition of a session (for example, if cashing is used or the session data is kept on a server).
 
5.4 URI: This algorithm is used only in the HTTP balancer mode and distributes the requests based on the URI path. This means that the requests with an identical URI will be directed to the same server. The URI algorithm is especially useful for applications that require saving the binding of certain resources (for example, static files) to certain servers to improve cashing and efficiency.