Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is load balancing? What are the strategies?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

What is load balancing? What are the strategies? Load balancing refers to the average distribution of multiple operating units for execution, such as Web servers, FTP servers, enterprise critical application servers and other critical task servers, so as to complete work tasks together. Based on the existing network structure, it provides a cost-effective way to expand the bandwidth of network equipment and servers, increase throughput, enhance network data processing capacity, and improve network flexibility and practicability.

What are the strategies of load balancing? To implement the load balancing requirement is to request to reach a different network server. There are so many links in a request to the cluster server that there are many ways to keep it.

There are five countermeasures for load balancing.

1. Polling (default setting) each request is dispatched to a different back-end network server one by one in order. If the back-end development network server down is off, it can be automatically removed.

2. Specific weight, specific polling probability, weight and browsing ratio are proportional, which are used in the case of uneven performance of back-end development network servers.

3. IP is associated with ip_hash, and each request is assigned according to the hash result of browsing ip, so that each pageview is fixed by browsing a back-end development network server, which can deal with session problems.

4. Fair (third party) dispatches requests according to the response speed of the back-end development network server, and the one with short response speed is preferred.

5. Url_hash (third party) dispatches requests according to the hash results of browsing url, so that each url is directed to the same back-end development network server, which is more useful when the back-end development network server is the cache file.

Ways in which load balancing can be achieved

HTTP redirect load balancer has a redirect network server, which is also a general network server. Its only function is to calculate the detailed address of a network server in the cluster server according to the customer's HTTP request, and write this detailed address back to the customer in the HTTP redirection response.

This kind of planning scheme is also relatively simple to implement, but it can only be carried out by using a computer browser to request a web server twice. And redirect network server is very easy to write a program to encounter shortcomings, because a redirect return of the whole process, is a standard HTTP request, if there are 10 devices in the cluster server, then the HTTP redirect network server traffic will be 10 times that of the application server, if there are 100 may crash, so scalability performance is greatly limited. Use the 302 response code to redirect the adverse URL SEO.

DNS domain name resolution load balancing

It is a planning scheme that uses DNS to solve domain name resolution requests and load balancing solutions at the same time. There are several A records in DNS, and each domain name resolution request is based on the load balancing optimization algorithm to calculate a different ip address return.

The advantage of DNS domain name resolution load balancer is that it transfers load balancer work to DNS, which eliminates the inconvenience of website management and maintenance of load balancer network servers. In addition, intelligent DNS can be used to resolve domain names based on location or ISP. Customers will get a server address that is recent or faster, which can accelerate the opening speed of customers' websites and improve performance.

However, this kind of method will also encounter some disadvantages. DNS is multi-level parsing, and each level is a cache file DNS record. If a network server changes, the DNS record will take a long time to upgrade, depending on the domain name registrar. Generally, commercial websites use DNS domain name resolution as a first-level load balancing method. You can use dig to query the A record of a domain name, and you will find that many websites have several A records.

Reverse proxy load balancing

This method means that the reverse proxy network server is used, which is generally in front of the web network server, which happens to be the location of the load balancing network server, so most reverse proxy network servers also provide load balancing. Because the web network server does not provide access to the outside immediately, the web network server does not need to use external IP, while the reverse proxy network server must be equipped with dual network cards and two sets of ip addresses inside and outside.

The reverse proxy network server shares the request in the HTTP protocol, so it is also called application layer load balancing. Because the application layer is in the seventh layer of the seven-layer network model, it is generally called seven-layer load balancing. The advantage is that it is integrated with the reverse proxy function network server, and the deployment is easy to understand. The disadvantage is that the reverse proxy network server is the transit station for all requests and responses, and its performance will become a deficiency.

Network layer load balancing

This method carries out load balancing in the network layer according to changing the detailed address of the request target. The network layer is in the fourth layer of the seven-layer network layer model, so it is also known as four-layer load balancing, also known as IP layer load balancing.

After requesting the load balancing network server, the load balancing network server obtains the Internet data files in the core system process of the computer operating system, obtains the detailed address of a real web network server according to the load balancing optimization algorithm, and then changes the detailed address of the requested destination to the real web server address until the web network server solution is carried out. The response packet returns to the load balancer network server, and then modifies the source address of the packet to its own IP (IP of the load balancer network server) and sends it to the customer browser.

The key here is how the real powerless web network server responds to the packet back to the load balancing network server. One is source address translation (SNAT), and the other is load balancing network server as gateway server. The load balancing of the network layer forwards statistical data in the core system process, which has stronger performance. However, because the traffic that does not respond to the request has to pass through the load balancing network server, it is very easy to become a deficiency.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report