Creating Load Balancer
Load balancing (performed by a load balancer) is a type of service performed by a computer that assigns work loads to a set of networked computer servers in such a manner that the computing resources are used optimally.
The load balancer can be used to increase the capacity of server farm beyond that of a single server. It can also allow the service to continue even in the face of a server down time due to the server failure or maintenance.
The load balancer can be a virtual server that, in turn, consists of an IP address and port. This virtual server is bound to a number of physical services running on the physical servers in a server farm. These physical services contain the physical server's IP address and port. A client sends a request to the virtual server, that in turn selects a physical server in the server farm and directs this request to the selected physical server.
The load balancer described in this section is based on iptables that has no failover function. It uses hash of source IP address to determine destination IP from range of mail servers. Mail servers receive the same client coming from the same IP even across reboots. This means that in case you use some webmail software like Open-Xchange and most of connections come from the same IP address, all these connections will not be distributed within your mail servers but forwarded to a single mail server.
In kernels up to 2.6.10 you could add several --to-destination
options. For those kernels, if you specify more than one destination address, either via an address range or multiple --to-destination
options, a simple round-robin (one after another in cycle) load balancing takes place between these addresses. Later kernels (>= 2.6.11-rc1) do not have the ability to NAT to multiple ranges anymore.
So, if you use Linux kernels later than 2.6.11-rc1 and do not want to deploy the load balancer based on iptables, skip the Creating Firewall Rules and Configuring Routing sections. Instead, you can use any other third-party software or hardware load balancer solution if you need more functions like failover or smarter algorithm of connections distribution.
The load balancer can also be a physical server with the specific soft installed in it, such as IronPort.