Algorithms for making load-balancing decisions

Load balancer groups use algorithms to make load-balancing decisions. The decision determines to which remote server to forward a new connection.

Load balancer groups support weighted and non-weighted algorithms.

A weighted algorithm uses weight (or preference) to help determine which server receives the next request. A server with a higher weight receives more traffic than one with a lower weight. The percentage of traffic to each server is approximately equal to its weight divided by the cumulative weight of all servers in the group.

A non-weighted algorithm assumes that the capacity of all servers in the group to be equivalent. Although non-weighted algorithms are typically faster than weighted algorithms, some non-weighted algorithms, such as the hash algorithm, can send more traffic to some servers. If there are servers with different capacities in the group, processing cannot optimize the capacities of all the servers.

First alive

The first alive algorithm uses the concept of a primary server and backup servers.
  • The primary server is the first server in the members list.
  • A backup server is any subsequent server in the members list.

When the health state of the primary server is up, the DataPower® service forwards all connections to this server. When the health state of the primary server is softdown or down, the DataPower service forwards connections to the next server in the list.

Hash

The hash algorithm uses the IP address of the client or the value of an HTTP header as the basis for server selection.

With an HTTP header, use the Load Balancer Hash Header property to identify the header to read. When you configure a service without the wizard, this property is available on the Main tab. This property is available for only the following services.
  • Multi-Protocol Gateway
  • Web Service Proxy

With the hash algorithm, the same client is served by the same server. Use this algorithm only when clients access applications that require the storage of server-side state information, such as cookies. Hashing algorithms cannot ensure even distribution.

Least connections

The least connections algorithm maintains a record of active server connections and forward a new connection to the server with the least number of active connections.

Round robin

The round robin algorithm maintains a list of servers and forwards a new connection to the next server in the members list.

Weighted least connections

The weighted least connections algorithm maintains a weighted list of application servers with their number of active connections. The service forwards a new connection to a server based on the following combination.
  • Its proportion to the weight or preference
  • Its number of active connections

This algorithm uses more computation times than the least connection algorithm. However, the additional computation results in distributing the traffic more efficiently to the server that is most capable of handling the request.

This algorithm applies to application servers, not to authentication or authorization servers, and requires the Application Optimization feature.

Weighted round robin

The weighted round robin algorithm maintains a weighted list of servers and forwards new connections in proportion to the weight, or preference, of each server.

This algorithm uses more computation times than the round robin algorithm. However, the additional computation results in distributing the traffic more efficiently to the server that is most capable of handling the request.