sound isolation clips hat channel.HAProxy and its characteristics

sound isolation clips hat channel.HAProxy and its characteristics. HAProxy is a free, fast and reliable solution that provides high availability, load balancing and TCP-based and HTTP-based applications.

HAProxy is ideal for web sites with large concurrency (and more than a week of development), which usually require session persistence or seven-tier processing. The operation mode of HAProxy makes it easy and secure to integrate into the current architecture, while protecting web servers from being exposed to the network.

The main features of HAProxy are:

The reliability and stability are very good, which is comparable to the F5 load balancing equipment at the hardware level.

A maximum of 40000-50000 concurrent connections can be maintained at the same time, the maximum number of requests processed per unit time is 20000, and the maximum processing capacity can reach 10Git/s.

Supports up to 8 load balancing algorithms, as well as session persistence.

Support virtual host function, which makes web load balancing more flexible.

Support unique features such as connection rejection, fully transparent proxy, etc.

Has strong ACL support for access control.

Because of its unique elastic binary tree data structure, the complexity of the data structure increases to 0 (1), that is, the search speed of the data will not decrease with the increase of data entries.

Support the keepalive function of the client, reduce the waste of resources caused by multiple three-way handshakes between the client and haproxy, and allow multiple requests to be completed in one tcp connection.

Support TCP acceleration, zero replication function, similar to mmap mechanism.

Support for response pools (response buffering).

Support for RDP protocol.

Based on the stickiness of the source, similar to the ip_hash function of nginx, requests from the same client are always dispatched to the same server upstream within a certain period of time.

Better statistical data interface, whose web interface displays the statistical information of receiving, sending, rejecting, error and other data of each server in the back-end cluster.

Detailed health status detection. The web interface contains information about the health detection status of upstream servers and provides certain management functions.

Flow-based health assessment mechanism.

Based on http authentication.

Management interface based on command line.

Log analyzer, which can analyze the log.

Briefly describe the common load balancing strategies of HAProxy?

There are many HAProxy load balancing strategies. The common ones are as follows:

Roundrobin: represents a simple poll.

Static-rr: according to weight.

Leastconn: indicates that those with the least connections will be dealt with first.

Source: indicates that according to the source IP of the request, it is similar to the IP_hash mechanism of Nginx.

Ri: indicates the URI according to the request.

Rl_param: indicates that each HTTP request is locked according to the HTTP request header.

Rdp-cookie (name): indicates that each TCP request is locked and hashed according to cookie (name).

Briefly describe the difference between layer 4 and layer 7 of load balancing?

Layer 4 load balancer, also known as layer 4 switch, mainly analyzes the traffic of IP layer and TCP/UDP layer to achieve load balancing based on IP plus port, such as common LVS, F5 and so on.

Layer 7 load balancer, also known as layer 7 switch, is located in the highest layer of OSI, that is, the application layer. This load balancer supports a variety of protocols, such as HTTP, FTP, SMTP and so on. Layer 7 load balancer can select the back-end server, that is, "content switch", according to the content of the message and certain load balancing algorithm. Such as HAProxy, Nginx.

What are the similarities and differences among LVS, Nginx and HAproxy?

Same: all three are software load balancing products.


LVS implements soft load balancing based on Linux operating system, while HAProxy and Nginx implement soft load balancing based on third-party applications.

LVS is an IP load balancing technology that can realize layer 4, but it cannot realize directory-based and URL-based forwarding. Both HAProxy and Nginx can implement layer 4 and layer 7 technologies, and HAProxy can provide a comprehensive load balancing solution for TCP and HTTP applications.

Because LVS works in the fourth layer of ISO model, its state monitoring function is single, while HAProxy is more rich and powerful in shape monitoring, and can support port, URL, script and other state detection methods.

HAProxy is powerful, but its overall performance is lower than that of LVS load balancing in layer 4 mode.

Nginx is mainly used for Web servers or cache servers.

A brief description of Heartbeat?

Heartbeat is a component of the Linux-HA project, which provides functions such as heartbeat detection and resource takeover, monitoring of services in the cluster, failure switching and so on. The core function of heartbeat includes two parts, heartbeat monitoring and resource takeover. Heartbeat monitoring can be carried out through network links and serial ports, and redundant links are supported. They send messages to each other to tell each other their current status. If the message sent by the other party is not received within a specified period of time, then the other party is considered to be invalid. At this time, it is necessary to start the resource takeover module to take over the resources or services running on the other host.