Comparison and summary of Linux Server LVS, Nginx, and HAProxy load balancers

Source: Internet
Author: User
Tags haproxy

Comparison and summary of Linux Server LVS, Nginx, and HAProxy load balancers

LVS features:

1. Strong anti-load capability. IP Server Load balancer technology is used only for distribution. Therefore, LVS does not generate much traffic;

2. good stability and reliability, and perfect Hot Standby solution (for example, LVS + Keepalived)

3. A wide range of applications, allowing Load Balancing for all applications;

4. Regular Expression Processing is not supported, and dynamic/static separation is not supported.

Four common algorithms:

1. rr: call, which is distributed to backend servers in turn;

2. wrr: weight wheel is assigned based on the backend server load;

3. lc: minimum connection, allocated to servers with least established connections;

4. wlc: minimum weight connection, which is allocated based on the backend server's processing capability.

The session can be maintained using ipvsadm-p (persistence). The default value is 300/s.

Nginx features:

1. Working at Layer 7, you can process regular rules (for example, traffic distribution for domain names and directories)

2. The configuration is simple. The server load can be pinged. the backend server status can be checked through the port, but url detection is not supported;

3. Anti-high concurrency, using the epoll network model to process customer requests;

4. Only HTTP and EMail are supported, and the application scope is relatively small;

5. nginx is mainly used for HTTP and reverse proxy servers, reducing system resource consumption.

Four common algorithms:

1. RR: (default) Round Robin, which is distributed to backend servers in turn;

2. weight: allocated based on backend server performance;

3. ip_hash: each request is allocated based on the hash result of the access ip address. The concurrency hour is suitable to solve the session problem;

4. fair: (extension policy). By default, the nginx kernel is not compiled. The backend server's response time is used to determine the load and the lightest choice is used for processing.

HAProxy features:

1. Two proxy modes are supported: TCP (layer-4) and HTTP (layer-7), and virtual hosts are supported;

1. simple configuration. Supports url detection of backend server status;

2. Server Load balancer software only. In high concurrency, the processing speed is higher than that of nginx;

3. the TCP layer is mostly used for Mysql server load balancing.

Four common algorithms:

1. roundrobin: Round Robin and distributed to backend servers in turn;

2. static-rr: allocated based on backend server performance;

3. leastconn: The minimum connector is preferred;

4. source: The request source IP address is similar to Nginx IP_Hash.

Why solve session?

In a Server Load balancer environment, each user may access the backend server unfixed. In some application scenarios, yes. All requests accessed by the same user must be distributed to the same backend server for processing within a certain period of time, such as e-commerce websites and user registration pages. Once the page is refreshed, it will be allocated to another backend server, and the information on the page just now is gone. In this case, it is vital to allocate the same server to process requests!

For details about HAproxy, click here
HAproxy: click here

Recommended reading:

Haproxy + Keepalived build Weblogic high-availability server Load balancer Cluster

Keepalived + HAProxy configure high-availability Load Balancing

Haproxy + Keepalived + Apache configuration notes in CentOS 6.3

Haproxy + KeepAlived WEB Cluster on CentOS 6

Haproxy + Keepalived build high-availability Load Balancing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.