It belongs to haproxy apache.

First, the advantages of lvs: 1, strong load resistance, because the logic of lvs's working mode is very simple, it only works at the fourth layer of the network to distribute requests, and there is no traffic, so there is basically no need to consider too much in efficiency. In my lvs, there is only one problem: the equalizer loses packets in a short time with the highest concurrency, which is analyzed as a network problem, that is, the bearing capacity of the network card or linux2.4 kernel has reached the upper limit, and there is basically no consumption of memory and cpu. 2. Low configurability is usually a big disadvantage, but it is also a big advantage. Because there are not many configurable options, there is no need to contact frequently except adding or deleting servers, which greatly reduces the probability of human error. 3. stable work. Because of its strong load resistance, it is logical to have high stability. In addition, all kinds of LV have complete dual-machine hot standby scheme, so there is no need to worry about the equalizer itself. If the node fails, lvs will judge automatically, so the whole system is very stable. 4, no flow, as mentioned above. Lvs only distributes requests, and the traffic will not go out by itself, which can be used to do some line diversion. There is no traffic, and at the same time, the IO performance of the equalizer is not affected by large traffic. 5. Basically all applications can be supported. Because lvs works at Layer 4, it can balance the load of almost all applications, including http, database, chat room and so on. In addition, lvs can't completely distinguish node failures. For example, in wlc distribution mode, one node in the cluster is not configured with VIP, which will make the whole cluster unavailable. At this time, using wrr distribution mode will lose a machine. At present, this problem is still being further tested. So it's better to be careful when using lvs. Secondly, the comparison between nginx and lvs shows that nginx works at the seventh layer of the network, so it can make diversion strategies for the http application itself, such as domain name and directory structure. In contrast, lvs has no such function, so nginx can be used in far more occasions than lvs. But these useful functions of nginx make it more adjustable than lvs, so it often needs contact. From the second advantage of lvs, if you have more contact, the probability of human problems will be greater. 2.nginx is less dependent on the network. Theoretically, as long as the ping is normal and the webpage access is normal, nginx can connect. At the same time, nginx can distinguish between internal network and external network. If it is a node with both internal network and external network, it is equivalent to a single machine with a backup line. Lvs is more dependent on the network environment. At present, the servers are in the same network segment and lvs adopts direct diversion, and the effect can be guaranteed. In addition, it should be noted that lvs needs to apply for at least one more ip from the custodian to do visual IP, and it seems impossible to do VIP with its own IP. To be an excellent LVS administrator, you really have to follow up and learn a lot about network communication, which is not as simple as HTTP. 3.nginx installation configuration is relatively simple, and it is also very convenient to test, because basically you can print out the errors with logs. It takes a long time to install, configure and test lvs, because as mentioned above, lvs is very dependent on the network. Many times the failure to configure LVS is due to network problems rather than configuration problems, and it will be a lot of trouble to solve the problems. 4.nginx can also bear high load and is stable, but there are several differences between load and stable lvs: nginx handles all traffic, so it is limited by machine IO and configuration; Bug itself is inevitable; Nginx has no ready-made dual-machine hot standby scheme, and the single-machine operation is still risky, and everything on the single machine is hard to say. 5.nginx can detect the internal faults of the server, such as the status code and timeout returned by the web page, according to the processing situation of the server, and will resubmit the request for returning the error to another node. At present, ldirectd in lvs can also support monitoring the internal situation of the server, but the principle of lvs makes it impossible to resend the request. For example, a user is uploading a file, and the node that handles the upload fails during the upload process. Nginx will switch the upload to another server for reprocessing, and lvs will directly disconnect. Users may be annoyed if they upload large or important files. 6.nginx's asynchronous processing of requests can help the node server reduce the load. If apache is used to directly serve the outside world, the apache server will occupy a lot of memory but will not release it when there are many narrow-band links. If nginx is used as an apache proxy, these narrow-band links will be blocked by nginx, and apache will not accumulate too many requests, thus reducing memory occupation. Squid has the same effect, even if squid itself is configured with no cache, it is still very helpful to apache. Without these functions, lvs cannot be compared. 7.nginx can support http and email (the function of email is estimated to be less used by people), and lvs will support more applications than nginx in this respect. In use, the strategy generally adopted by the front end should be lvs, that is, the direction of DNS should be lvs equalizer, and the advantages of lvs make it very suitable for this task. Important ip addresses, such as the ip of the database and the ip of the webservice server, are best managed by lvs. With the passage of time, these ip addresses will be used more and more widely, and if ip is changed, faults will follow. Therefore, it is safest to hand over these important IPS to lvs for hosting. The only disadvantage of this is that you need more VIPs. Nginx can be used as lvs node machine, and its function and performance can be utilized. Of course, squid can also use this level directly. Squid is much weaker than nginx in function and performance. Nginx can also act as a middle-level agent. At this level, nginx basically has no rivals, and the only one that can shake nginx is lighttpd. However, lighttpd has not yet achieved the full function of nginx, and the configuration is not so clear and easy to read. In addition, the IP of the middle-level agent is also very important, so having a VIP and lvs for the middle-level agent is the most perfect solution. Nginx can also be used as a static web server, but this is beyond the scope of this article. Let me mention it briefly. The specific application has to be analyzed in detail. If it is a relatively small website (daily PV