CN117640777A - Gateway load balancing scheduling method and system - Google Patents

Gateway load balancing scheduling method and system Download PDF

Info

Publication number
CN117640777A
CN117640777A CN202311622570.XA CN202311622570A CN117640777A CN 117640777 A CN117640777 A CN 117640777A CN 202311622570 A CN202311622570 A CN 202311622570A CN 117640777 A CN117640777 A CN 117640777A
Authority
CN
China
Prior art keywords
gateway
routing service
node
load balancing
service
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202311622570.XA
Other languages
Chinese (zh)
Inventor
邓昌建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud Technology Co Ltd
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 Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202311622570.XA priority Critical patent/CN117640777A/en
Publication of CN117640777A publication Critical patent/CN117640777A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • 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

Landscapes

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

Abstract

The invention provides a gateway load balancing scheduling method and a system, wherein the method comprises the following steps: determining a resource-intensive task type when the routing service is issued; defining the machine performance index weight on which the routing service depends, and calculating a weighted load value; registering the routing service to the gateway when the node of the routing service is started; the method comprises the steps of dynamically obtaining multidimensional performance indexes such as CPU, memory, disk IO and the like of each node under routing service at regular time through a gateway; when a routing service request is sent to a gateway, reading the collected machine performance index, the configured machine performance index weight and the number of times of calling the routing service in unit time recorded by the gateway according to the service scene type, and selecting a current optimal calling node; and performing routing service request forwarding. The invention adopts the load factor to weight and calculate the node call in unit time, and can route the request to different nodes as much as possible under the condition of ensuring the load balance, thereby realizing the optimal network node request scheduling.

Description

Gateway load balancing scheduling method and system
Technical Field
The invention relates to the technical field of IT and software development, in particular to a gateway load balancing scheduling method and system.
Background
Under the current prevalence of cloud computing technology, system service cluster deployment has become a normal state, so that services can be provided for the outside stably.
When a service has a plurality of nodes to be deployed, the problems of request forwarding and distribution need to be considered, and the service is distributed to each node as uniformly as possible, so that the request load of each service is ensured. There are many devices for balancing loads, such as LVS, nginnx, etc., that support request forwarding policies like IP _ HASH, polling, weighting, etc., the purpose of which is to distribute the requests as evenly as possible to each node, ensuring that the load of each node is kept as much as possible within a reasonable range. However, the existing mechanisms actually have the following problems:
the core resources such as a CPU, a memory, a disk and the like consumed by the service node are not only requests forwarded by the gateway, but also running tasks of timing tasks. When the service needs to execute the distributed timing task, the same task can be executed by only one machine at the same time, so that the service load of the node is necessarily increased, especially when mass data is processed, the service load is more obvious, however, the gateway is not aware in the situation, and the request can be continuously distributed to the node, so that the load of the node is further increased, and when the load of the node is higher, the interface RT and the throughput rate can be influenced, and the service is influenced to a certain extent.
At present, a mode of selecting a best-fit node according to a service node load index is available, however, the prior art lacks of combining the server performance index characteristic depending on the service itself, and only the node with the lowest load is selected when the selected node is called, which can cause a certain node to receive a large number of requests in a short time, but easily causes node faults.
In view of the foregoing, there is a need to design a gateway load balancing scheduling method and apparatus, and combine the service scenario of the service itself to make up for the drawbacks of the gateway load in the prior art, and better complete the network node request scheduling.
Disclosure of Invention
In view of this, the present invention aims to design a method and an apparatus for gateway load balancing scheduling, which implement that a service cluster node dynamically recognizes real-time changes due to distributed timing task execution, RPC transverse call among clusters, performance index difference of a machine itself, and the like, and dynamically forwards a request, so as to ensure that each node index of a service maintains a uniform water level as much as possible, and when a scheduling node is selected, each node participates in call as much as possible by adopting a weight ratio manner in combination with the self characteristics of a service, thereby completing optimal scheduling.
The invention provides a gateway load balancing scheduling method, which comprises the following steps:
s1, when a routing service is issued, determining a resource-intensive task type depending on a business scene of the routing service, and maintaining the content of the resource-intensive task type at a gateway side;
s2, defining a machine performance index weight (load factor) depending on the routing service according to the resource intensive task type, calculating a weighted load value, and maintaining the contents of the machine performance index weight and the weighted load value at a gateway side;
s3, registering the routing service to a gateway when starting a node of the routing service;
s4, dynamically acquiring multidimensional performance indexes of CPU, memory and disk IO of each node under the routing service at regular time through a gateway;
s5, when the routing service request arrives at the gateway, reading the collected machine performance index, the configured machine performance index weight and the number of times of calling the routing service in unit time recorded by the gateway according to the service scene type of the routing service, and selecting a current optimal calling node;
s6, executing the forwarding of the route service request.
Further, the resource-intensive task types of the step S1 include:
one of CPU-intensive tasks and IO-intensive tasks.
Further, the gateway load balancing scheduling method further comprises the following steps:
when the routing service stops, the gateway registration is canceled.
Further, the method of defining the machine performance index weight (load factor) on which the routing service depends in the step S2 includes:
when the resource-intensive task type is a CPU-intensive task, the load factor is defined as: the CPU is 0.8 and the memory is 0.2.
Further, the method for calculating the weighted load value comprises the following steps:
the method comprises the steps of obtaining the load ratios of machines of a plurality of nodes, and calculating the calling duty ratio of each node in unit time based on the load ratios.
Further, the method for calculating the calling duty ratio of each node in unit time comprises the following steps:
and adding the calling times of the plurality of nodes in the unit time, and dividing the calling times of each node in the unit time by the independent calling times of each node in the unit time.
The invention also provides a gateway load balancing scheduling system for executing the gateway load balancing scheduling method, which is characterized by comprising the following steps:
determining a resource intensive task type module: when a routing service is issued, determining a resource-intensive task type depending on a service scene of the routing service, and maintaining the content of the resource-intensive task type at a gateway side;
a weighted load value calculation module: the method comprises the steps of defining machine performance index weights relied on by routing service according to the resource intensive task types, calculating weighted load values, and maintaining the contents of the machine performance index weights and the weighted load values at a gateway side;
a registry module: a node for registering a routing service to a gateway when the routing service is started;
the index acquisition module is used for: the multi-dimensional performance indexes of CPU, memory and disk IO of each node under the routing service are dynamically obtained at regular time through the gateway;
the dispatch center module: when the routing service request is sent to the gateway, reading the collected machine performance index, the configured machine performance index weight and the number of times of calling the routing service in unit time recorded by the gateway according to the service scene type of the routing service, and selecting a current optimal calling node;
executing a forwarding module: for performing routing service request forwarding.
The invention also provides a gateway load balancing scheduling device which is provided with the gateway load balancing scheduling system.
The present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the gateway load balancing scheduling method as described above.
The invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and operable on the processor, the processor implementing the steps of the gateway load balancing scheduling method as described above when executing the program.
Compared with the prior art, the invention has the beneficial effects that:
the gateway load balancing scheduling method supports defining the resource types relied on by the routing service: CPU-intensive tasks or IO-intensive tasks, defining service-dependent machine performance index weights (load factors); the optimal calling can be completed by combining the characteristics of the service; and combining the number of times that a certain node is called in unit time, weighting and calculating the node call in unit time by adopting a load factor, and routing the request to different nodes as far as possible under the condition of ensuring load balance so as to realize optimal network node request scheduling.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention.
In the drawings:
FIG. 1 is a schematic diagram of a system configuration of a gateway load balancing scheduling system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a processing flow of gateway load balancing scheduling according to an embodiment of the present invention;
FIG. 3 is a flow chart of a gateway load balancing scheduling method of the present invention;
fig. 4 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of systems and products consistent with some aspects of the present disclosure as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
Embodiments of the present invention are described in further detail below.
The embodiment of the invention provides a gateway load balancing scheduling method, which is shown in fig. 3 and comprises the following steps:
s1, when a routing service is issued, determining a resource-intensive task type depending on a business scene of the routing service, and maintaining the content of the resource-intensive task type at a gateway side;
in this embodiment, the resource-intensive task types are: CPU intensive tasks.
S2, defining a machine performance index weight (load factor) depending on the routing service according to the resource intensive task type, calculating a weighted load value, and maintaining the contents of the machine performance index weight and the weighted load value at a gateway side;
in this embodiment, the load factor is defined as: the CPU is 0.8 and the memory is 0.2.
The method for calculating the weighted load value comprises the following steps:
the method comprises the steps of obtaining the load ratios of machines of a plurality of nodes, and calculating the calling duty ratio of each node in unit time based on the load ratios.
The method for calculating the calling duty ratio of each node in unit time comprises the following steps:
and adding the calling times of the plurality of nodes in the unit time, and dividing the calling times of each node in the unit time by the independent calling times of each node in the unit time.
S3, registering the routing service to a gateway when starting a node of the routing service;
s4, dynamically acquiring multidimensional performance indexes of CPU, memory and disk IO of each node under the routing service at regular time through a gateway;
s5, when the routing service request arrives at the gateway, reading the collected machine performance index, the configured machine performance index weight and the number of times of calling the routing service in unit time recorded by the gateway according to the service scene type of the routing service, and selecting a current optimal calling node;
s6, executing the forwarding of the route service request.
When the routing service stops, the gateway registration is canceled.
The invention also provides a gateway load balancing scheduling system for executing the gateway load balancing scheduling method, which is characterized by comprising the following steps:
determining a resource intensive task type module: when a routing service is issued, determining a resource-intensive task type depending on a service scene of the routing service, and maintaining the content of the resource-intensive task type at a gateway side;
a weighted load value calculation module: the method comprises the steps of defining machine performance index weights relied on by routing service according to the resource intensive task types, calculating weighted load values, and maintaining the contents of the machine performance index weights and the weighted load values at a gateway side;
a registry module: a node for registering a routing service to a gateway when the routing service is started;
the index acquisition module is used for: the multi-dimensional performance indexes of CPU, memory and disk IO of each node under the routing service are dynamically obtained at regular time through the gateway;
the dispatch center module: when the routing service request is sent to the gateway, reading the collected machine performance index, the configured machine performance index weight and the number of times of calling the routing service in unit time recorded by the gateway according to the service scene type of the routing service, and selecting a current optimal calling node;
executing a forwarding module: for performing routing service request forwarding.
The invention also provides a gateway load balancing scheduling device which is provided with the gateway load balancing scheduling system.
Application example
A system configuration schematic of the present application is shown in fig. 1, and a process flow schematic of the present application is shown in fig. 2. Given the following inputs:
1. let serviceA service have three nodes: 192.168.1.1, 192.168.1.2, 192.168.1.3, and completes gateway registration;
2. determining serviceA as a CPU-intensive service;
3. the load factors defining serviceA services are: { "CPU":0.8, "MEM":0.2}
4. The load acquired by 3 nodes in unit time is shown in table 1:
TABLE 1
5. From this, the load ratio of the three machines is 54:38:84;
6. the call duty cycle per unit time of the three nodes is calculated as shown in table 2:
TABLE 2
7. At this time, the serviceA service has 10 requests in a unit time, and r (i) indicates that the ith request is executed, and the record of execution of the 10 requests is shown in table 3:
TABLE 3 Table 3
The deduction procedure is shown in table 4:
TABLE 4 Table 4
The embodiment of the invention also provides a computer device, and fig. 4 is a schematic structural diagram of the computer device provided by the embodiment of the invention; referring to fig. 4 of the drawings, the computer apparatus includes: an input system 23, an output system 24, a memory 22, and a processor 21; the memory 22 is configured to store one or more programs; when the one or more programs are executed by the one or more processors 21, the one or more processors 21 are caused to implement the gateway load balancing scheduling method as provided in the above embodiments; wherein the input system 23, the output system 24, the memory 22 and the processor 21 may be connected by a bus or otherwise, for example in fig. 4.
The memory 22 is used as a readable storage medium of a computing device, and can be used for storing a software program and a computer executable program, such as program instructions corresponding to the gateway load balancing scheduling method according to the embodiment of the invention; the memory 22 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the device, etc.; in addition, memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device; in some examples, memory 22 may further comprise memory located remotely from processor 21, which may be connected to the device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input system 23 is operable to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the device; output system 24 may include a display device such as a display screen.
The processor 21 executes various functional applications of the device and data processing by running software programs, instructions and modules stored in the memory 22, i.e. implements the gateway load balancing scheduling method described above.
The computer equipment provided by the embodiment can be used for executing the gateway load balancing scheduling method provided by the embodiment, and has corresponding functions and beneficial effects.
Embodiments of the present invention also provide a storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the gateway load balancing scheduling method as provided by the above embodiments, the storage medium being any of various types of memory devices or storage devices, the storage medium comprising: mounting media such as CD-ROM, floppy disk or tape systems; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, lanbas (Rambus) RAM, etc.; nonvolatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc.; the storage medium may also include other types of memory or combinations thereof; in addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a second, different computer system, the second computer system being connected to the first computer system through a network (such as the internet); the second computer system may provide program instructions to the first computer for execution. Storage media includes two or more storage media that may reside in different locations (e.g., in different computer systems connected by a network). The storage medium may store program instructions (e.g., embodied as a computer program) executable by one or more processors.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the gateway load balancing scheduling method described in the above embodiments, and may also perform the related operations in the gateway load balancing scheduling method provided in any embodiment of the present invention.
Thus far, the technical solution of the present invention has been described in connection with the preferred embodiments shown in the drawings, but it is easily understood by those skilled in the art that the scope of protection of the present invention is not limited to these specific embodiments. Equivalent modifications and substitutions for related technical features may be made by those skilled in the art without departing from the principles of the present invention, and such modifications and substitutions will be within the scope of the present invention.
The foregoing description is only of the preferred embodiments of the invention and is not intended to limit the invention; various modifications and variations of the present invention will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. The gateway load balancing scheduling method is characterized by comprising the following steps of:
s1, when a routing service is issued, determining a resource-intensive task type depending on a business scene of the routing service, and maintaining the content of the resource-intensive task type at a gateway side;
s2, defining machine performance index weights relied by the routing service according to the resource intensive task types, calculating weighted load values, and maintaining the contents of the machine performance index weights and the weighted load values at a gateway side;
s3, registering the routing service to a gateway when starting a node of the routing service;
s4, dynamically acquiring multidimensional performance indexes of CPU, memory and disk IO of each node under the routing service at regular time through a gateway;
s5, when the routing service request arrives at the gateway, reading the collected machine performance index, the configured machine performance index weight and the number of times of calling the routing service in unit time recorded by the gateway according to the service scene type of the routing service, and selecting a current optimal calling node;
s6, executing the forwarding of the route service request.
2. The gateway load balancing scheduling method of claim 1, wherein the resource intensive task types of step S1 comprise:
one of CPU-intensive tasks and IO-intensive tasks.
3. The gateway load balancing scheduling method according to claim 1, further comprising:
when the routing service stops, the gateway registration is canceled.
4. The gateway load balancing scheduling method of claim 2, wherein the method of defining the routing service dependent machine performance index weight of step S2 comprises:
when the resource-intensive task type is a CPU-intensive task, the load factor is defined as: the CPU is 0.8 and the memory is 0.2.
5. The gateway load balancing scheduling method of claim 4, wherein said method of calculating a weighted load value comprises:
the method comprises the steps of obtaining the load ratios of machines of a plurality of nodes, and calculating the calling duty ratio of each node in unit time based on the load ratios.
6. The gateway load balancing scheduling method according to claim 5, wherein the method for calculating the call duty ratio of each node in unit time is as follows:
and adding the calling times of the plurality of nodes in the unit time, and dividing the calling times of each node in the unit time by the independent calling times of each node in the unit time.
7. A gateway load balancing scheduling system for performing a gateway load balancing scheduling method according to any one of claims 1-6, comprising:
determining a resource intensive task type module: when a routing service is issued, determining a resource-intensive task type depending on a service scene of the routing service, and maintaining the content of the resource-intensive task type at a gateway side;
a weighted load value calculation module: the method comprises the steps of defining machine performance index weights relied on by routing service according to the resource intensive task types, calculating weighted load values, and maintaining the contents of the machine performance index weights and the weighted load values at a gateway side;
a registry module: a node for registering a routing service to a gateway when the routing service is started;
the index acquisition module is used for: the multi-dimensional performance indexes of CPU, memory and disk IO of each node under the routing service are dynamically obtained at regular time through the gateway;
the dispatch center module: when the routing service request is sent to the gateway, reading the collected machine performance index, the configured machine performance index weight and the number of times of calling the routing service in unit time recorded by the gateway according to the service scene type of the routing service, and selecting a current optimal calling node;
executing a forwarding module: for performing routing service request forwarding.
8. A gateway load balancing scheduling apparatus, wherein the gateway load balancing scheduling system according to claim 7 is installed.
9. A computer readable storage medium having stored thereon a computer program, wherein the program when executed by a processor implements the steps of the gateway load balancing scheduling method of any of claims 1-6.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the gateway load balancing scheduling method of any of claims 1-6 when the program is executed by the processor.
CN202311622570.XA 2023-11-30 2023-11-30 Gateway load balancing scheduling method and system Pending CN117640777A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311622570.XA CN117640777A (en) 2023-11-30 2023-11-30 Gateway load balancing scheduling method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311622570.XA CN117640777A (en) 2023-11-30 2023-11-30 Gateway load balancing scheduling method and system

Publications (1)

Publication Number Publication Date
CN117640777A true CN117640777A (en) 2024-03-01

Family

ID=90028291

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311622570.XA Pending CN117640777A (en) 2023-11-30 2023-11-30 Gateway load balancing scheduling method and system

Country Status (1)

Country Link
CN (1) CN117640777A (en)

Similar Documents

Publication Publication Date Title
CN109218355B (en) Load balancing engine, client, distributed computing system and load balancing method
US10466899B2 (en) Selecting controllers based on affinity between access devices and storage segments
JP6290462B2 (en) Coordinated admission control for network accessible block storage
US20130060834A1 (en) Distributed messaging system connectivity and resource management
US11336718B2 (en) Usage-based server load balancing
CN108881512B (en) CTDB virtual IP balance distribution method, device, equipment and medium
CN106503058B (en) A kind of data load method, terminal and computing cluster
CN108900626B (en) Data storage method, device and system in cloud environment
WO2010026362A1 (en) Distributed data processing system
CN107105013B (en) File processing method, server, terminal and system
CN109510878B (en) Long connection session keeping method and device
US20220329651A1 (en) Apparatus for container orchestration in geographically distributed multi-cloud environment and method using the same
CN115334082A (en) Load balancing method, device, computer equipment, storage medium and product
CN112272217A (en) Kafka cluster load balancing method, system, equipment and medium
JP2016051446A (en) Calculator system, calculator, and load dispersing method and program
CN114036031B (en) Scheduling system and method for resource service application in enterprise digital middleboxes
CN114666335A (en) DDS-based distributed system load balancing device
CN108063814A (en) A kind of load-balancing method and device
CN115361332B (en) Fault-tolerant route processing method and device, processor and electronic equipment
CN117640777A (en) Gateway load balancing scheduling method and system
CN113014408A (en) Distributed system and management method thereof
CN115952003A (en) Method, device, equipment and storage medium for cluster server load balancing
CN109933426B (en) Service call processing method and device, electronic equipment and readable storage medium
CN109347944A (en) A kind of domain name analytic method and device
CN115801787B (en) Road end data transmission method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination