当前位置:网站首页>LVS four layer load balancing cluster (4) main methods of load balancing
LVS four layer load balancing cluster (4) main methods of load balancing
2022-06-13 03:39:00 【51CTO】
http Redirect
principle
Download websites more often , In fact, it is also a kind of load balancing , Work in the business code of the application layer According to the user's http Request to compute a real web Server address , And put the web Server address write http The redirect response is returned to the client browser , Revisited by browser

Advantages and disadvantages
advantage : Relatively simple
shortcoming : The client browser needs to request the server many times to complete an access , Poor performance .
http The processing capacity of the redirection server itself may become a bottleneck .
Use http302 Response redirection , It is possible for search engines to judge that SEO cheat , Reduce search rankings .
DNS Load balancing
principle
DNS The payload provides domain names to IP Analytical process , In fact, this is the time when we check Baidu's domain name resolution DNS The server also acts as a load balancer , The intelligence provided by many domain name operators dns And multiline analysis are all based on DNS Load balancing technology , Open source BIND It can provide powerful technologies such as telecom Unicom multi line analysis .
stay DNS Multiple domain names are configured on the server IP The record of . For example, a domain name www.baidu.com Corresponding to a group of web The server IP Address , Domain name resolution through DNS The server's algorithm allocates a domain name request to an appropriate real server .


Advantages and disadvantages
advantage :
It's up to DNS, It saves the trouble of website management and maintenance of load balancing server , At the same time, many DNS It also supports domain name resolution based on geographical location , Resolve the domain name to the server address closest to the user's geography , Speed up access , improve performance .
shortcoming :
current DNS Parsing is multistage parsing , Each level DNS It's possible to cache records A, When a server is offline , The server corresponds to DNS Record A There may still be , Causes the user assigned to the server to fail to access .
DNS The control of load balancing is in the hands of domain name service providers , The website may not be able to make too much improvement and management .
The load cannot be distributed according to the processing capacity of the server .DNS Load balancing uses a simple polling algorithm , Can't tell the difference between servers , Cannot reflect the current running state of the server , So its load balancing effect is not very good .
May cause additional network problems . In order to make Ben DNS Servers and others DNS The server interacts in a timely manner , Guarantee DNS The data is updated in time , Enable random assignment of addresses , Generally, we have to DNS The refresh time of is set smaller , But being too small will make DNS The increase in traffic causes additional network problems .
Reverse agent load balancing
principle :
The reverse proxy is in web On the server side , The reverse proxy server provides the function of load balancing , Manage a group at the same time web The server , It forwards the requested browser access to different web The server processes , The processing results are returned to the browser through the reverse server .
for example : The address of the browser access request is the address of the reverse proxy server 114.100.80.10, The reverse proxy server received the request , After the load balancing algorithm, a real physical address is obtained 10.0.0.3, And send the request result to the real server , After the real server finishes processing, it returns to the requesting user through the reverse proxy server .

Advantages and disadvantages
advantage :
Simple deployment , be in http Agreement level .
shortcoming :
After using the reverse proxy server ,web The server address cannot be directly exposed , therefore web The server doesn't need to use external IP Address , As a communication bridge, reverse proxy service needs to be configured with dual network cards 、 Two sets of external and internal IP Address .
IP Network layer load balancing
principle
At the network layer and transport layer (IP And port ) Load balancing by modifying the target address . The user access request arrives at the load balancing server , The load balancing server obtains network packets in the kernel process of the operating system , Get a real server address according to the algorithm , Then modify the target address requested by the user to the real server address , The data is returned to the load balancing server after processing , After receiving the response, the load balancing server modifies its address to the original user access address, and then returns the data . Similar to reverse server load balancing .

Advantages and disadvantages
advantage : When responding to requests, it is faster than reverse server load balancing .
shortcoming : Unable to process more advanced requests
Data link layer load balancing
principle
Modify at the data link layer Mac Address load balancing . Load balancing server IP And what it manages web Virtual of service cluster IP Agreement ; In the process of load balancing data distribution, the access address is not modified IP Address , It's modification Mac Address ; Through these two points, the normal access can be carried out without modifying the original address and target address of the data packet .

Advantages and disadvantages
advantage :
No load balancing server is required IP Address translation .
Data response , No need to go through load balancing server .
shortcoming :
The network card bandwidth requirements of the load balancing server are high .
F5 Hardware load balancing
principle
F5 BIG-IP Provide 12 A flexible algorithm distributes all traffic evenly to each server , And facing users , Just a virtual server .
Physical examination .F5 BIG-IP You can confirm whether the application can return the corresponding data to the request . If F5 BIG-IP A service stop occurred on one of the following servers 、 Crash, etc ,F5 It will check and identify the server as down , Thus, the user's access request is not transmitted to the failed server . such , As long as the other servers work properly , The user's access will not be affected . Once the downtime is repaired ,F5 BIG-IP It will automatically verify that the application ensures the correct response to the customer's request and resume transmission to the server .
F5 BIG-IP It's dynamic Session Session hold function , The author is also used in the website F5 Will the user IP And Session adopt F5 Binding made , Make it Session bring into correspondence with .
F5 BIG-IP Of iRules The function can do HTTP Content filtering , According to different domain names 、URL, Send access requests to different servers .
Advantages and disadvantages
advantage : Good performance
shortcoming : The high cost , Configuration redundancy
Four layer load and seven layer load
The so-called four levels are based on IP+ Port load balancing , The main representatives are lvs.
Seven layer load is also called content exchange , Is based on URL Load balancing of application layer information , The main representatives are nginx.

Load balancing & agent
Load balancing is also called proxy , It's a kind of agency .
Forward agency
Only used to proxy internal network pairs Internet Connection request for , The client must specify a proxy server , And send it directly to Web On the server http The request is sent to the proxy server , A forward proxy is a client proxy , It is a proxy method controlled and known by the user , If I cannot access fb, Then a foreign server is used as a springboard , Finally, the successful access is the forward proxy .
Reverse proxy
To accept as a proxy server Internet Connection request on , Then forward the request to the server on the internal network ; And return the results from the server to the Internet Clients requesting connections on , At this time, the proxy server is represented as a server , Reverse proxy refers to the server-side proxy , Behind large websites, there is not only one machine to provide services , For example, I visit Weibo , A reverse proxy server of Weibo parses me to a machine of the internal server , Then the machine provides me with microblog messages ( Of course, the actual situation is much more complicated than this ), These are invisible to the user , We will only feel that there is only one machine interacting with me .
边栏推荐
- Spark optimization - Troubleshooting
- MySQL 8.0 enables remote root user access and solves the problem of you are not allowed to create a user with Grant
- Doris' table creation and data division
- Pollution discharge fees of listed companies 2010-2020 & environmental disclosure level of heavy pollution industry - original data and calculation results
- An error is reported in the JDBC connection database: connection to 139.9.130.37:15400 referred
- Azure SQL db/dw series (12) -- using query store (1) -- report Introduction (1)
- Prefecture level city - air flow coefficient data - updated to 2019 (including 10m wind speed, boundary height, etc.)
- To resolve project conflicts, first-class project managers do so
- Use of Oracle PL-SQL
- Use of file class
猜你喜欢

Get to know druid IO real time OLAP data analysis storage system
![[azure data platform] ETL tool (7) - detailed explanation of ADF copy data](/img/d1/7c35e77a2b4f06dd9cef918da1104e.jpg)
[azure data platform] ETL tool (7) - detailed explanation of ADF copy data

Graph data modeling tool

Data of all bank outlets in 356 cities nationwide (as of February 13, 2022)

Spark kernel (execution principle) environment preparation /spark job submission process

在JDBC连接数据库时报错:Connection to 139.9.130.37:15400 refused.

Panel data set of rural cities and towns: per capita consumption and expenditure of prefecture level cities 2012-2019 & rural data of provinces 2013-2019

Understanding the ongdb open source map data foundation from the development of MariaDB

【youcans 的 OpenCV 例程200篇】201. 图像的颜色空间转换

基于华为云物联网设计的浇花神器(STM32+ESP8266)
随机推荐
Domestic zynq standalone pl-ps interrupt commissioning
Scala method and function notes
ip地址及分类
(9) Explain broadcasting mechanism in detail
Yolov5 face+tensorrt: deployment based on win10+tensorrt8.2+vs2019
Neil eifrem, CEO of neo4j, interprets the chart data platform and leads the development of database in the next decade
MySQL learning summary 10: detailed explanation of view use
Advanced API review
C language programming - input a string arbitrarily from the keyboard, calculate the actual number of characters and print out. It is required that the string processing function strlen() cannot be us
Understanding the ongdb open source map data foundation from the development of MariaDB
Complex network analysis capability based on graph database
SQL injection case demonstration and preventive measures
Part II. S3. intuitionistic fuzzy multi-attribute decision-making method when attribute weight is intuitionistic fuzzy number
简述:分布式CAP理论和BASE理论
MapReduce internal execution principle
Dish recommendation system based on graph database
C language programming -- input a string (including letters, numbers, punctuation marks, and space characters) from the keyboard, calculate the actual number of characters and print out, that is, it d
[azure data platform] ETL tool (5) -- use azure data factory data stream to convert data
Explain usage, field explanations, and optimization instances of MySQL
Scala sets (array, list, set, map, tuple, option)