Excellent
Point |
1 , working on the 7 layer of the network, can be targeted for HTTP applications to do some diversion strategy, such as for the domain name, directory structure, its regular rules than haproxy more powerful and flexible, which is one of the main reasons for its widespread popularity, The nginx can be used more than LVS on this occasion. 2 , nginx dependence on the stability of the network is very small, in theory can ping the load function can be, this is one of its advantages; on the contrary, LVS rely on the stability of the network is relatively large, I have deep experience; 3 , Nginx installation and configuration is relatively simple, easy to test, it can basically make the error with the log print out. LVS configuration, testing will take a relatively long time, LVS on the network dependence is relatively large. 3 , can bear high load pressure and stability, in the case of hardware is generally able to support tens of thousands of times the concurrency, the load is relatively smaller than LVS. 4 , Nginx can detect the server internal faults through the port, for example, according to the server processing the status code returned by the Web page, timeout, etc., and will return the wrong request back to another node, but the disadvantage is that the URL is not supported to detect. For example, the user is uploading a file, and processing the upload node just in the upload process failure, Nginx will upload to another server to re-processing, and LVS directly broken off, if it is to upload a large file or very important files, users may be dissatisfied. 5 , Nginx is not only a good load balancer/reverse proxy software, it is also a powerful Web application server. Lnmp is also a very popular web architecture in recent years and has a good stability in high-traffic environments. 6 , Nginx is now more and more mature as the Web reverse acceleration cache, faster than the traditional squid server, you can consider using it as a reverse proxy accelerator. 7 , Nginx can be used as a middle-class reverse proxy, this level nginx basically no opponent, only can compare Nginx only lighttpd, but lighttpd at present has not done nginx full function, configuration is not so clear and easy to read, Community information is far from Nginx active. 8, Nginx can also be used as a static web page and image server, this aspect of performance is no opponent. The Nginx community is very active and there are many third-party modules. |
1 , anti-load capacity, is the work in the Network 4 layer only for distribution, no traffic generated, this feature also determines its performance in the Load Balancer software is the strongest, the memory and CPU resource consumption is low. 2 , low-profile, 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, because of its own resistance to load capacity is very strong, its own complete two-machine hot-standby program, such as Lvs+keepalived, but we in the implementation of the project is the most used or lvs/dr+keepalived. 4 , no traffic, LVS only distributes the request, and the traffic does not go out from it, which guarantees that the performance of the Equalizer IO will not be affected by large traffic. 5 , the application scope is wide, because LVS is working on the 4 layer, so it can load balance almost all applications, including HTTP, database, online chat room and so on. |
1 and Haproxy are also supported for virtual hosts. 2 , the advantages of haproxy can be supplemented with some of Nginx's shortcomings, such as supporting session retention, cookie guidance, and support to detect the status of the backend server by obtaining the specified URL. 3 , haproxy similar to LVS, itself is just a load balancer software, simply from the efficiency of haproxy will be better than nginx load balancing speed, in concurrent processing is better than nginx. 4 , Haproxy support the TCP protocol load balanced forwarding, can load balance MySQL read, the backend of the MySQL node detection and load balancing, you can use lvs+keepalived to load balance MySQL master and slave. 5 , Haproxy Load Balancing strategy is very many, the Haproxy load balancing algorithm now has the following 8 kinds of specific: ①roundrobin, said the simple polling, this is not much to say, this is the load balancer basically have; ②STATIC-RR, said according to the weight, suggest concern; ③leastconn, indicating that the minimum number of connections to deal with, suggest concern; ④source, according to the request source IP, this is similar to Nginx's ip_hash mechanism, we use it as a way to solve the session problem, it is recommended to pay attention to; ⑤ri, which represents the URI according to the request; ⑥rl_param, which represents the URL parameter according to the request ' balance Url_param ' requires an urlparameter name; ⑦HDR (name), which indicates that each HTTP request is locked according to the HTTP request header; ⑧rdp-cookie (name), which indicates that each TCP request is locked and hashed according to the cookie (name). |