WO2021052199A1 - Server load balancing method and apparatus, and cdn node - Google Patents

Server load balancing method and apparatus, and cdn node Download PDF

Info

Publication number
WO2021052199A1
WO2021052199A1 PCT/CN2020/113598 CN2020113598W WO2021052199A1 WO 2021052199 A1 WO2021052199 A1 WO 2021052199A1 CN 2020113598 W CN2020113598 W CN 2020113598W WO 2021052199 A1 WO2021052199 A1 WO 2021052199A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
bandwidth
load information
weight
load balancing
Prior art date
Application number
PCT/CN2020/113598
Other languages
French (fr)
Chinese (zh)
Inventor
朱志文
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2021052199A1 publication Critical patent/WO2021052199A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Definitions

  • the embodiments of the present application relate to, but are not limited to, Content Delivery Network (CDN, Content Delivery Network) technology, and more specifically relate to a method, device, and CDN node for server load balancing.
  • CDN Content Delivery Network
  • a load balancing module (Load Balance) is usually set in a node to schedule the resources of each server in the node.
  • Load Balance a load balancing module
  • the load balancing module of the node is required to face A variety of servers with different disk capacities, different bandwidths, and different CPU (central processing unit) processing capabilities can still function, and maximize the use of all server resources.
  • Load Balance can ensure the average use of the resources of each server, but because each server has different hardware, there will always be a server Be the first to reach the performance bottleneck (disk IO, disk space, CPU, network port bandwidth, etc.). Once the bottleneck is reached, Load Balance will not continue to schedule content to this server, so the following situation will occur: (1) A server is the first to reach Performance bottlenecks may cause downtime; (2) If one server has less performance, other servers will need to share the additional performance consumption, which will aggravate the burden on other servers, which will cause the second server to reach The performance bottleneck caused the downtime, then the third, fourth... This is a chain reaction, and finally caused a lot of losses.
  • an embodiment of the present application provides a server load balancing method, which is applied to a CDN node of a content distribution network including n heterogeneous servers, and includes: obtaining load information of each of the n heterogeneous servers, The load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth; load balancing is performed according to the respective load information of the n heterogeneous servers.
  • An embodiment of the present application also provides a server load balancing device, which is applied to a CDN node of a content distribution network including n heterogeneous servers, and includes: an obtaining unit configured to obtain respective load information of the n heterogeneous servers, The load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth; a load balancing unit is used to perform load balancing according to the respective load information of the n heterogeneous servers.
  • the embodiment of the application also provides a CDN node of a content distribution network, including: n heterogeneous servers; each server is provided with an acquisition module, one of the servers is provided with a load balancing module; each acquisition module is used to obtain Correspond to the load information of the server, and send the obtained load information to the load balancing module; wherein the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth; the load balancing module is used for Perform load balancing according to the respective load information of the n heterogeneous servers.
  • Figure 1 is a schematic diagram of the existing server load balancing structure
  • FIG. 2 is a schematic flowchart of a method for server load balancing according to an embodiment of the application
  • FIG. 3 is a schematic flowchart of a method for server load balancing according to another embodiment of this application.
  • FIG. 4 is a schematic flowchart of a method for server load balancing according to another embodiment of this application.
  • FIG. 5 is a schematic flowchart of a method for server load balancing according to another embodiment of this application.
  • FIG. 6 is an exemplary diagram of the mapping relationship between channel types and code rate weights in an embodiment of this application.
  • FIG. 7 is an example diagram of the maximum number of channels and the maximum channel inbound bandwidth of different types of devices in an embodiment of the application
  • FIG. 8 is a schematic structural diagram of a server load balancing apparatus provided by an embodiment of this application.
  • Fig. 9 is a schematic structural diagram of a CDN node of a content distribution network provided by an embodiment of the application.
  • FIG. 2 is a schematic flowchart of a method for server load balancing according to an embodiment of this application. As shown in FIG. 2, the method includes:
  • Step 201 Obtain load information of each of the n heterogeneous servers, where the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth;
  • Step 202 Perform load balancing according to the respective load information of the n heterogeneous servers.
  • the obtaining the load information of each of the n heterogeneous servers includes:
  • the performing load balancing according to the respective load information of the n heterogeneous servers includes:
  • the calculation of the content caching performance weight of each server according to the respective load information of the n heterogeneous servers includes:
  • Weight i a ⁇ WS i +b ⁇ WIO i +c ⁇ WB i ;
  • Weight i represents the content caching performance weight of the i-th server
  • WS i represents the space weight of the i-th server
  • WIO i represents the IO weight of the i-th server
  • WB i represents the bandwidth weight of the i-th server
  • space i represents the remaining disk space of the i-th server
  • io i represents the remaining disk input and output IO of the i-th server
  • bandwidth i represents the available bandwidth of the i-th server
  • i is an integer greater than or equal to 1 and less than or equal to n
  • weighting factor a, b, and c respectively represent the degree of influence of remaining disk space, remaining disk input/output IO, and available bandwidth bandwidth on server performance.
  • the performing load balancing according to the respective load information of the n heterogeneous servers includes:
  • the calculation of the content reading remaining capacity of each server according to the respective load information of the n heterogeneous servers includes:
  • Weight i d ⁇ WIO i +e ⁇ WB i ;
  • Weight i represents the remaining capacity to read the content of the i-th server
  • WIO i represents the IO weight of the i-th server
  • WB i represents the bandwidth weight of the i-th server
  • io i represents the remaining disk input and output IO of the i-th server
  • bandwidth i represents the available bandwidth of the i-th server
  • i is an integer greater than or equal to 1 and less than or equal to n
  • weight factors d and e represent the remaining disk input and output IO, available The degree of influence of bandwidth on server performance.
  • the performing load balancing according to the respective load information of the n heterogeneous servers includes:
  • the server with the smallest percentage of incoming bandwidth is selected to create the new channel.
  • the calculation of the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers includes:
  • inbandrate i (curInbandwidth i +inbandwidth)/mInbandwidth i
  • inbandrate i represents the percentage of the inbound bandwidth of the i-th server
  • curInbandwidth i represents the current inbound bandwidth of the i-th server
  • inbandwidth represents the inbound bandwidth that the new channel needs to occupy
  • mInbandwidth i represents the maximum inbound bandwidth of the i-th server bandwidth.
  • FIG. 3 is a schematic flowchart of a method for server load balancing according to another embodiment of the application.
  • the main functions of the server at present include content caching, content reading, network packet receiving and network packet sending, etc. These are the functions that various companies generally need to use in the field of server applications.
  • Content caching is to use network technology to pull files from other servers to this server, and use the file system to store the pulled files on the disk of this server.
  • the file format varies according to the different services carried on the server. In the process of content caching, resources such as server bandwidth, disk IO, disk space, etc. need to be used.
  • the CDN node includes n heterogeneous servers
  • the method includes:
  • Step 301 Obtain respective load information of the n heterogeneous servers
  • the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth.
  • the second column is the name of the directory, and the first column is the size of the disk space occupied by this directory (unit: Byte).
  • the last column indicates the disk usage rate (unit: %).
  • the send column represents the current outbound bandwidth (unit: Byte)
  • the recv column represents the current inbound bandwidth (unit: Byte). You need to add send and recv to indicate the currently used bandwidth; each line represents the current time Start every second the server sends and recv at this time.
  • Step 302 Calculate the content caching performance weight of each server according to the respective load information of the n heterogeneous servers;
  • the content caching performance weight of each server can be calculated according to the following formula:
  • Weight i a ⁇ WS i +b ⁇ WIO i +c ⁇ WB i ;
  • Weight i represents the content caching performance weight of the i-th server
  • WS i represents the space weight of the i-th server
  • WIO i represents the IO weight of the i-th server
  • WB i represents the bandwidth weight of the i-th server
  • space i represents the remaining disk space of the i-th server
  • io i represents the remaining disk input and output IO of the i-th server
  • bandwidth i represents the available bandwidth of the i-th server
  • i is an integer greater than or equal to 1 and less than or equal to n
  • weighting factor a, b, and c respectively represent the degree of influence of remaining disk space, remaining disk input/output IO, and available bandwidth bandwidth on server performance.
  • Step 303 Select the server with the largest content caching performance weight for content caching.
  • a server with the largest content caching performance weight can be selected to cache content according to the content caching performance weight of each server.
  • an acquisition module can be set on each server in the CDN node, and a load balancing module can be set on one of the servers.
  • the acquisition module on each server can periodically acquire the load information of the server and send it to the load balancing module, and the load balancing module calculates the content caching performance weight of each server.
  • Space i represents the remaining space of the i-th server (1 ⁇ i ⁇ n).
  • io i represents the remaining IO of the i-th server, and bandwidth i represents the available bandwidth of the i-th server.
  • the load balancing strategy selects a server with the largest content caching performance weight to cache content according to the weight of each server.
  • FIG. 4 is a schematic flowchart of a method for server load balancing according to another embodiment of this application.
  • the main functions of the server at present include content caching, content reading, network packet receiving and network packet sending, etc. These are the functions that various companies generally need to use in the field of server applications.
  • File sending means to read the file on the disk of this server and send it out through the network.
  • the network package sent out can be streamed or in the form of small files.
  • resources such as disk IO and bandwidth are required.
  • the CDN node includes n heterogeneous servers
  • the method includes:
  • Step 401 Obtain respective load information of the n heterogeneous servers
  • the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth.
  • Step 402 Calculate the content reading remaining capacity of each server according to the respective load information of the n heterogeneous servers;
  • the remaining capacity of each server can be calculated according to the following formula:
  • Weight i d ⁇ WIO i +e ⁇ WB i ;
  • Weight i represents the remaining capacity to read the content of the i-th server
  • WIO i represents the IO weight of the i-th server
  • WB i represents the bandwidth weight of the i-th server
  • io i represents the remaining disk input and output IO of the i-th server
  • bandwidth i represents the available bandwidth of the i-th server
  • i is an integer greater than or equal to 1 and less than or equal to n
  • weight factors d and e represent the remaining disk input and output IO, available The degree of influence of bandwidth on server performance.
  • Step 403 Select the server with the largest remaining capacity for content reading to send the file.
  • an acquisition module can be set on each server in the CDN node, and a load balancing module can be set on one of the servers.
  • the acquisition module on each server can periodically acquire the load information of the server and send it to the load balancing module.
  • the load balancing module calculates the remaining content reading capacity of each server, and selects the server with the largest content reading remaining capacity for file delivery.
  • FIG. 5 is a schematic flowchart of a method for server load balancing according to another embodiment of this application.
  • the main functions of the server at present include content caching, content reading, network packet receiving and network packet sending, etc. These are the functions that various companies generally need to use in the field of server applications.
  • This embodiment is applied to a scenario where a new channel needs to be created.
  • Network packet receiving and network packet sending that is, the server receives network packets from other servers, please send them directly after processing.
  • This kind of scenario is the most direct reference to the live broadcast of audio and video channels, and the server needs to use resources such as bandwidth and CPU.
  • the CDN node includes n heterogeneous servers
  • the method includes:
  • the method includes:
  • Step 501 Obtain respective load information of the n heterogeneous servers
  • the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth.
  • Step 502 Calculate the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers;
  • the inbound bandwidth percentage of each server can be calculated according to the following formula:
  • inbandrate i (curInbandwidth i +inbandwidth)/mInbandwidth i ;
  • inbandrate i represents the percentage of the inbound bandwidth of the i-th server
  • curInbandwidth i represents the current inbound bandwidth of the i-th server
  • inbandwidth represents the inbound bandwidth that the new channel needs to occupy
  • mInbandwidth i represents the maximum inbound bandwidth of the i-th server bandwidth.
  • the server can calculate the incoming bandwidth inbandwidth that the new channel actually needs to occupy according to the bit rate information of the code stream received by the newly created channel and the channel type.
  • the channel type and the bit rate weight can be mapped according to the server type, as shown in Figure 6.
  • the maximum inbound bandwidth mInbandwidth of the server can be determined according to the server type of the server and the preset server type and channel resource comparison table.
  • the maximum inbound bandwidth mInbandwidth of different types of devices can be pre-configured, as shown in Figure 7.
  • Step 503 Select the server with the smallest percentage of incoming bandwidth to create the new channel.
  • an acquisition module can be set on each server in the CDN node, and a load balancing module can be set on one of the servers.
  • the acquisition module on each server can periodically acquire the load information of the server and send it to the load balancing module.
  • the load balancing module sequentially obtains the inbandrates of the servers attached to all nodes, and selects the server with the smallest inbandrate to create a channel.
  • FIG. 8 is a schematic structural diagram of a server load balancing device provided by an embodiment of this application. As shown in FIG. 8, the device includes:
  • An obtaining unit configured to obtain respective load information of the n heterogeneous servers, where the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth;
  • the load balancing unit is configured to perform load balancing according to the respective load information of the n heterogeneous servers.
  • the obtaining unit is specifically configured to obtain the used disk space of each server by using the du command, and subtract the used space from the total disk space of each server to obtain the corresponding remaining disk space space;
  • the load balancing unit is specifically configured to calculate the content caching performance weight of each server according to the respective load information of the n heterogeneous servers when content caching is required;
  • the calculation of the content caching performance weight of each server according to the respective load information of the n heterogeneous servers includes:
  • Weight i a ⁇ WS i +b ⁇ WIO i +c ⁇ WB i ;
  • Weight i represents the content caching performance weight of the i-th server
  • WS i represents the space weight of the i-th server
  • WIO i represents the IO weight of the i-th server
  • WB i represents the bandwidth weight of the i-th server
  • space i represents the remaining disk space of the i-th server
  • io i represents the remaining disk input and output IO of the i-th server
  • bandwidth i represents the available bandwidth of the i-th server
  • i is an integer greater than or equal to 1 and less than or equal to n
  • weighting factor a, b, and c respectively represent the degree of influence of remaining disk space, remaining disk input/output IO, and available bandwidth bandwidth on server performance.
  • the load balancing unit is specifically configured to calculate the remaining content reading capacity of each server according to the respective load information of the n heterogeneous servers when a file package is required;
  • the calculation of the content reading remaining capacity of each server according to the respective load information of the n heterogeneous servers includes:
  • Weight i d ⁇ WIO i +e ⁇ WB i ;
  • Weight i represents the remaining capacity to read the content of the i-th server
  • WIO i represents the IO weight of the i-th server
  • WB i represents the bandwidth weight of the i-th server
  • io i represents the remaining disk input and output IO of the i-th server
  • bandwidth i represents the available bandwidth of the i-th server
  • i is an integer greater than or equal to 1 and less than or equal to n
  • weight factors d and e represent the remaining disk input and output IO, available The degree of influence of bandwidth on server performance.
  • the load balancing unit is specifically configured to calculate the inbound bandwidth of each server according to the respective load information of the n heterogeneous servers when a new channel needs to be created;
  • the server with the smallest incoming bandwidth is selected to create the new channel.
  • the calculation of the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers includes:
  • inbandrate i (curInbandwidth i +inbandwidth)/mInbandwidth i ;
  • inbandrate i represents the inbound bandwidth of the i-th server
  • curInbandwidth i represents the current inbound bandwidth of the i-th server
  • mInbandwidth i represents the maximum inbound bandwidth of the i-th server.
  • FIG. 9 is a schematic structural diagram of a CDN node of a content distribution network according to an embodiment of the application.
  • the CDN node includes: n heterogeneous servers;
  • Each server is provided with an acquisition module, and one of the servers is provided with a load balancing module;
  • Each obtaining module is used to obtain load information of the corresponding server, and send the obtained load information to the load balancing module;
  • the load information includes remaining disk space space, remaining disk input and output IO, and available bandwidth bandwidth;
  • the load balancing module is configured to perform load balancing according to the respective load information of the n heterogeneous servers.
  • the obtaining module is specifically configured to use the du command to obtain the used disk space in the corresponding server, and subtract the used space from the total disk space of the corresponding server to obtain the corresponding remaining disk space space;
  • the load balancing module is specifically configured to calculate the content caching performance weight of each server according to the respective load information of the n heterogeneous servers when content caching is required;
  • the calculation of the content caching performance weight of each server according to the respective load information of the n heterogeneous servers includes:
  • Weight i a ⁇ WS i +b ⁇ WIO i +c ⁇ WB i ;
  • Weight i represents the content caching performance weight of the i-th server
  • WS i represents the space weight of the i-th server
  • WIO i represents the IO weight of the i-th server
  • WB i represents the bandwidth weight of the i-th server
  • space i represents the remaining disk space of the i-th server
  • io i represents the remaining disk input and output IO of the i-th server
  • bandwidth i represents the available bandwidth of the i-th server
  • i is an integer greater than or equal to 1 and less than or equal to n
  • weighting factor a, b, and c respectively represent the degree of influence of remaining disk space, remaining disk input/output IO, and available bandwidth bandwidth on server performance.
  • the load balancing module is specifically configured to calculate the remaining content reading capacity of each server according to the respective load information of the n heterogeneous servers when a file package needs to be performed;
  • the calculation of the content reading remaining capacity of each server according to the respective load information of the n heterogeneous servers includes:
  • Weight i d ⁇ WIO i +e ⁇ WB i ;
  • Weight i represents the remaining capacity to read the content of the i-th server
  • WIO i represents the IO weight of the i-th server
  • WB i represents the bandwidth weight of the i-th server
  • io i represents the remaining disk input and output IO of the i-th server
  • bandwidth i represents the available bandwidth of the i-th server
  • i is an integer greater than or equal to 1 and less than or equal to n
  • weight factors d and e represent the remaining disk input and output IO, available The degree of influence of bandwidth on server performance.
  • the load balancing module is specifically configured to calculate the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers when a new channel needs to be created;
  • the server with the smallest percentage of incoming bandwidth is selected to create the new channel.
  • the calculation of the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers includes:
  • inbandrate i (curInbandwidth i +inbandwidth)/mInbandwidth i ;
  • inbandrate i represents the inbound bandwidth of the i-th server
  • curInbandwidth i represents the current inbound bandwidth of the i-th server
  • mInbandwidth i represents the maximum inbound bandwidth of the i-th server.
  • the technical solutions provided by the embodiments of the present application can prevent the avalanche effect caused by the downtime of a single point server in a node, and give full play to the performance of each server.
  • Such software may be distributed on a computer-readable medium, and the computer-readable medium may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium).
  • the term computer storage medium includes volatile and non-volatile data implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Sexual, removable and non-removable media.
  • Computer storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or Any other medium used to store desired information and that can be accessed by a computer.
  • communication media usually contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as carrier waves or other transmission mechanisms, and may include any information delivery media. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiments of the present application disclose a server load balancing method and apparatus, and a CDN node. Said method is applied to a content delivery network (CDN) node comprising n heterogeneous servers, and comprises: acquiring respective load information of the n heterogeneous servers, the load information comprising a remaining disk space, a remaining disk input and output (IO), and an available bandwidth; and performing load balancing according to the respective load information of the n heterogeneous servers.

Description

一种服务器负载均衡的方法、装置及CDN节点Method, device and CDN node for server load balancing
相关申请的交叉引用Cross-references to related applications
本申请基于申请号为201910881892.3、申请日为2019年9月18日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。This application is filed based on a Chinese patent application with an application number of 201910881892.3 and an application date of September 18, 2019, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby incorporated into this application by way of introduction.
技术领域Technical field
本申请实施例涉及但不限于内容分发网络(CDN,Content Delivery Network)技术,更具体地涉及一种服务器负载均衡的方法、装置及CDN节点。The embodiments of the present application relate to, but are not limited to, Content Delivery Network (CDN, Content Delivery Network) technology, and more specifically relate to a method, device, and CDN node for server load balancing.
背景技术Background technique
为了最大化的利用服务器资源,提高服务器整体的吞吐量,如图1所示,一个节点中通常会设置有一个负载均衡模块(Load Balance)负责调度节点内各个服务器的资源,一般选择当前负载最轻的服务器去提供服务,In order to maximize the use of server resources and improve the overall throughput of the server, as shown in Figure 1, a load balancing module (Load Balance) is usually set in a node to schedule the resources of each server in the node. Generally, the current load is the most important. Light servers to provide services,
随着业务量和用户量的增多,节点扩容已经成为了一个不可绕开的操作,但是在扩容新的服务器时,原有的设备类型可能已经停产,因此就要求节点的负载均衡模块在面对各种磁盘容量不同、带宽不同、CPU(中央处理器,central processing unit))处理能力不同的服务器时仍然能够发挥作用,尽量最大化的利用所有的服务器资源。With the increase of business volume and user volume, node expansion has become an operation that cannot be bypassed. However, when expanding new servers, the original equipment types may have been discontinued. Therefore, the load balancing module of the node is required to face A variety of servers with different disk capacities, different bandwidths, and different CPU (central processing unit) processing capabilities can still function, and maximize the use of all server resources.
对于相同型号的服务器组成的节点,由于节点管理的各个服务器的硬件配置都相同,因此在做负载均衡时可以保证各服务器使用的资源都是相同的,这就如同往几个相同容积的杯子里面加水,只要保证每个杯子里面加同样的水,就不会出现某个杯子的水很快灌满溢出。For a node composed of servers of the same model, since the hardware configuration of each server managed by the node is the same, it can be ensured that the resources used by each server are the same when doing load balancing, which is like going to several cups of the same volume Add water, as long as you ensure that the same water is added to each cup, the water in a certain cup will not quickly fill up and overflow.
对于异构节点,即多台不同性能服务器共同组成的内容分发网络节点(异构)的场景下,Load Balance能够保证平均使用各台服务器的资源,但是由于 各台服务器硬件不同,总会有服务器率先达到性能瓶颈(磁盘IO、磁盘空间、CPU、网口带宽等),一旦达到瓶颈Load Balance就不会继续向这台服务器调度内容,这样会出现下面的情况:(1)某台服务器率先达到性能瓶颈,有可能引发宕机;(2)少了一台服务器的性能,那么多出来的性能消耗就需要其他服务器来共同分担,会加剧其他服务器的负担,这样就会造成第二台服务器达到性能瓶颈引发宕机,然后是第三台、第四台...这是一个连锁反应,最后造成很大的损失。For heterogeneous nodes, that is, a content distribution network node (heterogeneous) composed of multiple servers with different performance, Load Balance can ensure the average use of the resources of each server, but because each server has different hardware, there will always be a server Be the first to reach the performance bottleneck (disk IO, disk space, CPU, network port bandwidth, etc.). Once the bottleneck is reached, Load Balance will not continue to schedule content to this server, so the following situation will occur: (1) A server is the first to reach Performance bottlenecks may cause downtime; (2) If one server has less performance, other servers will need to share the additional performance consumption, which will aggravate the burden on other servers, which will cause the second server to reach The performance bottleneck caused the downtime, then the third, fourth... This is a chain reaction, and finally caused a lot of losses.
发明内容Summary of the invention
有鉴于此,本申请实施例提供了一种服务器负载均衡的方法,应用于包括n个异构服务器的内容分发网络CDN节点,包括:获取所述n个异构服务器各自的负载信息,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth;根据所述n个异构服务器各自的负载信息进行负载均衡。In view of this, an embodiment of the present application provides a server load balancing method, which is applied to a CDN node of a content distribution network including n heterogeneous servers, and includes: obtaining load information of each of the n heterogeneous servers, The load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth; load balancing is performed according to the respective load information of the n heterogeneous servers.
本申请实施例还提供了一种服务器负载均衡的装置,应用于包括n个异构服务器的内容分发网络CDN节点,包括:获取单元,用于获取所述n个异构服务器各自的负载信息,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth;负载均衡单元,用于根据所述n个异构服务器各自的负载信息进行负载均衡。An embodiment of the present application also provides a server load balancing device, which is applied to a CDN node of a content distribution network including n heterogeneous servers, and includes: an obtaining unit configured to obtain respective load information of the n heterogeneous servers, The load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth; a load balancing unit is used to perform load balancing according to the respective load information of the n heterogeneous servers.
本申请实施例还提供了一种内容分发网络CDN节点,包括:n个异构服务器;每一服务器上设置有获取模块,其中一个服务器上设置有负载均衡模块;每一个获取模块,用于获取对应服务器的负载信息,并将获取的负载信息发送给所述负载均衡模块;其中,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth;所述负载均衡模块,用于根据所述n个异构服务器各自的负载信息进行负载均衡。The embodiment of the application also provides a CDN node of a content distribution network, including: n heterogeneous servers; each server is provided with an acquisition module, one of the servers is provided with a load balancing module; each acquisition module is used to obtain Correspond to the load information of the server, and send the obtained load information to the load balancing module; wherein the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth; the load balancing module is used for Perform load balancing according to the respective load information of the n heterogeneous servers.
本发明本申请的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本申请而了解。本申请的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the present application of the present invention will be described in the following description, and partly become obvious from the description, or understood by implementing the present application. The purpose and other advantages of the application can be realized and obtained through the structures specifically pointed out in the specification, claims and drawings.
附图说明Description of the drawings
附图用来提供对本申请技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本申请的技术方案,并不构成对本申请技术方案的限制。The accompanying drawings are used to provide a further understanding of the technical solution of the present application, and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application, and do not constitute a limitation to the technical solution of the present application.
图1为现有服务器负载均衡的结构示意图;Figure 1 is a schematic diagram of the existing server load balancing structure;
图2为本申请一实施例提供的一种服务器负载均衡的方法的流程示意图;2 is a schematic flowchart of a method for server load balancing according to an embodiment of the application;
图3为本申请另一实施例提供的一种服务器负载均衡的方法的流程示意图;3 is a schematic flowchart of a method for server load balancing according to another embodiment of this application;
图4为本申请另一实施例提供的一种服务器负载均衡的方法的流程示意图;4 is a schematic flowchart of a method for server load balancing according to another embodiment of this application;
图5为本申请另一实施例提供的一种服务器负载均衡的方法的流程示意图;FIG. 5 is a schematic flowchart of a method for server load balancing according to another embodiment of this application;
图6为本申请一实施例中不频道类型和码率权重映射关系的示例图;FIG. 6 is an exemplary diagram of the mapping relationship between channel types and code rate weights in an embodiment of this application;
图7为本申请一实施例中不同类型设备的最大频道数和最大频道入向带宽的示例图;FIG. 7 is an example diagram of the maximum number of channels and the maximum channel inbound bandwidth of different types of devices in an embodiment of the application;
图8为本申请一实施例提供的一种服务器负载均衡的装置的结构示意图;FIG. 8 is a schematic structural diagram of a server load balancing apparatus provided by an embodiment of this application;
图9为本申请一实施例提供的一种内容分发网络CDN节点的结构示意图。Fig. 9 is a schematic structural diagram of a CDN node of a content distribution network provided by an embodiment of the application.
具体实施方式detailed description
为使本申请的目的、技术方案和优点更加清楚明白,下文中将结合附图对本申请的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。In order to make the objectives, technical solutions, and advantages of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily if there is no conflict.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机***中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps shown in the flowcharts of the drawings can be executed in a computer system such as a set of computer-executable instructions. And, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than here.
图2为本申请一实施例提供的一种服务器负载均衡的方法的流程示意图, 如图2所示,该方法包括:FIG. 2 is a schematic flowchart of a method for server load balancing according to an embodiment of this application. As shown in FIG. 2, the method includes:
步骤201,获取所述n个异构服务器各自的负载信息,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth;Step 201: Obtain load information of each of the n heterogeneous servers, where the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth;
步骤202,根据所述n个异构服务器各自的负载信息进行负载均衡。Step 202: Perform load balancing according to the respective load information of the n heterogeneous servers.
其中,所述获取所述n个异构服务器各自的负载信息,包括:Wherein, the obtaining the load information of each of the n heterogeneous servers includes:
使用du命令获取每一个服务器中磁盘已使用空间,将每一个服务器的总磁盘空间减去已使用空间,得到对应的剩余磁盘空间space;Use the du command to obtain the used disk space of each server, and subtract the used space from the total disk space of each server to obtain the corresponding remaining disk space space;
使用iostat命令获取每一个服务器中磁盘IO使用率;Use the iostat command to get the disk IO usage rate in each server;
使用dstat命令获取每一个服务器的可用带宽bandwidth。Use the dstat command to get the available bandwidth bandwidth of each server.
其中,所述根据所述n个异构服务器各自的负载信息进行负载均衡,包括:Wherein, the performing load balancing according to the respective load information of the n heterogeneous servers includes:
当需要进行内容缓存时,根据所述n个异构服务器各自的负载信息计算每一个服务器的内容缓存性能权重;When content caching is required, calculate the content caching performance weight of each server according to the respective load information of the n heterogeneous servers;
选择内容缓存性能权重最大的服务器进行内容缓存。Select the server with the largest content caching performance weight for content caching.
其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的内容缓存性能权重,包括:Wherein, the calculation of the content caching performance weight of each server according to the respective load information of the n heterogeneous servers includes:
根据如下公式计算每一个服务器的内容缓存性能权重:Calculate the content caching performance weight of each server according to the following formula:
Weight i=a·WS i+b·WIO i+c·WB iWeight i =a·WS i +b·WIO i +c·WB i ;
其中,Weight i表示第i个服务器的内容缓存性能权重,WS i表示第i个服务器的空间权重,WIO i表示第i个服务器的IO权重,WB i表示第i个服务器的带宽权重; Among them, Weight i represents the content caching performance weight of the i-th server, WS i represents the space weight of the i-th server, WIO i represents the IO weight of the i-th server, and WB i represents the bandwidth weight of the i-th server;
Figure PCTCN2020113598-appb-000001
Figure PCTCN2020113598-appb-000001
space i表示第i个服务器的剩余磁盘空间,io i表示第i个服务器的剩余磁盘输入输出IO,bandwidth i表示第i个服务器的可用带宽;i为大于等于1小 于等于n的整数;权重因子a、b、c分别表示剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度。 space i represents the remaining disk space of the i-th server, io i represents the remaining disk input and output IO of the i-th server, bandwidth i represents the available bandwidth of the i-th server; i is an integer greater than or equal to 1 and less than or equal to n; weighting factor a, b, and c respectively represent the degree of influence of remaining disk space, remaining disk input/output IO, and available bandwidth bandwidth on server performance.
其中,所述根据所述n个异构服务器各自的负载信息进行负载均衡,包括:Wherein, the performing load balancing according to the respective load information of the n heterogeneous servers includes:
当需要进行文件发包时,根据所述n个异构服务器各自的负载信息计算每一个服务器的内容读取剩余能力;When it is necessary to perform file package delivery, calculate the content reading remaining capacity of each server according to the respective load information of the n heterogeneous servers;
选择内容读取剩余能力最大的服务器进行文件发包。Select the server with the largest remaining capacity for content reading to send out files.
其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的内容读取剩余能力,包括:Wherein, the calculation of the content reading remaining capacity of each server according to the respective load information of the n heterogeneous servers includes:
根据如下公式计算每一个服务器的内容读取剩余能力:Calculate the remaining content reading capacity of each server according to the following formula:
Weight i=d·WIO i+e·WB iWeight i = d·WIO i +e·WB i ;
其中,Weight i表示第i个服务器的内容读取剩余能力,WIO i表示第i个服务器的IO权重,WB i表示第i个服务器的带宽权重, Among them, Weight i represents the remaining capacity to read the content of the i-th server, WIO i represents the IO weight of the i-th server, WB i represents the bandwidth weight of the i-th server,
Figure PCTCN2020113598-appb-000002
Figure PCTCN2020113598-appb-000002
io i表示第i个服务器的剩余磁盘输入输出IO,bandwidth i表示第i个服务器的可用带宽;i为大于等于1小于等于n的整数;权重因子d、e分别表示剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度。 io i represents the remaining disk input and output IO of the i-th server, bandwidth i represents the available bandwidth of the i-th server; i is an integer greater than or equal to 1 and less than or equal to n; weight factors d and e represent the remaining disk input and output IO, available The degree of influence of bandwidth on server performance.
其中,所述根据所述n个异构服务器各自的负载信息进行负载均衡,包括:Wherein, the performing load balancing according to the respective load information of the n heterogeneous servers includes:
当需要创建新频道时,根据所述n个异构服务器各自的负载信息计算每一个服务器的入向带宽百分比;When a new channel needs to be created, calculate the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers;
选择入向带宽百分比最小的服务器创建所述新频道。The server with the smallest percentage of incoming bandwidth is selected to create the new channel.
其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的入向带宽百分比,包括:Wherein, the calculation of the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers includes:
根据如下公式计算每一个服务器的入向带宽百分比:Calculate the inbound bandwidth percentage of each server according to the following formula:
inbandrate i=(curInbandwidth i+inbandwidth)/mInbandwidth i inbandrate i = (curInbandwidth i +inbandwidth)/mInbandwidth i
其中,inbandrate i表示第i个服务器的入向带宽百分比,curInbandwidth i表示第i个服务器的当前入向带宽,inbandwidth表示新建频道需要占用的入向带宽,mInbandwidth i表示第i个服务器的最大入向带宽。 Among them, inbandrate i represents the percentage of the inbound bandwidth of the i-th server, curInbandwidth i represents the current inbound bandwidth of the i-th server, inbandwidth represents the inbound bandwidth that the new channel needs to occupy, and mInbandwidth i represents the maximum inbound bandwidth of the i-th server bandwidth.
图3为本申请另一实施例提供的一种服务器负载均衡的方法的流程示意图。FIG. 3 is a schematic flowchart of a method for server load balancing according to another embodiment of the application.
服务器目前主要的功能有诸如内容缓存、内容读取、网络收包和网络发包等等,这是目前各个公司在服务器应用领域普遍需要使用到的功能。The main functions of the server at present include content caching, content reading, network packet receiving and network packet sending, etc. These are the functions that various companies generally need to use in the field of server applications.
本实施例应用于需要进行内容缓存的场景。内容缓存即利用网络技术从其他服务器上拉取文件到本服务器上,并使用文件***将拉取到的文件存储在本服务器的磁盘上,文件格式根据服务器上承载的业务不同而不同。在内容缓存过程中,都需要使用到服务器的带宽、磁盘IO、磁盘空间等资源。This embodiment is applied to a scene where content caching is required. Content caching is to use network technology to pull files from other servers to this server, and use the file system to store the pulled files on the disk of this server. The file format varies according to the different services carried on the server. In the process of content caching, resources such as server bandwidth, disk IO, disk space, etc. need to be used.
假设本实施例中,CDN节点中包括n个异构服务器;Suppose that in this embodiment, the CDN node includes n heterogeneous servers;
如图3所示,该方法包括:As shown in Figure 3, the method includes:
步骤301,获取所述n个异构服务器各自的负载信息;Step 301: Obtain respective load information of the n heterogeneous servers;
其中,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth。Wherein, the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth.
其中,可以使用du命令获取磁盘已使用空间,使用iostat命令获取磁盘IO使用率,使用dstat命令获取服务器带宽。Among them, you can use the du command to get the disk used space, the iostat command to get the disk IO usage rate, and the dstat command to get the server bandwidth.
具体命令行示意如下:The specific command line is as follows:
Figure PCTCN2020113598-appb-000003
Figure PCTCN2020113598-appb-000003
Figure PCTCN2020113598-appb-000004
Figure PCTCN2020113598-appb-000004
Figure PCTCN2020113598-appb-000005
Figure PCTCN2020113598-appb-000005
Figure PCTCN2020113598-appb-000006
Figure PCTCN2020113598-appb-000006
其中,du命令行中,第二列是目录的名称,第一列是这个目录占用磁盘空间的大小(单位:Byte)。iostat命令行中,最后一列,表示磁盘的使用率 (单位:%)。dstat命令行中,send列表示当前出向带宽(单位:Byte),recv列表示当前入向带宽(单位:Byte),需要将send和recv相加表示当前已使用的带宽;每一行表示从当前时间开始每一秒服务器此时的send和recv。Among them, in the du command line, the second column is the name of the directory, and the first column is the size of the disk space occupied by this directory (unit: Byte). In the iostat command line, the last column indicates the disk usage rate (unit: %). In the dstat command line, the send column represents the current outbound bandwidth (unit: Byte), and the recv column represents the current inbound bandwidth (unit: Byte). You need to add send and recv to indicate the currently used bandwidth; each line represents the current time Start every second the server sends and recv at this time.
步骤302,根据所述n个异构服务器各自的负载信息计算每一个服务器的内容缓存性能权重;Step 302: Calculate the content caching performance weight of each server according to the respective load information of the n heterogeneous servers;
其中,可以根据如下公式计算每一个服务器的内容缓存性能权重:Among them, the content caching performance weight of each server can be calculated according to the following formula:
Weight i=a·WS i+b·WIO i+c·WB iWeight i =a·WS i +b·WIO i +c·WB i ;
其中,Weight i表示第i个服务器的内容缓存性能权重,WS i表示第i个服务器的空间权重,WIO i表示第i个服务器的IO权重,WB i表示第i个服务器的带宽权重; Among them, Weight i represents the content caching performance weight of the i-th server, WS i represents the space weight of the i-th server, WIO i represents the IO weight of the i-th server, and WB i represents the bandwidth weight of the i-th server;
Figure PCTCN2020113598-appb-000007
Figure PCTCN2020113598-appb-000007
space i表示第i个服务器的剩余磁盘空间,io i表示第i个服务器的剩余磁盘输入输出IO,bandwidth i表示第i个服务器的可用带宽;i为大于等于1小于等于n的整数;权重因子a、b、c分别表示剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度。 space i represents the remaining disk space of the i-th server, io i represents the remaining disk input and output IO of the i-th server, bandwidth i represents the available bandwidth of the i-th server; i is an integer greater than or equal to 1 and less than or equal to n; weighting factor a, b, and c respectively represent the degree of influence of remaining disk space, remaining disk input/output IO, and available bandwidth bandwidth on server performance.
步骤303,选择内容缓存性能权重最大的服务器进行内容缓存。Step 303: Select the server with the largest content caching performance weight for content caching.
其中,可以根据各个服务器的内容缓存性能权重Weight来选择一个内容缓存性能权重最大的服务器缓存内容。Among them, a server with the largest content caching performance weight can be selected to cache content according to the content caching performance weight of each server.
具体而言,可以在CDN节点中的每一个服务器上设置获取模块,其中一个服务器上设置负载均衡模块。各服务器上的获取模块可以定时获取本服务器的负载信息并发送给负载均衡模块,由负载均衡模块计算各个服务器的内容缓存性能权重。例如,假设当前节点下管理了n台服务器(ZMSS)。space i表示第i台服务器的剩余空间(1≤i≤n)。io i表示第i台服务器的剩余IO,bandwidth i表示第i台服务器的可用带宽。 Specifically, an acquisition module can be set on each server in the CDN node, and a load balancing module can be set on one of the servers. The acquisition module on each server can periodically acquire the load information of the server and send it to the load balancing module, and the load balancing module calculates the content caching performance weight of each server. For example, suppose that n servers (ZMSS) are managed under the current node. Space i represents the remaining space of the i-th server (1≤i≤n). io i represents the remaining IO of the i-th server, and bandwidth i represents the available bandwidth of the i-th server.
则服务器i的空间权重
Figure PCTCN2020113598-appb-000008
Then the spatial weight of server i
Figure PCTCN2020113598-appb-000008
服务器i的IO权重
Figure PCTCN2020113598-appb-000009
IO weight of server i
Figure PCTCN2020113598-appb-000009
服务器i的带宽权重
Figure PCTCN2020113598-appb-000010
Bandwidth weight of server i
Figure PCTCN2020113598-appb-000010
设置三个权重因子a、b、c分别表示剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度,则服务器i的内容缓存性能权重是Weight i=a·WS i+b·WIO i+c·WB i。然后由负载均衡策略根据各个服务器的Weight来选择一个内容缓存性能权重最大的服务器缓存内容。 Set three weighting factors a, b, and c to represent the influence of remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth on server performance. Then the content cache performance weight of server i is Weight i = a·WS i + b·WIO i +c·WB i . Then the load balancing strategy selects a server with the largest content caching performance weight to cache content according to the weight of each server.
图4为本申请另一实施例提供的一种服务器负载均衡的方法的流程示意图。FIG. 4 is a schematic flowchart of a method for server load balancing according to another embodiment of this application.
服务器目前主要的功能有诸如内容缓存、内容读取、网络收包和网络发包等等,这是目前各个公司在服务器应用领域普遍需要使用到的功能。The main functions of the server at present include content caching, content reading, network packet receiving and network packet sending, etc. These are the functions that various companies generally need to use in the field of server applications.
本实施例应用于需要进行文件发包的场景。文件发包即读取本服务器磁盘上的文件,并利用网络发送出去,发送出去网络包可以是流式的,也可以是小文件形式的。在文件读取过程中需要占用磁盘IO,带宽等资源。This embodiment is applied to a scenario where a file package needs to be issued. File sending means to read the file on the disk of this server and send it out through the network. The network package sent out can be streamed or in the form of small files. In the file reading process, resources such as disk IO and bandwidth are required.
假设本实施例中,CDN节点中包括n个异构服务器;Suppose that in this embodiment, the CDN node includes n heterogeneous servers;
如图4所示,该方法包括:As shown in Figure 4, the method includes:
步骤401,获取所述n个异构服务器各自的负载信息;Step 401: Obtain respective load information of the n heterogeneous servers;
其中,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth。Wherein, the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth.
具体而言,可以使用du命令获取磁盘已使用空间,使用iostat命令获取磁盘IO使用率,使用dstat命令获取服务器带宽。Specifically, you can use the du command to get the disk used space, the iostat command to get the disk IO usage, and the dstat command to get the server bandwidth.
具体命令行见上一实施例。See the previous embodiment for the specific command line.
步骤402,根据所述n个异构服务器各自的负载信息计算每一个服务器的内容读取剩余能力;Step 402: Calculate the content reading remaining capacity of each server according to the respective load information of the n heterogeneous servers;
其中,可以根据如下公式计算每一个服务器的内容读取剩余能力:Among them, the remaining capacity of each server can be calculated according to the following formula:
Weight i=d·WIO i+e·WB iWeight i = d·WIO i +e·WB i ;
其中,Weight i表示第i个服务器的内容读取剩余能力,WIO i表示第i个服务器的IO权重,WB i表示第i个服务器的带宽权重, Among them, Weight i represents the remaining capacity to read the content of the i-th server, WIO i represents the IO weight of the i-th server, WB i represents the bandwidth weight of the i-th server,
Figure PCTCN2020113598-appb-000011
Figure PCTCN2020113598-appb-000011
io i表示第i个服务器的剩余磁盘输入输出IO,bandwidth i表示第i个服务器的可用带宽;i为大于等于1小于等于n的整数;权重因子d、e分别表示剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度。 io i represents the remaining disk input and output IO of the i-th server, bandwidth i represents the available bandwidth of the i-th server; i is an integer greater than or equal to 1 and less than or equal to n; weight factors d and e represent the remaining disk input and output IO, available The degree of influence of bandwidth on server performance.
步骤403,选择内容读取剩余能力最大的服务器进行文件发包。Step 403: Select the server with the largest remaining capacity for content reading to send the file.
具体而言,可以在CDN节点中的每一个服务器上设置获取模块,其中一个服务器上设置负载均衡模块。各服务器上的获取模块可以定时获取本服务器的负载信息并发送给负载均衡模块,由负载均衡模块计算各个服务器的内容读取剩余能力,选择内容读取剩余能力最大的服务器进行文件发包。Specifically, an acquisition module can be set on each server in the CDN node, and a load balancing module can be set on one of the servers. The acquisition module on each server can periodically acquire the load information of the server and send it to the load balancing module. The load balancing module calculates the remaining content reading capacity of each server, and selects the server with the largest content reading remaining capacity for file delivery.
图5为本申请另一实施例提供的一种服务器负载均衡的方法的流程示意图。FIG. 5 is a schematic flowchart of a method for server load balancing according to another embodiment of this application.
服务器目前主要的功能有诸如内容缓存、内容读取、网络收包和网络发包等等,这是目前各个公司在服务器应用领域普遍需要使用到的功能。The main functions of the server at present include content caching, content reading, network packet receiving and network packet sending, etc. These are the functions that various companies generally need to use in the field of server applications.
本实施例应用于需要创建新频道的场景。网络收包和网络发包,即服务器从其他服务器上接收网络包,请过处理后直接发送出去。这种场景最直接的引用在音视频频道直播的场景,服务器需要使用到带宽、CPU等资源。This embodiment is applied to a scenario where a new channel needs to be created. Network packet receiving and network packet sending, that is, the server receives network packets from other servers, please send them directly after processing. This kind of scenario is the most direct reference to the live broadcast of audio and video channels, and the server needs to use resources such as bandwidth and CPU.
假设本实施例中,CDN节点中包括n个异构服务器;Suppose that in this embodiment, the CDN node includes n heterogeneous servers;
如图5所示,该方法包括:As shown in Figure 5, the method includes:
如图5所示,该方法包括:As shown in Figure 5, the method includes:
步骤501,获取所述n个异构服务器各自的负载信息;Step 501: Obtain respective load information of the n heterogeneous servers;
其中,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth。Wherein, the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth.
具体而言,可以使用du命令获取磁盘已使用空间,使用iostat命令获取磁盘IO使用率,使用dstat命令获取服务器带宽。Specifically, you can use the du command to get the disk used space, the iostat command to get the disk IO usage, and the dstat command to get the server bandwidth.
具体命令行见上一实施例。See the previous embodiment for the specific command line.
步骤502,根据所述n个异构服务器各自的负载信息计算每一个服务器的入向带宽百分比;Step 502: Calculate the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers;
其中,可以根据如下公式计算每一个服务器的入向带宽百分比:Among them, the inbound bandwidth percentage of each server can be calculated according to the following formula:
inbandrate i=(curInbandwidth i+inbandwidth)/mInbandwidth iinbandrate i = (curInbandwidth i +inbandwidth)/mInbandwidth i ;
其中,inbandrate i表示第i个服务器的入向带宽百分比,curInbandwidth i表示第i个服务器的当前入向带宽,inbandwidth表示新建频道需要占用的入向带宽,mInbandwidth i表示第i个服务器的最大入向带宽。 Among them, inbandrate i represents the percentage of the inbound bandwidth of the i-th server, curInbandwidth i represents the current inbound bandwidth of the i-th server, inbandwidth represents the inbound bandwidth that the new channel needs to occupy, and mInbandwidth i represents the maximum inbound bandwidth of the i-th server bandwidth.
其中,服务器可以根据新建频道接收码流的码率信息以及频道类型计算出新频道实际需要占用的入向带宽inbandwidth。频道类型和码率权重可以根据服务器类型做一个映射关系,例如图6所示。Among them, the server can calculate the incoming bandwidth inbandwidth that the new channel actually needs to occupy according to the bit rate information of the code stream received by the newly created channel and the channel type. The channel type and the bit rate weight can be mapped according to the server type, as shown in Figure 6.
其中,服务器的最大入向带宽mInbandwidth可以根据服务器的服务器类型以及预设的服务器类型和频道资源对照表确定。例如,不同类型设备最大入向带宽mInbandwidth可以进行预先配置,如图7所示。Among them, the maximum inbound bandwidth mInbandwidth of the server can be determined according to the server type of the server and the preset server type and channel resource comparison table. For example, the maximum inbound bandwidth mInbandwidth of different types of devices can be pre-configured, as shown in Figure 7.
步骤503,选择入向带宽百分比最小的服务器创建所述新频道。Step 503: Select the server with the smallest percentage of incoming bandwidth to create the new channel.
具体而言,可以在CDN节点中的每一个服务器上设置获取模块,其中一个服务器上设置负载均衡模块。各服务器上的获取模块可以定时获取本服务器的负载信息并发送给负载均衡模块,由负载均衡模块计算各个服务器的入向带宽,根据各服务器的占用带宽百分比取最小的服务器进行频道创建。例如,假设需要新建频道的码率是codespeed(kbps),根据频道类型码率权重是factor,根据频道类型的不同新建频道时需要占用的入向带宽inbandwidth(kbps)如下inbandwidth=codespeed*factor。Specifically, an acquisition module can be set on each server in the CDN node, and a load balancing module can be set on one of the servers. The acquisition module on each server can periodically acquire the load information of the server and send it to the load balancing module. The load balancing module calculates the inbound bandwidth of each server, and takes the smallest server to create the channel according to the percentage of the occupied bandwidth of each server. For example, assuming that the code rate of a new channel is codespeed (kbps), the code rate weight is factor according to the channel type, and the incoming bandwidth inbandwidth (kbps) that needs to be occupied when creating a channel according to the channel type is as follows inbandwidth=codespeed*factor.
假设当前节点下有n台服务器,第i台服务器(1≤i≤n)查找配置表得到最大入向带宽为mInbandwidth i,当前入向带宽为curInbandwidth i,则它的入向带宽百分比inbandrate i=(curInbandwidth i+inbandwidth)/mInbandwidth i。负载均衡模块依次获取所有节点下挂服务器的inbandrate,选取最小inbandrate的服务器创建频道。 Assuming that there are n servers under the current node, the i-th server (1≤i≤n) looks up the configuration table and finds that the maximum inbound bandwidth is mInbandwidth i , and the current inbound bandwidth is curInbandwidth i , then its inbound bandwidth percentage inbandrate i = (curInbandwidth i +inbandwidth)/mInbandwidth i . The load balancing module sequentially obtains the inbandrates of the servers attached to all nodes, and selects the server with the smallest inbandrate to create a channel.
图8为本申请一实施例提供的一种服务器负载均衡的装置的结构示意图,如图8所示,该装置包括:FIG. 8 is a schematic structural diagram of a server load balancing device provided by an embodiment of this application. As shown in FIG. 8, the device includes:
获取单元,用于获取所述n个异构服务器各自的负载信息,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth;An obtaining unit, configured to obtain respective load information of the n heterogeneous servers, where the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth;
负载均衡单元,用于根据所述n个异构服务器各自的负载信息进行负载均衡。The load balancing unit is configured to perform load balancing according to the respective load information of the n heterogeneous servers.
其中,所述获取单元,具体用于使用du命令获取每一个服务器中磁盘已使用空间,将每一个服务器的总磁盘空间减去已使用空间,得到对应的剩余磁盘空间space;Wherein, the obtaining unit is specifically configured to obtain the used disk space of each server by using the du command, and subtract the used space from the total disk space of each server to obtain the corresponding remaining disk space space;
使用iostat命令获取每一个服务器中磁盘IO使用率;Use the iostat command to get the disk IO usage rate in each server;
使用dstat命令获取每一个服务器的可用带宽bandwidth。Use the dstat command to get the available bandwidth bandwidth of each server.
其中,所负载均衡单元,具体用于当需要进行内容缓存时,根据所述n个异构服务器各自的负载信息计算每一个服务器的内容缓存性能权重;Wherein, the load balancing unit is specifically configured to calculate the content caching performance weight of each server according to the respective load information of the n heterogeneous servers when content caching is required;
选择内容缓存性能权重最大的服务器进行内容缓存。Select the server with the largest content caching performance weight for content caching.
其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的内容缓存性能权重,包括:Wherein, the calculation of the content caching performance weight of each server according to the respective load information of the n heterogeneous servers includes:
根据如下公式计算每一个服务器的内容缓存性能权重:Calculate the content caching performance weight of each server according to the following formula:
Weight i=a·WS i+b·WIO i+c·WB iWeight i =a·WS i +b·WIO i +c·WB i ;
其中,Weight i表示第i个服务器的内容缓存性能权重,WS i表示第i个服务器的空间权重,WIO i表示第i个服务器的IO权重,WB i表示第i个服务器的带宽权重; Among them, Weight i represents the content caching performance weight of the i-th server, WS i represents the space weight of the i-th server, WIO i represents the IO weight of the i-th server, and WB i represents the bandwidth weight of the i-th server;
Figure PCTCN2020113598-appb-000012
Figure PCTCN2020113598-appb-000012
space i表示第i个服务器的剩余磁盘空间,io i表示第i个服务器的剩余磁盘输入输出IO,bandwidth i表示第i个服务器的可用带宽;i为大于等于1小于等于n的整数;权重因子a、b、c分别表示剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度。 space i represents the remaining disk space of the i-th server, io i represents the remaining disk input and output IO of the i-th server, bandwidth i represents the available bandwidth of the i-th server; i is an integer greater than or equal to 1 and less than or equal to n; weighting factor a, b, and c respectively represent the degree of influence of remaining disk space, remaining disk input/output IO, and available bandwidth bandwidth on server performance.
其中,所负载均衡单元,具体用于当需要进行文件发包时,根据所述n个异构服务器各自的负载信息计算每一个服务器的内容读取剩余能力;Wherein, the load balancing unit is specifically configured to calculate the remaining content reading capacity of each server according to the respective load information of the n heterogeneous servers when a file package is required;
选择内容读取剩余能力最大的服务器进行文件发包。Select the server with the largest remaining capacity for content reading to send out files.
其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的内容读取剩余能力,包括:Wherein, the calculation of the content reading remaining capacity of each server according to the respective load information of the n heterogeneous servers includes:
根据如下公式计算每一个服务器的内容读取剩余能力:Calculate the remaining content reading capacity of each server according to the following formula:
Weight i=d·WIO i+e·WB iWeight i = d·WIO i +e·WB i ;
其中,Weight i表示第i个服务器的内容读取剩余能力,WIO i表示第i个服务器的IO权重,WB i表示第i个服务器的带宽权重, Among them, Weight i represents the remaining capacity to read the content of the i-th server, WIO i represents the IO weight of the i-th server, WB i represents the bandwidth weight of the i-th server,
Figure PCTCN2020113598-appb-000013
Figure PCTCN2020113598-appb-000013
io i表示第i个服务器的剩余磁盘输入输出IO,bandwidth i表示第i个服务器的可用带宽;i为大于等于1小于等于n的整数;权重因子d、e分别表示剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度。 io i represents the remaining disk input and output IO of the i-th server, bandwidth i represents the available bandwidth of the i-th server; i is an integer greater than or equal to 1 and less than or equal to n; weight factors d and e represent the remaining disk input and output IO, available The degree of influence of bandwidth on server performance.
其中,所负载均衡单元,具体用于当需要创建新频道时,根据所述n个异构服务器各自的负载信息计算每一个服务器的入向带宽;Wherein, the load balancing unit is specifically configured to calculate the inbound bandwidth of each server according to the respective load information of the n heterogeneous servers when a new channel needs to be created;
选择入向带宽最小的服务器创建所述新频道。The server with the smallest incoming bandwidth is selected to create the new channel.
其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的入向带宽百分比,包括:Wherein, the calculation of the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers includes:
根据如下公式计算每一个服务器的入向带宽百分比:Calculate the inbound bandwidth percentage of each server according to the following formula:
inbandrate i=(curInbandwidth i+inbandwidth)/mInbandwidth iinbandrate i = (curInbandwidth i +inbandwidth)/mInbandwidth i ;
其中,inbandrate i表示第i个服务器的入向带宽,curInbandwidth i表示第i个服务器的当前入向带宽,mInbandwidth i表示第i个服务器的最大入向带宽。 Among them, inbandrate i represents the inbound bandwidth of the i-th server, curInbandwidth i represents the current inbound bandwidth of the i-th server, and mInbandwidth i represents the maximum inbound bandwidth of the i-th server.
图9为本申请一实施例提供的一种内容分发网络CDN节点的结构示意图,如图9所示,该CDN节点包括:n个异构服务器;FIG. 9 is a schematic structural diagram of a CDN node of a content distribution network according to an embodiment of the application. As shown in FIG. 9, the CDN node includes: n heterogeneous servers;
每一服务器上设置有获取模块,其中一个服务器上设置有负载均衡模块;Each server is provided with an acquisition module, and one of the servers is provided with a load balancing module;
每一个获取模块,用于获取对应服务器的负载信息,并将获取的负载信息发送给所述负载均衡模块;Each obtaining module is used to obtain load information of the corresponding server, and send the obtained load information to the load balancing module;
其中,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth;Wherein, the load information includes remaining disk space space, remaining disk input and output IO, and available bandwidth bandwidth;
所述负载均衡模块,用于根据所述n个异构服务器各自的负载信息进行负载均衡。The load balancing module is configured to perform load balancing according to the respective load information of the n heterogeneous servers.
其中,所述获取模块,具体用于使用du命令获取对应服务器中磁盘已使用空间,将对应服务器的总磁盘空间减去已使用空间,得到对应的剩余磁盘 空间space;Wherein, the obtaining module is specifically configured to use the du command to obtain the used disk space in the corresponding server, and subtract the used space from the total disk space of the corresponding server to obtain the corresponding remaining disk space space;
使用iostat命令获取对应服务器中磁盘IO使用率;Use the iostat command to obtain the disk IO usage rate in the corresponding server;
使用dstat命令获取对应服务器的可用带宽bandwidth。Use the dstat command to obtain the available bandwidth bandwidth of the corresponding server.
其中,所负载均衡模块,具体用于当需要进行内容缓存时,根据所述n个异构服务器各自的负载信息计算每一个服务器的内容缓存性能权重;Wherein, the load balancing module is specifically configured to calculate the content caching performance weight of each server according to the respective load information of the n heterogeneous servers when content caching is required;
选择内容缓存性能权重最大的服务器进行内容缓存。Select the server with the largest content caching performance weight for content caching.
其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的内容缓存性能权重,包括:Wherein, the calculation of the content caching performance weight of each server according to the respective load information of the n heterogeneous servers includes:
根据如下公式计算每一个服务器的内容缓存性能权重:Calculate the content caching performance weight of each server according to the following formula:
Weight i=a·WS i+b·WIO i+c·WB iWeight i =a·WS i +b·WIO i +c·WB i ;
其中,Weight i表示第i个服务器的内容缓存性能权重,WS i表示第i个服务器的空间权重,WIO i表示第i个服务器的IO权重,WB i表示第i个服务器的带宽权重; Among them, Weight i represents the content caching performance weight of the i-th server, WS i represents the space weight of the i-th server, WIO i represents the IO weight of the i-th server, and WB i represents the bandwidth weight of the i-th server;
Figure PCTCN2020113598-appb-000014
Figure PCTCN2020113598-appb-000014
space i表示第i个服务器的剩余磁盘空间,io i表示第i个服务器的剩余磁盘输入输出IO,bandwidth i表示第i个服务器的可用带宽;i为大于等于1小于等于n的整数;权重因子a、b、c分别表示剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度。 space i represents the remaining disk space of the i-th server, io i represents the remaining disk input and output IO of the i-th server, bandwidth i represents the available bandwidth of the i-th server; i is an integer greater than or equal to 1 and less than or equal to n; weighting factor a, b, and c respectively represent the degree of influence of remaining disk space, remaining disk input/output IO, and available bandwidth bandwidth on server performance.
其中,所负载均衡模块,具体用于当需要进行文件发包时,根据所述n个异构服务器各自的负载信息计算每一个服务器的内容读取剩余能力;Wherein, the load balancing module is specifically configured to calculate the remaining content reading capacity of each server according to the respective load information of the n heterogeneous servers when a file package needs to be performed;
选择内容读取剩余能力最大的服务器进行文件发包。Select the server with the largest remaining capacity for content reading to send out files.
其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的内容读取剩余能力,包括:Wherein, the calculation of the content reading remaining capacity of each server according to the respective load information of the n heterogeneous servers includes:
根据如下公式计算每一个服务器的内容读取剩余能力:Calculate the remaining content reading capacity of each server according to the following formula:
Weight i=d·WIO i+e·WB iWeight i = d·WIO i +e·WB i ;
其中,Weight i表示第i个服务器的内容读取剩余能力,WIO i表示第i个服务器的IO权重,WB i表示第i个服务器的带宽权重, Among them, Weight i represents the remaining capacity to read the content of the i-th server, WIO i represents the IO weight of the i-th server, WB i represents the bandwidth weight of the i-th server,
Figure PCTCN2020113598-appb-000015
Figure PCTCN2020113598-appb-000015
io i表示第i个服务器的剩余磁盘输入输出IO,bandwidth i表示第i个服务器的可用带宽;i为大于等于1小于等于n的整数;权重因子d、e分别表示剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度。 io i represents the remaining disk input and output IO of the i-th server, bandwidth i represents the available bandwidth of the i-th server; i is an integer greater than or equal to 1 and less than or equal to n; weight factors d and e represent the remaining disk input and output IO, available The degree of influence of bandwidth on server performance.
其中,所负载均衡模块,具体用于当需要创建新频道时,根据所述n个异构服务器各自的负载信息计算每一个服务器的入向带宽百分比;Wherein, the load balancing module is specifically configured to calculate the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers when a new channel needs to be created;
选择入向带宽百分比最小的服务器创建所述新频道。The server with the smallest percentage of incoming bandwidth is selected to create the new channel.
其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的入向带宽百分比,包括:Wherein, the calculation of the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers includes:
根据如下公式计算每一个服务器的入向带宽百分比:Calculate the inbound bandwidth percentage of each server according to the following formula:
inbandrate i=(curInbandwidth i+inbandwidth)/mInbandwidth iinbandrate i = (curInbandwidth i +inbandwidth)/mInbandwidth i ;
其中,inbandrate i表示第i个服务器的入向带宽,curInbandwidth i表示第i个服务器的当前入向带宽,mInbandwidth i表示第i个服务器的最大入向带宽。 Among them, inbandrate i represents the inbound bandwidth of the i-th server, curInbandwidth i represents the current inbound bandwidth of the i-th server, and mInbandwidth i represents the maximum inbound bandwidth of the i-th server.
本申请实施例提供的技术方案,能够防止节点内单点服务器宕机造成的雪崩效应,充分发挥各台服务器的性能。The technical solutions provided by the embodiments of the present application can prevent the avalanche effect caused by the downtime of a single point server in a node, and give full play to the performance of each server.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、***、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬 件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。A person of ordinary skill in the art can understand that all or some of the steps, functional modules/units in the system, and apparatus in the methods disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. In the hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may consist of several physical components. The components are executed cooperatively. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, and the computer-readable medium may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile data implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Sexual, removable and non-removable media. Computer storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or Any other medium used to store desired information and that can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media usually contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as carrier waves or other transmission mechanisms, and may include any information delivery media. .

Claims (10)

  1. 一种服务器负载均衡的方法,应用于包括n个异构服务器的内容分发网络CDN节点,包括:A method for server load balancing, applied to a CDN node of a content distribution network including n heterogeneous servers, includes:
    获取所述n个异构服务器各自的负载信息,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth;Acquiring load information of each of the n heterogeneous servers, where the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth;
    根据所述n个异构服务器各自的负载信息进行负载均衡。Perform load balancing according to the respective load information of the n heterogeneous servers.
  2. 根据权利要求1所述的方法,其中,所述获取所述n个异构服务器各自的负载信息,包括:The method according to claim 1, wherein said obtaining the respective load information of the n heterogeneous servers comprises:
    使用du命令获取每一个服务器中磁盘已使用空间,将每一个服务器的总磁盘空间减去已使用空间,得到对应的剩余磁盘空间space;Use the du command to obtain the used disk space of each server, and subtract the used space from the total disk space of each server to obtain the corresponding remaining disk space space;
    使用iostat命令获取每一个服务器中磁盘IO使用率;Use the iostat command to get the disk IO usage rate in each server;
    使用dstat命令获取每一个服务器的可用带宽bandwidth。Use the dstat command to get the available bandwidth bandwidth of each server.
  3. 根据权利要求1所述的方法,其中,所述根据所述n个异构服务器各自的负载信息进行负载均衡,包括:The method according to claim 1, wherein the performing load balancing according to the respective load information of the n heterogeneous servers comprises:
    当需要进行内容缓存时,根据所述n个异构服务器各自的负载信息计算每一个服务器的内容缓存性能权重;When content caching is required, calculate the content caching performance weight of each server according to the respective load information of the n heterogeneous servers;
    选择内容缓存性能权重最大的服务器进行内容缓存。Select the server with the largest content caching performance weight for content caching.
  4. 根据权利要求1所述的方法,其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的内容缓存性能权重,包括:The method according to claim 1, wherein the calculating the content caching performance weight of each server according to the respective load information of the n heterogeneous servers comprises:
    根据如下公式计算每一个服务器的内容缓存性能权重:Calculate the content caching performance weight of each server according to the following formula:
    Weight i=a·WS i+b·WIO i+c·WB iWeight i =a·WS i +b·WIO i +c·WB i ;
    其中,Weight i表示第i个服务器的内容缓存性能权重,WS i表示第i个服务器的空间权重,WIO i表示第i个服务器的IO权重,WB i表示第i个服务器的带宽权重; Among them, Weight i represents the content caching performance weight of the i-th server, WS i represents the space weight of the i-th server, WIO i represents the IO weight of the i-th server, and WB i represents the bandwidth weight of the i-th server;
    Figure PCTCN2020113598-appb-100001
    Figure PCTCN2020113598-appb-100001
    space i表示第i个服务器的剩余磁盘空间,io i表示第i个服务器的剩余磁盘输入输出IO,bandwidth i表示第i个服务器的可用带宽;i为大于等于1小于等于n的整数;权重因子a、b、c分别表示剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度。 space i represents the remaining disk space of the i-th server, io i represents the remaining disk input and output IO of the i-th server, bandwidth i represents the available bandwidth of the i-th server; i is an integer greater than or equal to 1 and less than or equal to n; weighting factor a, b, and c respectively represent the degree of influence of remaining disk space, remaining disk input/output IO, and available bandwidth bandwidth on server performance.
  5. 根据权利要求1所述的方法,其中,所述根据所述n个异构服务器各自的负载信息进行负载均衡,包括:The method according to claim 1, wherein the performing load balancing according to the respective load information of the n heterogeneous servers comprises:
    当需要进行文件发包时,根据所述n个异构服务器各自的负载信息计算每一个服务器的内容读取剩余能力;When it is necessary to perform file package delivery, calculate the content reading remaining capacity of each server according to the respective load information of the n heterogeneous servers;
    选择内容读取剩余能力最大的服务器进行文件发包。Select the server with the largest remaining capacity for content reading to send out files.
  6. 根据权利要求5所述的方法,其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的内容读取剩余能力,包括:The method according to claim 5, wherein the calculating the remaining content reading capacity of each server according to the respective load information of the n heterogeneous servers comprises:
    根据如下公式计算每一个服务器的内容读取剩余能力:Calculate the remaining content reading capacity of each server according to the following formula:
    Weight i=d·WIO i+e·WB iWeight i = d·WIO i +e·WB i ;
    其中,Weight i表示第i个服务器的内容读取剩余能力,WIO i表示第i个服务器的IO权重,WB i表示第i个服务器的带宽权重, Among them, Weight i represents the remaining capacity to read the content of the i-th server, WIO i represents the IO weight of the i-th server, WB i represents the bandwidth weight of the i-th server,
    Figure PCTCN2020113598-appb-100002
    Figure PCTCN2020113598-appb-100002
    io i表示第i个服务器的剩余磁盘输入输出IO,bandwidth i表示第i个服务器的可用带宽;i为大于等于1小于等于n的整数;权重因子d、e分别表示剩余磁盘输入输出IO、可用带宽bandwidth对服务器性能的影响度。 io i represents the remaining disk input and output IO of the i-th server, bandwidth i represents the available bandwidth of the i-th server; i is an integer greater than or equal to 1 and less than or equal to n; weight factors d and e represent the remaining disk input and output IO, available The degree of influence of bandwidth on server performance.
  7. 根据权利要求1所述的方法,其中,所述根据所述n个异构服务器各自的负载信息进行负载均衡,包括:The method according to claim 1, wherein the performing load balancing according to the respective load information of the n heterogeneous servers comprises:
    当需要创建新频道时,根据所述n个异构服务器各自的负载信息计算每 一个服务器的入向带宽百分比;When a new channel needs to be created, calculate the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers;
    选择入向带宽百分比最小的服务器创建所述新频道。The server with the smallest percentage of incoming bandwidth is selected to create the new channel.
  8. 根据权利要求7所述的方法,其中,所述根据所述n个异构服务器各自的负载信息计算每一个服务器的入向带宽百分比,包括:The method according to claim 7, wherein the calculating the inbound bandwidth percentage of each server according to the respective load information of the n heterogeneous servers comprises:
    根据如下公式计算每一个服务器的入向带宽百分比:Calculate the inbound bandwidth percentage of each server according to the following formula:
    inbandrate i=(curInbandwidth i+inbandwidth)/mInbandwidth i inbandrate i = (curInbandwidth i +inbandwidth)/mInbandwidth i
    其中,inbandrate i表示第i个服务器的入向带宽百分比,curInbandwidth i表示第i个服务器的当前入向带宽,inbandwidth表示新建频道需要占用的入向带宽,mInbandwidth i表示第i个服务器的最大入向带宽。 Among them, inbandrate i represents the percentage of the inbound bandwidth of the i-th server, curInbandwidth i represents the current inbound bandwidth of the i-th server, inbandwidth represents the inbound bandwidth that the new channel needs to occupy, and mInbandwidth i represents the maximum inbound bandwidth of the i-th server bandwidth.
  9. 一种服务器负载均衡的装置,应用于包括n个异构服务器的内容分发网络CDN节点,包括:A server load balancing device, applied to a CDN node of a content distribution network including n heterogeneous servers, includes:
    获取单元,用于获取所述n个异构服务器各自的负载信息,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth;An obtaining unit, configured to obtain respective load information of the n heterogeneous servers, where the load information includes remaining disk space space, remaining disk input/output IO, and available bandwidth bandwidth;
    负载均衡单元,用于根据所述n个异构服务器各自的负载信息进行负载均衡。The load balancing unit is configured to perform load balancing according to the respective load information of the n heterogeneous servers.
  10. 一种内容分发网络CDN节点,包括:n个异构服务器;A CDN node of a content distribution network, including: n heterogeneous servers;
    每一服务器上设置有获取模块,其中一个服务器上设置有负载均衡模块;Each server is provided with an acquisition module, and one of the servers is provided with a load balancing module;
    每一个获取模块,用于获取对应服务器的负载信息,并将获取的负载信息发送给所述负载均衡模块;Each obtaining module is used to obtain load information of the corresponding server, and send the obtained load information to the load balancing module;
    其中,所述负载信息包括剩余磁盘空间space、剩余磁盘输入输出IO、可用带宽bandwidth;Wherein, the load information includes remaining disk space space, remaining disk input and output IO, and available bandwidth bandwidth;
    所述负载均衡模块,用于根据所述n个异构服务器各自的负载信息进行负载均衡。The load balancing module is configured to perform load balancing according to the respective load information of the n heterogeneous servers.
PCT/CN2020/113598 2019-09-18 2020-09-04 Server load balancing method and apparatus, and cdn node WO2021052199A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910881892.3A CN112532665A (en) 2019-09-18 2019-09-18 Server load balancing method and device and CDN node
CN201910881892.3 2019-09-18

Publications (1)

Publication Number Publication Date
WO2021052199A1 true WO2021052199A1 (en) 2021-03-25

Family

ID=74883886

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/113598 WO2021052199A1 (en) 2019-09-18 2020-09-04 Server load balancing method and apparatus, and cdn node

Country Status (2)

Country Link
CN (1) CN112532665A (en)
WO (1) WO2021052199A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114500551A (en) * 2021-12-31 2022-05-13 杭州未名信科科技有限公司 Edge computing transmission load balancing method, device, equipment and storage medium
CN114567637A (en) * 2022-03-01 2022-05-31 浪潮云信息技术股份公司 Method and system for intelligently setting weight of load balancing back-end server
CN116450054A (en) * 2023-06-16 2023-07-18 成都泛联智存科技有限公司 IO request processing method, device, host and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546775A (en) * 2011-12-27 2012-07-04 中兴通讯股份有限公司 Node in CDN (content delivery network) and automatic networking method thereof
CN104168332A (en) * 2014-09-01 2014-11-26 广东电网公司信息中心 Load balance and node state monitoring method in high performance computing
CN107196869A (en) * 2017-07-14 2017-09-22 北京知道创宇信息技术有限公司 The adaptive load balancing method, apparatus and system of Intrusion Detection based on host actual loading
EP3270536A1 (en) * 2016-07-14 2018-01-17 Huawei Technologies Co., Ltd. Sdn controller, system and method for task scheduling, resource provisioning and service providing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546775A (en) * 2011-12-27 2012-07-04 中兴通讯股份有限公司 Node in CDN (content delivery network) and automatic networking method thereof
CN104168332A (en) * 2014-09-01 2014-11-26 广东电网公司信息中心 Load balance and node state monitoring method in high performance computing
EP3270536A1 (en) * 2016-07-14 2018-01-17 Huawei Technologies Co., Ltd. Sdn controller, system and method for task scheduling, resource provisioning and service providing
CN107196869A (en) * 2017-07-14 2017-09-22 北京知道创宇信息技术有限公司 The adaptive load balancing method, apparatus and system of Intrusion Detection based on host actual loading

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114500551A (en) * 2021-12-31 2022-05-13 杭州未名信科科技有限公司 Edge computing transmission load balancing method, device, equipment and storage medium
CN114500551B (en) * 2021-12-31 2024-04-05 杭州未名信科科技有限公司 Edge computing transmission load balancing method, device, equipment and storage medium
CN114567637A (en) * 2022-03-01 2022-05-31 浪潮云信息技术股份公司 Method and system for intelligently setting weight of load balancing back-end server
CN116450054A (en) * 2023-06-16 2023-07-18 成都泛联智存科技有限公司 IO request processing method, device, host and computer readable storage medium
CN116450054B (en) * 2023-06-16 2023-09-26 成都泛联智存科技有限公司 IO request processing method, device, host and computer readable storage medium

Also Published As

Publication number Publication date
CN112532665A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
WO2021052199A1 (en) Server load balancing method and apparatus, and cdn node
US11582641B1 (en) User plane function (UPF) load balancing based on current UPF load and thresholds that depend on UPF capacity
US11477694B1 (en) User plane function (UPF) load balancing based on central processing unit (CPU) and memory utilization of the user equipment (UE) in the UPF
US11483738B1 (en) User plane function (UPF) load balancing based on network data analytics to predict load of user equipment
US11943660B2 (en) User plane function (UPF) load balancing supporting multiple slices
WO2019169556A1 (en) Packet sending method and apparatus, and storage device
KR20200017589A (en) Cloud server for offloading task of mobile node and therefor method in wireless communication system
US20100115031A1 (en) System and Method For Enabling P2P Applications in a Wireless Mobile Network
KR20160086854A (en) Method for distributing available bandwidth of a network amongst ongoing traffic sessions run by devices of the network, corresponding device
EP4221233A1 (en) Data download method and apparatus, computer device and storage medium
CN109548149A (en) A kind of division methods and user terminal of RBG
US11316916B2 (en) Packet processing method, related device, and computer storage medium
CN111510390A (en) Insertion and use of application or radio information in network data packet headers
WO2016029455A1 (en) Resource allocation method and device
TW201725912A (en) Live video matching method and system
CN113556813B (en) Uplink data transmission method, device and system
JP2021501536A (en) Uplink data packet resource allocation method and user terminal
WO2011150803A1 (en) Method, apparatus and system for cache collaboration
CN106686635B (en) Data transmission method and device based on control and configuration protocol of wireless access point
CN112073215B (en) Method for realizing application and service controller
WO2017113373A1 (en) Caching method and packet data network gateway
US10887236B2 (en) Method, network interface card, and computer program product for load balance
WO2020134753A1 (en) Request message processing method, apparatus and system, and server and storage medium
WO2023098550A1 (en) Data transmission method, light transmitting device, and light receiving device
US10462248B2 (en) Digital content sharing cloud service system, digital content sharing cloud service device, and method using the same

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20865291

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20865291

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 26/08/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20865291

Country of ref document: EP

Kind code of ref document: A1