Nginx,lvs,haproxy, load Balancing options

Source: Internet
Author: User
Tags node server haproxy netscaler

The advantages of Nginx:
Good performance, can load more than 10,000 of the concurrency.
Many functions, in addition to load balancing, can be used as a Web server, but also through the GEO module to achieve traffic distribution.
Community active, third-party patches and modules many
Support for Gzip Proxy
Disadvantages:
Session hold is not supported.
The health check function of the back-end realserver is not effective. It is only supported for detection by port and is not supported by URL.
Nginx support for big request header is not very good, if the client_header_buffer_size setting is relatively small, it will return to the 400bad request page.
Advantages of Haproxy:
Its advantages just can be added to the shortcomings of Nginx. Supports session hold while supporting the detection of the status of the backend server by obtaining the specified URL.
Supports load balancing in TCP mode. For example, you can load balance MySQL from the server cluster and mail server.
Disadvantages:
Virtual Host not supported (this is silly)
There are currently no performance monitoring templates for Nagios and cacti
Advantages of LVS:
Good performance, close to hardware equipment network throughput and connection load capacity.
LVS's Dr mode, which supports load balancing over a WAN. None of this other load balancing software is currently available.
Disadvantages:
More heavy. Another community than Nginx active.

*************************************************************************************

Now the common load balancing in the network is mainly divided into two kinds: one is through hardware, common hardware has more expensive NetScaler, F5, Radware and array and other commercial load balancer, there are similar to LVs, Nginx, Haproxy's Linux-based, open-source load balancing strategy,

Commercial load balancing inside NetScaler is more efficient than F5 in effect. For a load balancer, however, the commercial load balancer can be built on the four to seven layer protocol, so the application of a wider range so there is no alternative, his advantage is that there is a professional maintenance team to maintain these services, the disadvantage is that the cost is too large, so for the smaller network services for the moment there is no need to use.

Another way to load balance is through the software: more common with LVs, Nginx, Haproxy, etc., where LVS is built on the four layer protocol above, and the other Nginx and Haproxy is based on the seven layer protocol, the following respectively about

LVS: Achieve a high-performance, high-availability server with cluster technology and Linux operating systems with good scalability (Scalability), Reliability (reliability), and manageability (manageability).

LVS is characterized by:

1, strong anti-load capacity, is the work in the Network 4 layer on the distribution only, no flow generation;

2, the configuration is relatively low, this is a disadvantage is also an advantage, because there is not much to configure things, so do not need too much contact, greatly reducing the chance of human error;

3, stable work, self has a complete two-machine hot standby program;

4, no flow, to ensure that the performance of the Equalizer IO will not receive the impact of large traffic;

5, a wide range of applications, can be load-balanced for all applications;

6, LVS need to apply to IDC more than one IP to do the visual IP, so the need for a certain network knowledge, so the operator's requirements are relatively high.

The features of Nginx are:

1, work in the network on the 7 layer, can be targeted for HTTP applications to do some diversion strategy, such as for the domain name, directory structure;

2, Nginx dependence on the network is relatively small;

3, Nginx installation and configuration is relatively simple, testing more convenient;

4, can also bear high load pressure and stability, generally can support more than 10,000 times the concurrency;

5, Nginx can detect the server internal fault through the port, for example, according to the server processing the status code returned by the Web page, time-out and so on, and will return the wrong request resubmitted to another node, but the disadvantage is that the URL is not supported to detect;

6, Nginx to the request of asynchronous processing can help the node server to reduce the load;

7, Nginx can support HTTP and email, so much smaller in the scope of application;

8, does not support the session to maintain, the big request header support is not very good, in addition, the default is only Round-robin and Ip-hash two load balancing algorithms.

Haproxy is characterized by:

1, Haproxy is working on the network 7 layer above.

2, can add some of the shortcomings of Nginx such as the session of the maintenance, cookie guidance and other work

3, support the URL detection backend server problem detection will be very good to help.

4, more load balancing strategy such as: Dynamic weighted round robin (Round Robin), weighted source address hash (Weighted source hash), weighted URL hash and weighted parameter hash (Weighted Parameter hash) has been implemented

5, simply from the efficiency of the haproxy more than Nginx has a better load balancing speed.

6, Haproxy can load balance MySQL, the back-end of the DB node detection and load balancing.

***********************************************************************************************

Now the trend of Web site development on the use of Network Load balancing with the increase of site size according to different stages to use different technologies:

The first stage: using Nginx or Haproxy for a single point of load balancing, this stage of the server scale just out of the single-server, single-database mode, requires a certain load balancing, but still small, no professional maintenance team to maintain, there is no need for large-scale site deployment. This use of Nginx or Haproxy is the first choice, at this time these things get started fast, easy to configure, on the seven layer above the use of HTTP protocol can. This is the first choice.

The second stage: with the further expansion of network services, then the single-point Nginx can not meet, when using LVS or commercial F5 is the primary choice, nginx at this time as LVS or F5 node to use, specific LVS or F5 is the choice is based on the company size, Talent and capital ability to choose, here also do not do in detail, but generally this phase of the relevant talent to keep up with the business, so the purchase of commercial load balance has become the only way.

The third stage: The Network Service has become the mainstream products, at this time with the company's popularity is further expanded, the ability of relevant talents and the number of the increase, then regardless of the development of their own product customization, and reduce the cost of the open source LVs, has become the first choice, then LVS will become the mainstream.

The final formation of a more ideal state is: F5/lvs<->haproxy<->squid/varnish<->appserver.

Nginx,lvs,haproxy, load Balancing options

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.