Sign In
Sign In

Manage Load Balancers

Updated on 01 August 2024

Manage your load balancers in the Hostman control panel.

Advanced Settings

To launch a load balancer, you only need to add servers and set at least one forwarding rule, leaving the rest of the settings as default. However, you can also configure the load balancing in more detail.

To configure a new load balancer, click Advanced settings in the Settings step when creating a load balancer.

To configure an existing load balancer:

  1. Go to the NetworksLoad balancers section.

  2. Click on the load balancer.

  3. Click Configure next to Advanced settings:

Image10

Balancing algorithm

Select your preferred balancing algorithm.

  • Round Robin sends requests to servers in turns: the first request to the first server, the next request to the second server, and so on until the last server, after which the cycle starts over.

  • Least Connections sends each new request to the server that currently has the least number of active connections. This method allows you to distribute the load on the servers fairly evenly.

Sticky sessions

When enabled, the load balancer uses cookies to redirect requests from the same client to the same server.

However, if the server becomes unavailable, the load balancer will redirect the client's request to another server.

Health checks

Health checks run in the background. The load balancer sends test requests to the servers. If a server fails the test, it is removed from the load balancing until it passes the test again. 

You can use default health checks parameters or configure them yourself.

First, set the basic parameters for sending test requests to the server: protocol and port. We recommend using the TCP protocol.

You can also set your own values for these parameters:

  • Check interval: how often to send test requests.

  • Response timeout: how long to wait for a response to a test request.

  • Unhealthy threshold: the number of failed tests in a row before the server is removed from balancing.

  • Healthy threshold: the number of successful tests in a row before the server is added back to balancing.

SSL certificate

When enabled, all HTTP traffic to the load balancer will be redirected to a secure connection. To make this work, you must create at least one rule to redirect from HTTP to HTTPS.

Proxy protocol

When enabled, the load balancer will pass client connection data (IP address and port) to the end server, rather than discarding it. This can be useful for collecting traffic statistics, showing a site or app in the user's language, or providing specific features based on the user's country.

The proxy protocol will work for all redirection rules with HTTP or HTTPS  as the target protocol.

Make sure the end servers support the Proxy protocol; otherwise, they will give a 400 error when health checked, and the load balancer will stop redirecting requests to them. 

Configuring your server to use the proxy protocol depends on the software you use:

Backend keep-alive

When enabled, the load balancer will maintain persistent connections with the servers for all rules with HTTP or HTTPS as target protocol. This means that instead of opening and closing a new TCP connection for each request, the load balancer keeps the connection open for multiple requests.

In most cases, enabling this option will help improve performance and reduce response time for the client.

Usage Details

When setting up redirects to HTTP and HTTPS, keep in mind the following details.

Setting up HTTP

If your redirect settings use the HTTP protocol, you may receive a 503 Service Unavailable error when accessing the domain.

To fix the problem, use the TCP protocol instead of HTTP in the health check settings:

Image7

Setting up HTTPS

For HTTPS redirection to work correctly, you should use the following settings:

  1. In the forwarding rules, add a rule with TCP instead of HTTPS and use port 443, as shown below:

Image8

  1. In the Health checks parameter, use the TCP protocol and port 80:

Image7

  1. Set the load balancer IP address as the domain A record.

  2. Add an SSL certificate to each server’s domain in the balancing.

Setting up load balancing when using Cloudflare

If your domain uses Cloudflare name servers, you must choose TCP as the source and destination protocols when pointing the domain to the load balancer's IP address. Other protocols are not supported.

Image8

Domain Setup

Each load balancer is issued a public IP address. You can find the IP address in the Networks Load balancers section.

Image5

Set this IP address as the A record of your domain.

Action History

You can view the actions performed on load balancers. To check the action history, go to NetworksLoad balancers → click on the load balancer → History.

Image2

We log the following events:

  • Creating a balancer

  • Adding a server to balancing

  • Removing a server from balancing

  • Creating forwarding rules

  • Changing forwarding rules

  • Changing load balancer settings

Was this page helpful?
Updated on 01 August 2024

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start.
Email us
Hostman's Support