Why do you need lvs? when you have nginx?

I understand that lvs is a four-tier load balancer and nginx is a layer 7, but I still can"t understand why we still need lvs? when there is nginx. Are there any good examples to understand?

Jul.03,2021

personal understanding:

    lvs
    nginx:

in fact, what to use is determined according to the business scenario and requirements. As long as what suits you is the best, nothing is better than everything.


  1. LVS supports modes such as DR, TUN
    these two modes make it unnecessary for Director to be equipped with peer-to-peer network capacity
  2. layer 3 and layer 4 forwarding of LVS is more efficient than layer 7 of nginx

lvs supports layer 4 and layer 7 loads are very flexible and efficient.
nginx is a layer 7 load, so many complex situations cannot be satisfied because it works in the layer 7 application layer. For example, the open source version only supports http


php is the best language in the world, and I chose js
The principle of

is the same. Choose which one to use

according to the usage scenario.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b361e5-2ad31.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b361e5-2ad31.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?