Load balancing algorithms?

I need to study load balancers such as network load balancing, Linux virtual server, HAProxy, ... I need to know something under the hood:

  • What algorithms / technologies are used in these load balancers? Which one is the most popular? Most effective?

I expect these algorithms / technologies to not be too complicated. Do they have any resources?

Many thanks for your help.

+4
source share
4 answers

Load balancing in Apache, for example, is done by the mod_proxy_balancer module. This module supports 3 load balancing algorithms:

  • Query counting
  • Weighted traffic count
  • Count pending requests

See here for more details: mod_proxy_balancer

+3
source

Not sure if this applies to serverfault or not, but some load balancing methods:

  • Round robin
  • Least Connections

I used the smallest connections. It just made sense to send the person to the car with the least amount of load.

+2
source

In general, load balancing involves sending new client requests to the least busy servers. Based on the running application, assign a β€œbusy factor” to each server: basically a number that reflects one or more points of interest for your load balancing algorithm (connected clients, CPU / memory usage, etc.), and then select a server at runtime the lowest such score. Basically ANY load balancing method is based on the following:

  • Round robin does not implement a busy estimate as such, but assigns each consecutive request to the next server in a circular queue.
  • The smallest connections have their own account = number_of_open_connections on the server. Obviously, it is better to use a server with fewer connections.
  • A random assignment is a special case - you make an uninformed decision to load the server, but assume that the function has a statistically uniform distribution.
+2
source

In addition to those already mentioned, simple random assignment can be a good enough algorithm for load balancing, especially with a large number of servers.

Here is one link from Oracle: http://download-llnw.oracle.com/docs/cd/E11035_01/wls100/cluster/load_balancing.html

+1
source

Source: https://habr.com/ru/post/1305777/


All Articles