Similarities and differences between nginx and lvs

http://blog.csdn.net/BuquTianya/article/details/52076153
http://blog.51cto.com/4593973/1419072

nginx is used as a reverse proxy for http, which can upsteam implement various ways of http requests Balanced forwarding. Due to the use of asynchronous forwarding, if a server request fails, it will immediately switch to other servers until the request succeeds or the last server fails. This can maximize the request success rate of the system.

LVS adopts the strategy of synchronous request forwarding. Here is the difference between synchronous forwarding and asynchronous forwarding. Synchronous forwarding is that after the lvs server receives the request, it immediately redirects to a back-end server, and the client directly establishes a connection with the back-end server. Asynchronous forwarding means that nginx initiates a new request with the same content to the backend while maintaining the client connection. After the backend returns the result, nginx returns it to the client.

Further: when nginx and lvs as load balancing servers process the same request, all request and response traffic will go through nginx; but when lvs is used, only the request traffic will go through the lvs network, and the response traffic will go through the backend server's network return.

That is, when the backend server is huge, the network bandwidth of nginx becomes a huge bottleneck.

But if only lvs is used as load balancer, once there is a problem with the server that receives the request in the backend, the request will fail. However, if a layer of nginx (multiple) is added to the back end of lvs, and each nginx back end has several application servers, then combining the advantages of the two can not only avoid the bottleneck of single nginx traffic concentration, but also avoid single nginx traffic concentration bottleneck. The problem of one-shot buying and selling in lvs.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326169764&siteId=291194637