With izCloud Load Balancer only the IP addresses of servers in your own izCloud account can be used as backends, and no traffic is sent to a server that stops responding. The service is not sold through the cart; it is provided on a quote basis.
Before you start
- At least two servers running the same application. If you do not have them yet, set them up with the create a server guide.
- An izCloud service with the Load Balancer feature enabled. If it is not enabled, request it through the quote form.
- Manage permission in the Load balancer module (the account owner or an authorised sub-user).
- A valid SSL certificate covering your domain if you will serve HTTPS.
What is load balancing and how does it work?
Load balancing means sharing incoming requests across several servers instead of piling them onto one. The visitor or the client application does not know the addresses of the backend servers; it only connects to the virtual IP address (VIP) of the load balancer.
The load balancer forwards each new request to a backend server according to the distribution method you choose. It monitors the servers and sends no traffic to a server that does not respond. When you take a server down for maintenance or a server fails, users keep getting service from the servers that are still running.
The second benefit is capacity. When the CPU or connection count of a single server reaches its limit, you can add another server running the same application and split the load. Making the existing server bigger is also an option, but a single server always remains a single point of failure.
When do you need a load balancer?
Not every project needs a load balancer. For a small site, one server and regular backups are often enough. If one of the situations below applies to you, load balancing is worth considering.
- Even a short outage of your site or API costs you sales or customers.
- You want to roll out updates without downtime by taking servers out one at a time.
- The CPU or connection count of a single server hits its limit at peak hours.
- You want to move the SSL decryption work off your application servers.
How do you prepare the servers before setup?
The load balancer only distributes traffic; making sure the backend servers serve the same content is up to you. A user may have the first request answered by one server and the second by another. Application code, configuration and user files therefore have to be the same on every server.
- Set up at least two servers and install the same version of your application on each.
- Move shared components such as the database and common files to a separate server. You can use a private network (VLAN) for traffic between the servers.
- Note the port your application listens on (for example 80 or 8080) on each server.
- Make sure the application port is open on the server. Review the operating system firewall and your izCloud firewall rules.
How do you get izCloud Load Balancer?
Load Balancer is not sold through the cart; it is provided on a quote basis. In the quote form, describe your application, the traffic you expect and how many servers you will use. The sales team sends you a suitable setup and price.
Once the service is active, everything is managed in the panel. A Load Balancers section appears under the Infrastructure menu.
- Fill in the quote form and state your load balancer requirement.
- Approve the quote; the service is enabled on your account.
- Check that the right service is selected in the panel and open Infrastructure → Load Balancers.
How do you configure load balancing in the panel?
The configuration comes down to four decisions: which protocol the traffic arrives on, which servers it goes to, how it is shared between them and whether the same user is kept on the same server. Screen names and layout in the panel may change over time; the order below applies to every version.
- Under Infrastructure → Load Balancers, create a new load balancer definition and give it a name you will recognise (for example web-lb-01).
- Choose the protocol. For a website, use HTTP or HTTPS.
- Choose the distribution method. Round Robin is a good starting point for servers of similar capacity.
- Turn on session persistence if you need it.
- Add the backend servers: pick the IP address of a server in your account from the list and enter the application port. Add at least two servers.
- If you use HTTPS, upload your SSL certificate in the panel and bind it to the load balancer.
- Save and note the virtual IP address.
- Point the DNS record of your domain to this virtual IP address. For details, see the add a DNS record guide.
Which distribution method should you choose?
The distribution method (algorithm) decides which server receives a new request. If your servers are the same size and requests are short, Round Robin splits the load evenly. If some connections last long, as with WebSocket or large downloads, Least Connection gives the new request to the server with the fewest open connections at that moment.
The panel lists the options available on your service. The current list of supported protocols and options is on the Load Balancer page.
| Method | How it distributes | Best for |
|---|---|---|
| Round Robin | Hands requests to the servers in turn. | Web and API servers of similar capacity |
| Least Connection | Gives a new request to the server with the fewest open connections. | Long-lived connections, WebSocket |
When do you turn on session persistence?
Session persistence (sticky sessions) sends all requests from the same user to the same server. You need it if your application keeps the login session or shopping cart on the server's own disk or memory; otherwise the user may land on a different server with each request and appear to be logged out.
Persistence works in two ways. With the cookie method, the load balancer adds a cookie in the browser and recognises the user by it. With the source IP method, requests from the same IP address go to the same server; if many users in one office share a single IP, the load can become uneven.
In the long run, the more robust approach is to keep session data in a shared place that all servers can reach, such as a database. Then persistence is not needed, and users do not lose their session when a server goes out of service.
How is an SSL certificate used on the load balancer?
For HTTPS, decryption can be done on the load balancer (SSL offload). You upload your certificate in the panel and bind it to the load balancer; the backend servers receive decrypted traffic and can focus on the application. Renewing a certificate in one place is also easier than renewing it on every server.
The certificate must cover your domain and the intermediate chain must be complete. After going live, verify the certificate from outside with the SSL certificate checker. The panel shows the expiry date of the certificate; upload a new one before it expires.
How do you know it works?
After saving the configuration, run the checks below. The most instructive test is to take one server out on purpose.
- In the panel, the backend servers show as up.
- Your domain resolves to the virtual IP address and the site opens.
- When you stop the application on one server, the site keeps opening from the other server.
- On HTTPS, the certificate check shows your domain and a valid expiry date.
Common problems
Most load balancing problems sit on the backend server or in the DNS record. The table below shows where to look first.
| Symptom | What to do |
|---|---|
| A backend server cannot be added | Only the IP addresses of servers in your izCloud account can be chosen. Check that the server belongs to the same service. |
| A server shows as down | Check that the application listens on the port you entered and that no firewall blocks that port. |
| Users are often logged out | Turn on session persistence or move session data to a shared database. |
| The browser shows a certificate warning | Check that the certificate covers the domain, the chain is complete and it has not expired. |
| The Load Balancers section is missing | The Load Balancer feature is not enabled on the selected service. Request it through the quote form. |
Frequently asked questions
How many servers does a load balancer need?
At least two backend servers are recommended for high availability. It also works with one server; then SSL offload and health monitoring are still useful, but if that server stops there is nowhere else to send the traffic.
Which distribution method should I choose?
If your servers have similar capacity, Round Robin is enough. If connection times vary a lot, Least Connection gives a more balanced result.
Can I add a server at another provider as a backend?
No. Only the IP addresses of servers in your izCloud account can be added as backends.
Can I upload my SSL certificate to the load balancer?
Yes. You upload your certificate in the panel and bind it to the load balancer. Decryption happens on the load balancer and your servers receive decrypted traffic.
What happens if a server fails?
The load balancer monitors the servers and sends no traffic to a server that does not respond. Requests go to the servers that are running.
How do I buy a load balancer?
Load Balancer is not in the cart; it is provided on a quote basis. Fill in the quote form and you will receive a suitable setup and price. Once the service is active, you manage it in the panel.