Comparison summary of LVS, Nginx and haproxy load balancers for Linux servers

Source: Internet
Author: User
Tags haproxy

LVS Features:

1. Strong anti-load capability, using IP load Balancing technology, only to do distribution, so LVS itself does not have much traffic generated;
2. Stable, reliable, self-perfect hot-standby program; (eg: lvs+keepalived)
3. A wide range of applications can be load-balanced for all applications;
4. Do not support regular processing, can not do static and dynamic separation.

Four commonly used algorithms:

1.RR: Round call, take turns assigning to backend server;
2.WRR: The weight of the wheel called, according to the backend server load situation to allocate;
3.LC: Minimum connection, assigning a server with the fewest connections established;
4.WLC: Weight minimum connection, allocated according to backend server processing power.
Ipvsadm–p (persistence) can be used to maintain session, default is 300/S

Nginx Features:

1. Work on 7 levels, you can do regular rule processing, (for example: for domain names, directories for diversion)
2. Simple configuration, can ping the load function, can detect the back-end server status through the port, does not support URL detection;
3. Anti-high concurrency, using Epoll network model to process customer requests;
4. Only support HTTP and email, the scope of application is relatively small;
5.nginx is mainly HTTP and reverse proxy server, low system resource consumption.

Four commonly used algorithms:

1.RR: (default) polling, alternately assigned to the backend server;
2.weight: Based on backend server performance allocation;
3.ip_hash: Each request is allocated according to the hash result of the access IP, and the concurrent hour is appropriate to solve the session problem;
4.fair: (Extended Policy), the default is not compiled Nginx kernel, according to the back-end server response time to determine the load situation, choose the lightest processing.

Haproxy Features:

1. Support two kinds of proxy mode: TCP (four layer) and HTTP (seven layer), support virtual host;
1. Simple configuration, support URL detection back-end server status;
2. Load balancing software is used only, in high concurrency, processing speed is higher than nginx;
3. TCP tiers are used for MySQL slave (read) server load Balancing.

Four common algorithms:

1.roundrobin: Polling, alternately assigning to backend servers;
2.STATIC-RR: Based on backend server performance allocation;
3.leastconn: Minimum connector priority;
4.source: According to the request source IP, similar to Nginx Ip_hash.
Why solve session sessions?

In a load-balanced environment, each user may have an irregular access back-end server, in some cases, it is necessary to require the same user access in a certain time all requests are assigned to the back end of the same server to handle, for example: E-commerce site, user registration page, a refresh page, will be assigned to another server on the backend, and the information on the page just went out, in which case it is important to assign the same server to handle the request!

Comparison summary of LVS, Nginx and haproxy load balancers for Linux servers

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.