There are several ways to compare haproxy load balancing, and there are some questions to welcome the discussion.
First, Haproxy load Balancing Implementation mode:
1, simple polling, balance roundrobin;
2. Ip,balance source according to the request;
3, according to the requested uri,balance URI;
4, according to the parameters in the request URL, balance Url_param;
5, according to the connection type, balance leastconn;
Second, detailed description:
1, simple polling, balance roundrobin;
The request is assigned according to the weights (weight) value, and weights defaults to 1.
Advantages: Simple implementation, flow distribution by weight.
Cons: Not flexible enough.
2. Ip,balance source according to the request;
This equalization method is to match the IP source with the hashed operation.
Advantage: You can keep a user session (the same IP user will access the same server as much as possible).
Disadvantage: It is possible to cause a single point bottleneck (weights invalid).
3, according to the requested uri,balance URI;
The hashed operation is matched according to the URL requested by the client.
Advantage: You can increase the hit rate of the cache (the same URL will be assigned to the same server as far as possible);
Disadvantage: It is possible to cause a single point bottleneck (weights invalid).
4, according to the parameters in the request URL, balance Url_param.
The hashed operation is matched according to the specified URL parameter.
Pros: More flexible, can increase the hit rate of the cache (the same specified parameters will be allocated to the same server as
Service);
Disadvantage: It is possible to cause a single point bottleneck (weights invalid).
5, according to the connection type, balance leastconn;
Match according to the connection type.
Advantages: more suitable for long-session connection, such as LDAP, SQL, TSE, etc;
Cons: connections that are not suitable for short sessions, such as HTTP.
This article is from the "technical Discrimination" blog, please be sure to keep this source http://emg2012.blog.51cto.com/3705315/1632900
Haproxy Load Balancer Comparison