Load balancing, high availability, and expansion of the access layer

1. Load balancing at the access layer

  1. Use the reverse proxy of nginx to realize the load balancing of the site-level web-server. Load balancing algorithms include: random, polling, static weight, consistent hash, etc.
  2. The implementation of load balancing at the access layer is dependent on LVS load balancing (operating system level, better than nginx application layer performance)
  3. Use F5 (hardware level, performance is better than LVS)

2. High availability of the access layer

  1. Regardless of whether you use LVS or F5, although the performance is much better than nginx, there are still single problems. Need to use keepalived + VIP to ensure high availability
    Insert picture description here

3. Expansion of the access layer

  1. Although high availability and load balancing are now achieved, it is still limited by the performance of an LVS or an F5. What if more requests come in? The answer is to use DNS polling to achieve horizontal scaling.
    Insert picture description here

4. How to improve utilization

The VIP + keepalived method only has a utilization rate of 50%. How to increase the utilization rate? The answer is the dual-virtual IP+dns polling method.

  1. 10.58.0.1 This virtual IP is mainly used by machine A and machine B is the backup
  2. 10.58.0.2 This virtual IP is mainly machine B, machine A is the backup
  3. DNS polls these two virtual IPs
  4. In this way, the utilization rate of the machine is 100%. If machine A has a problem, 10.58.0.1 will bring up machine A and cut the flow to machine B; while 10.58.0.2 can still be machine B.

Five, reference

Refer: https://www.cnblogs.com/codeon/p/7344287.html

Guess you like

Origin blog.csdn.net/hudmhacker/article/details/107367326