Overview
Load balancers are used to distribute web traffic amongst two or more servers and are often used for websites which receive high volumes of traffic. The key differences between a Forge application server and a load balancer are:- A database server will not be installed
- PHP is not installed
- Node.js is not installed
Creating Load Balancers
When provisioning a new server, select the Load Balancer type. Once provisioning has completed, you can now create a load balanced site. The site name / domain should match the name of the corresponding site on the servers that will be receiving the traffic. Once you have added the site to your server, Forge will ask you to select the servers you wish to balance traffic across. The list of servers will include all of the servers in the same private network as the load balancer.Load Balancer Methods
Forge allows you to select one of three load balancer methods:- Round Robin - The default method, where requests are distributed evenly across all servers.
- Least Connections - Requests are sent to the server with the least connections.
- IP Hash - The server to which a request is sent is determined by the client IP address. This means that requests from the same address are always handled by the same server unless it is unavailable.
You can learn more about how Nginx load balancers work by consulting the Nginx documentation.