CN111131486B - Load adjustment method and device of execution node, server and storage medium - Google Patents

Load adjustment method and device of execution node, server and storage medium Download PDF

Info

Publication number
CN111131486B
CN111131486B CN201911397938.0A CN201911397938A CN111131486B CN 111131486 B CN111131486 B CN 111131486B CN 201911397938 A CN201911397938 A CN 201911397938A CN 111131486 B CN111131486 B CN 111131486B
Authority
CN
China
Prior art keywords
execution node
service instance
execution
target
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.)
Active
Application number
CN201911397938.0A
Other languages
Chinese (zh)
Other versions
CN111131486A (en
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.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online 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 Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201911397938.0A priority Critical patent/CN111131486B/en
Publication of CN111131486A publication Critical patent/CN111131486A/en
Application granted granted Critical
Publication of CN111131486B publication Critical patent/CN111131486B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a load adjustment method and device of an execution node, a server and a storage medium, and belongs to the technical field of cloud services. The method comprises the following steps: for a plurality of execution nodes in a cloud service architecture, acquiring operation data of each execution node; determining a first execution node of the service instance to be migrated and a second execution node of the service instance to be received from a plurality of execution nodes according to the operation data of each execution node; selecting a first target service instance to be migrated from a first execution node; a first target service instance within a first execution node is migrated into a second execution node. In the embodiment of the application, when a first execution node with an excessive load exists in a cloud service architecture, a first target service instance in the first execution node can be migrated into a second execution node, so that the load of the first execution node is reduced, load balancing of a plurality of execution nodes is realized, and the speed of processing a network service request by the plurality of execution nodes is increased.

Description

Load adjustment method and device of execution node, server and storage medium
Technical Field
The present application relates to the field of cloud service technologies, and in particular, to a method and an apparatus for adjusting a load of an execution node, a server, and a storage medium.
Background
With the development of cloud service technology, more and more network services can be processed through Node servers. The Node server comprises a plurality of execution nodes, and each execution Node comprises a plurality of types of service instances. Wherein each type of service instance can handle a corresponding type of network service request. Because each type of service instance occupies a different resource of the executing node, the load that each type of service instance imposes on the executing node is different. Thus, even if the number of service instances within each executing node is the same, the load on each executing node may be different. Thus, the Node server has a condition that the load of part of the execution nodes is overlarge, and the overlarge load of the execution nodes can influence the speed of the execution nodes for processing the network service request. Therefore, how to adjust the load of multiple execution nodes in a Node server makes load balancing of each execution Node an important point of interest in the industry.
Disclosure of Invention
The embodiment of the application provides a load adjusting method, a load adjusting device, a server and a storage medium, which can solve the problem of unbalanced load of a plurality of execution nodes. The technical scheme is as follows:
according to an aspect of embodiments of the present application, there is provided a method for performing load adjustment of a node, the method including:
for a plurality of execution nodes in a cloud service architecture, acquiring operation data of each execution node;
determining a first execution node of the service instance to be migrated and a second execution node of the service instance to be received from the plurality of execution nodes according to the operation data of each execution node;
selecting a first target service instance to be migrated from the first execution node;
migrating the first target service instance within the first execution node into the second execution node.
In one possible implementation manner, the selecting, from the first execution node, a first target service instance to be migrated includes:
determining a first number of unprocessed service requests corresponding to each service instance within the first execution node;
and selecting the first target service instance from the first execution node according to the first quantity of the unprocessed service requests corresponding to each service instance.
In another possible implementation manner, the selecting, according to the first number of unprocessed service requests corresponding to each service instance, the first target service instance from the first execution node includes: and selecting a first target service instance with the minimum first quantity from the first execution node according to the first quantity of the unprocessed service requests corresponding to each service instance.
In another possible implementation manner, the selecting, according to the first number of unprocessed service requests corresponding to each service instance, the first target service instance from the first execution node includes:
determining a second number of unprocessed service requests corresponding to each type in the first execution node according to the first number of unprocessed service requests corresponding to each service instance and the type of each service instance;
selecting a target type with the minimum second number from the first execution node according to the second number of the unprocessed service requests corresponding to each type;
a first target service instance of the target type is selected from the first executing node.
In another possible implementation manner, the migrating the first target service instance in the first execution node to the second execution node includes:
creating a second target service instance of the target type in the second execution node according to the target type of the first target service instance; processing the service request by the second target service instance when the service request of the target type is received;
and closing the first target service instance in the first execution node when the first target service instance finishes processing the unprocessed service request.
In another possible implementation manner, the determining, according to the operation data of each execution node, a first execution node to which a service instance is to be migrated and a second execution node to which a service instance is to be received from the plurality of execution nodes includes:
determining the load of each execution node according to the operation data of each execution node;
and according to the load of each execution node, determining a first execution node with the load larger than a first load threshold value and a second execution node with the load smaller than a second load threshold value from the plurality of execution nodes.
In another possible implementation manner, the determining the load of each execution node according to the operation data of each execution node includes:
and for each execution node, carrying out weighted summation on the CPU occupancy rate and the memory utilization rate of the execution node to obtain the load of the execution node.
According to another aspect of the embodiments of the present application, there is provided a load regulation apparatus of an execution node, the apparatus including:
the acquisition module is used for acquiring the operation data of each execution node for a plurality of execution nodes in the cloud service architecture;
a determining module, configured to determine, according to the operation data of each execution node, a first execution node of the service instance to be migrated and a second execution node of the service instance to be received from the plurality of execution nodes;
a selection module, configured to select a first target service instance to be migrated from the first execution node;
a migration module, configured to migrate the first target service instance in the first execution node into the second execution node.
In a possible implementation manner, the selection module is further configured to determine a first number of unprocessed service requests corresponding to each service instance in the first execution node; and selecting the first target service instance from the first execution node according to the first quantity of the unprocessed service requests corresponding to each service instance.
In another possible implementation manner, the selection module is further configured to select, according to the first number of unprocessed service requests corresponding to each service instance, a first target service instance with a minimum first number from the first execution node.
In another possible implementation manner, the selection module is further configured to determine, according to the first number of unprocessed service requests corresponding to each service instance and the type of each service instance, a second number of unprocessed service requests corresponding to each type in the first execution node; selecting a target type with the minimum second number from the first execution node according to the second number of the unprocessed service requests corresponding to each type; a first target service instance of the target type is selected from the first executing node.
In another possible implementation manner, the migration module is further configured to create, in the second execution node, a second target service instance of the target type according to the target type of the first target service instance; processing the service request by the second target service instance when the service request of the target type is received;
and closing the first target service instance in the first execution node when the first target service instance finishes processing the unprocessed service request.
In another possible implementation manner, the determining module is further configured to determine a load of each execution node according to the operation data of each execution node; and according to the load of each execution node, determining a first execution node with the load larger than a first load threshold value and a second execution node with the load smaller than a second load threshold value from the plurality of execution nodes.
In another possible implementation manner, the operation data includes CPU occupancy and memory usage of a central processing unit, and the determining module is further configured to perform weighted summation on the CPU occupancy and the memory usage of the execution node for each execution node to obtain a load of the execution node.
According to another aspect of embodiments of the present application, there is provided a server, including: the load regulation method comprises a processor and a memory, wherein at least one instruction is stored in the memory, and the at least one instruction is loaded by the processor and executed to realize the operation of the load regulation method in any one of the above possible implementation manners.
According to another aspect of embodiments of the present application, there is provided a computer-readable storage medium having stored therein at least one instruction, which is loaded by a processor and has an operation to implement as performed in the load adjustment method.
In the embodiment of the application, for a plurality of execution nodes in a cloud service architecture, the operation data of each execution node is acquired; determining a first execution node of a service instance to be migrated and a second execution node of a service instance to be received from a plurality of execution nodes according to the operation data of each execution node; selecting a first target service instance to be migrated from a first execution node; a first target service instance within a first execution node is migrated into a second execution node. Therefore, when the first execution node with overlarge load exists in the cloud service architecture, the first target service instance in the first execution node can be migrated into the second execution node, the load of the first execution node is reduced, and the speed of processing the network service request by the first execution node is improved. Therefore, the load adjustment method can realize load balance of a plurality of execution nodes in the cloud service architecture and improve the speed of the plurality of execution nodes for processing the network service request.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the present application;
fig. 2 is a schematic diagram of a method for performing load adjustment of a node according to an embodiment of the present application;
fig. 3 is a flowchart of a method for performing load adjustment of a node according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a load adjustment apparatus of an execution node according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Referring to fig. 1, the implementation environment includes a terminal 101 and a cloud service architecture 102. The cloud service framework 102 may be a Node server (Node cloud service).
The terminal 101 and the cloud service architecture 102 are connected through a wireless or wired network. Moreover, a client for providing services by the cloud service architecture 102 may be installed on the terminal 101, and a user corresponding to the terminal 101 may implement functions such as data transmission and message interaction between the client and the cloud service architecture 102. The client may be a client installed on the terminal 101 and including an internet access function. For example, the client may be a browser, a social application, a gaming application, or a take-away application, among others.
The terminal 101 may be a computer, a mobile phone, a tablet computer or other electronic devices. The cloud service architecture 102 may be a server, a server cluster composed of several servers, or a cloud computing service center.
In this embodiment, the cloud service framework 102 is a Node server. The Node server comprises a server and a plurality of execution nodes; the server may control multiple execution nodes. The server may be a central control node, and the central control node may perform node control on a plurality of execution nodes. Each execution node comprises multiple types of service instances, each type of service instance processes service requests corresponding to the type of service instance, and the number of the service requests corresponding to each type of service instance is different.
Referring to fig. 2, the central control node includes an API (Application Programming Interface) gateway, a node controller, and a patrol node.
The API is used for receiving a service request, and the service request carries a service type; according to the service type, the service request is distributed to a service instance in the execution node for processing the service type.
The patrol node is used for acquiring the operation data of each execution node, determining the load of each execution node according to the operation data of each execution node, and sending the load of each execution node to the node controller.
The node controller is used for receiving the load of each execution node, and selecting a first execution node A with the load larger than a first load threshold value and a second execution node B with the load smaller than a second load threshold value according to the load of each execution node.
When a first execution node A with the load larger than a first load threshold value exists, the node controller determines a service instance D to be migrated according to the number of unprocessed service requests corresponding to each service instance in the first execution node A. And the node controller modifies the flow distribution strategy through the API gateway, and does not distribute the corresponding service request to the service instance D to be migrated in the first execution node A. And when the service instance D to be migrated in the first execution node A finishes processing the corresponding service request, the node controller closes the service instance D to be migrated in the first execution node A. The node controller creates a service instance D to be migrated on a second executing node B with a load less than a second load threshold. And the node controller distributes a service request corresponding to the service instance D to the second execution node B through the API gateway, and the service instance D established on the second execution node B processes the service request.
Fig. 3 is a flowchart of a method for performing load adjustment of a node according to an embodiment of the present disclosure. Referring to fig. 3, the method comprises the steps of:
301. for a plurality of execution nodes in the cloud service architecture, the server acquires the operation data of each execution node.
The operation data may include at least one of a Central Processing Unit (CPU) occupancy rate and a memory usage rate.
It should be noted that the CPU occupancy may be the CPU occupancy at the current time point, or may be an average value of the CPU occupancy in the first specific time period. The memory usage rate may be a memory usage rate at the current time point, or may be an average value of the memory usage rates in the second specific time period. The first specific time period and the second specific time period may be the same or different.
In one possible implementation, multiple service instances are contained within an execution node. The server can acquire the operation data of the execution node through each service instance. Correspondingly, the step of the server obtaining the operation data of each execution node may be:
for each execution node, the server acquires the operation data of each service instance in the execution node; and determining the operation data of the execution node according to the operation data of each service instance.
When the operation data includes the CPU occupancy rate, the step of determining, by the server, the operation data of the execution node according to the operation data of each service instance may be: and the server determines the sum of the CPU occupancy rates of each service instance as the CPU occupancy rate of the execution node.
For example, there are four service instances within the executing node a: the service system comprises a first service instance A, a second service instance A, a first service instance B and a second service instance B. The server obtains that the CUP occupancy rate of the first service instance A is 1%, the CUP occupancy rate of the second service instance A is 1.1%, the CUP occupancy rate of the first service instance B is 2%, the CUP occupancy rate of the second service instance B is 1.9%, and then the CUP occupancy rate of the execution node A is 6%.
When the operation data includes a memory usage rate, the step of determining, by the server, the operation data of the execution node according to the operation data of each service instance may be: and the server determines the sum of the memory utilization rates of each service instance as the memory utilization rate of the execution node.
When the operation data includes CPU occupancy and memory usage, the step of determining, by the server, the operation data of the execution node according to the operation data of each service instance may be: the server determines the sum of the CPU occupancy rates of each service instance as the CPU occupancy rate of the execution node; and determining the sum of the memory utilization rates of each service instance as the memory utilization rate of the execution node.
In the embodiment of the application, the server obtains the operation data of the execution node through the operation data of each service instance, so that the accuracy of the operation data of the execution node is improved.
In another possible implementation, multiple types of service instances are contained within each execution node. The server can obtain the operation data of the execution node through the operation data of each type of service instance in the execution node and the weight corresponding to the operation data of each type of service instance. Correspondingly, the step of determining, by the server according to the operation data of each service instance, the operation data of the execution node may be: the server obtains the running data of each type of service instance. The server passes the operation data of each type of service instance and the corresponding weight of the operation data of each type of service instance; and carrying out weighted summation on the operation data of each type of service instance to obtain the operation data of the execution node. The server can determine the weight corresponding to the running data of each type of service instance according to the time for each type of service instance to process the service request.
It should be noted that the server may obtain the operation data of each execution node in real time, or may obtain the operation data of each execution node every first preset time. Wherein, the first preset time period may be 10 minutes, 30 minutes, 50 minutes, or the like.
In another possible implementation manner, each executing node may send the running data of the executing node to the server every second preset time period. The server receives the operation data sent by each execution node. Wherein, the second preset time period may be 10 minutes, 30 minutes, 50 minutes, or the like.
In another possible implementation manner, each execution node may send the execution data of the execution node to the server according to the condition of the execution data of the execution node.
When the operational data includes a CPU occupancy, the execution node sends the CPU occupancy of the execution node to the server when the CPU occupancy is greater than a first CPU occupancy threshold or the CPU occupancy is less than a second CPU occupancy threshold.
When the operation data comprises a memory usage rate, and when the memory usage rate is greater than a first memory usage rate threshold or the memory usage rate is less than a second memory usage rate threshold, the execution node sends the memory usage rate of the execution node to the server.
When the operation data comprises the CPU occupancy rate and the memory utilization rate, when the CPU occupancy rate is greater than a first CPU occupancy rate threshold value and the memory utilization rate is greater than a first memory utilization rate threshold value or the CPU occupancy rate is less than a second CPU occupancy rate threshold value and the memory utilization rate is less than a second memory utilization rate threshold value, the execution node sends the CPU occupancy rate and the memory utilization rate of the execution node to the server.
302. And the server determines a first execution node of the service instance to be migrated and a second execution node of the service instance to be received from the plurality of execution nodes according to the operation data of each execution node.
In the embodiment of the present application, in order to balance the loads of a plurality of execution nodes, the load of each execution node needs to be determined. The first execution node is a node with a load larger than a first threshold value in the execution nodes, and the second execution node is a node with a load smaller than a second threshold value in the execution nodes.
In one possible implementation, the operational data of the executing node is related to the load of the executing node. Correspondingly, the server determines a first execution node of the service instance to be migrated and a second execution node of the service instance to be received from the plurality of execution nodes according to the operation data of each execution node, and the method can be implemented by the following steps (1) to (2):
(1) And the server determines the load of each execution node according to the operation data of each execution node.
When the operation data comprises the CPU occupancy rate, correspondingly, the step that the server determines the load of each execution node according to the operation data of each execution node is as follows: for each execution node, the server takes the CPU occupancy of that execution node as the load of that execution node.
When the operation data comprises the memory usage rate, correspondingly, the step of determining the load of each execution node by the server according to the operation data of each execution node comprises the following steps: for each execution node, the server takes the memory usage of the execution node as the load of the execution node.
When the operation data includes CPU occupancy and memory usage. Correspondingly, the step of determining, by the server, the load of each execution node according to the operation data of each execution node may be: and for each execution node, the server performs weighted summation on the CPU occupancy rate and the memory utilization rate of the execution node to obtain the load of the execution node.
In one possible implementation, the server stores a weight of the CPU occupancy rate and a weight of the memory usage rate. For example, the CPU occupancy rate and the memory usage rate stored in the server are both 0.5 in weight. When the CPU occupancy of the execution node is 60% and the memory usage of the execution node is 80%, the load of the execution node is 0.5 × 60% +0.5 × 80%, i.e., 70%.
In another possible implementation manner, the server may determine the weight of the CPU occupancy and the weight of the memory usage rate according to a corresponding relationship between the CPU occupancy and the memory usage rate of the execution node and the time for the execution node to process the service request.
The larger the CPU occupancy rate of the execution node is, the longer the time for the execution node to process the service request is; the greater the memory usage of the executing node, the longer the executing node will take to process the service request. The server may obtain a first positive correlation between the CPU occupancy and a time to process the service request; and acquiring a second positive correlation between the memory utilization rate and the time for processing the service request. And the server determines the weight of the CPU occupancy rate and the weight of the memory utilization rate according to the first positive correlation and the second positive correlation.
In another possible implementation manner, when the number of unprocessed service requests corresponding to the execution node is large, the load of the execution node is large; when the number of unprocessed service requests corresponding to the execution node is small, the load of the execution node is small. Correspondingly, the step of determining, by the server, the load of each execution node according to the operation data of each execution node may be: and for each execution node, the server carries out weighted summation on the operation data of the execution node and the number of the unprocessed service requests to obtain the load of the execution node.
In one possible implementation, the server stores a weight of the running data and a weight of the number of unprocessed service requests.
In another possible implementation manner, a correspondence between a ratio of the number of the running data and the number of the unprocessed service requests and a weight of the running data and a weight of the number of the unprocessed service requests is stored in the server. Accordingly, the server determines the weight of the operation data and the weight of the number of the unprocessed service requests from the correspondence between the ratio of the stored operation data and the number of the unprocessed service requests and the weight of the operation data and the weight of the number of the unprocessed service requests according to the operation data and the number of the unprocessed service requests.
In the embodiment of the application, the server combines the number of the running data and the number of the unprocessed service requests of the execution node by weighting and summing the number of the running data and the number of the unprocessed service requests of the execution node, so that the accuracy of the load of the execution node is improved.
(2) The server determines a first execution node with a load larger than a first load threshold value and a second execution node with a load smaller than a second load threshold value from a plurality of execution nodes according to the load of each execution node.
The first load threshold may be any value between 60% and 100%, for example, 60%, 70%, 80%, or the like. The second load threshold may be any value between 0% and 60%, e.g. 10%, 20% or 30%, etc. In the embodiment of the present application, the first load threshold and the second load threshold are not specifically limited, and may be set and changed as needed.
The lower the first load threshold is, the more the number of the first execution nodes is, and the higher the first load threshold is, the less the number of the first execution nodes is. In a possible implementation manner, the server may determine the first load threshold according to a corresponding relationship between the number of the first execution nodes and the first load threshold. Correspondingly, the server determines the target number of the first execution nodes; and the server determines a first load threshold corresponding to the target number from the corresponding relation between the number of the first execution nodes and the first load threshold according to the target number.
For example, the server determines that the target number of first executing nodes is 10, and when the number of first executing nodes is 10, the corresponding first load threshold is 80%. The server determines that the first load threshold corresponding to the target number of 10 is 80%.
It should be noted that the number of the first executing nodes may be 0, 1, 2 or more. Accordingly, the number of second executing nodes may be 0, 1, 2 or more. When the number of the first execution nodes is 0, the server does not adjust the load of the execution nodes, and the number of the second execution nodes is 0. The number of the second executing nodes may be the same as or different from the number of the first executing nodes. For example, when the number of first executing nodes is 2, the number of second executing nodes may be 2, 3, or the like.
Another point to be noted is that, when the number of the first execution nodes is multiple, in a possible implementation manner, the server may adjust the loads of multiple first execution nodes together. In another possible implementation manner, the server may respectively adjust, for the plurality of first execution nodes, the number of service requests corresponding to each first execution node according to the number of service requests corresponding to each first execution node. Correspondingly, the server obtains the number of service requests corresponding to each first execution node. The server determines the adjustment sequence of the plurality of first execution nodes according to the service request quantity of each execution node. The server ranks the first executing node with a small number of service requests ahead of the reconciliation order.
303. The server selects a first target service instance to be migrated from the first executing node.
In the embodiment of the application, the first execution node comprises a plurality of service instances, and the server can reduce the number of the service instances in the first execution node by migrating the service instances, so that the load of the first execution node is reduced.
In a possible implementation manner, the server may determine the target service instance to be migrated according to the number of unprocessed service requests corresponding to each service instance. Correspondingly, the server selects a first target service instance to be migrated from the first execution node, and the method comprises the following steps: the server determines a first number of unprocessed service requests corresponding to each service instance within the first execution node. The server selects a first target service instance from within the first execution node based on a first number of unprocessed service requests corresponding to each service instance.
In one possible implementation, the server selects the first minimum number of service instances as the first target service instance. Accordingly, the server determines a first number of unprocessed service requests for each service instance within the first execution node. The server selects the service instance with the minimum first quantity from the first execution node as a first target service instance.
In another possible implementation manner, the server selects an unprocessed service request smaller than a certain number of service instances as the first target service instance. Correspondingly, the server determines a first number of unprocessed service requests corresponding to each service instance in the first execution node, and selects the service instance with the first number smaller than a first number threshold value from the first execution node as a first target service instance. Wherein the first number threshold may be 10, 20, 30, etc. In the embodiment of the present application, the first number threshold is not particularly limited, and may be set and changed as needed.
It should be noted that, the server needs to migrate the first target service instance when the first target service instance finishes processing the service request that is not processed in the execution node. Therefore, the smaller the first number corresponding to the first target service instance is, the shorter the time for the server to migrate the first target service instance is, and the higher the efficiency of adjusting the execution node is.
In the embodiment of the application, the server determines the first number of unprocessed service requests corresponding to each service instance in the first execution node, and selects the service instance with the first number smaller than the first number threshold value as the first target service instance, so that the time of the migrated first target service instance is reduced, and the efficiency of the server in adjusting the load of the execution node is improved.
In another possible implementation manner, the server may determine the target service instance to be migrated according to the load corresponding to each service instance. Correspondingly, the server selects a first target service instance to be migrated from the first execution node, and the method comprises the following steps: and the server selects the service instance with the load larger than the third load threshold value from the first execution node as a first target service instance according to the load corresponding to each service instance in the first execution node. Wherein the third loading threshold may be any value between 1% and 10%, for example, 1%, 2%, or 3%.
In the embodiment of the application, the server determines the load corresponding to each service instance in the first execution node, and selects the service instance with the load greater than the third load threshold value as the first target service instance, so that when the same load of the execution node is reduced, the number of the migrated first target service instances is reduced, and the efficiency of the server in adjusting the load of the execution node is improved.
In another possible implementation manner, the first execution node includes multiple types of service instances, and the server may reduce the types of the service instances in the first execution node by migrating any type of service instance, thereby reducing the load of the first execution node. Correspondingly, the server determines a second number of the unprocessed service requests corresponding to each type in the first execution node according to the first number of the unprocessed service requests corresponding to each service instance and the type of each service instance; selecting a target type with the minimum second number from the first execution node according to the second number of the unprocessed service requests corresponding to each type; a first target service instance of a target type is selected from a first executing node.
It should be noted that the server needs to migrate the first target service instance of the type when the first target service instance of the target type finishes processing all unprocessed service requests corresponding to the service instance of the type in the execution node. The smaller the second number of service requests corresponding to the type of first target service instance, the shorter the time for the server to migrate the type of first target service instance. Another point to be noted is that, when the type of the service instance in the first execution node decreases, the type of the service request received by the first execution node decreases, and the number of received service requests also decreases accordingly.
In the embodiment of the application, the server reduces the load of the execution node by reducing the type of the service instance in the first execution node; and because the executing node does not receive the service request of the type, the type of the service request received by the executing node is reduced, the load of the executing node can be prevented from being increased again, and the stability of the load of the executing node is improved.
304. The server migrates a first target service instance within a first execution node into a second execution node.
In the embodiment of the application, the server closes the first target service instance in the first execution node; a second target service instance of the same type as the first target service instance is created within the second execution node. Migration of a first target service instance within a first execution node into a second execution node is achieved.
It should be noted that, when the first target service instance finishes processing the unprocessed service request, the server closes the first target service instance in the first execution node.
In one possible implementation, when there are multiple first target service instances within the first executing node. For a plurality of first target service instances in the first execution node, the first target service instances of the first execution node are respectively closed when the unprocessed service requests corresponding to the target service instances are processed. Correspondingly, the server obtains a fifth number of unprocessed service requests corresponding to the first target service instance. And when the acquired fifth quantity is zero, closing the first target service instance.
In another possible implementation, when there are multiple first target service instances within the first executing node. And for a plurality of first target service instances in the first execution node, closing the plurality of first target service instances together when the plurality of first target service instances finish processing all unprocessed service requests corresponding to the service instances. Correspondingly, the server obtains a sixth number of all unprocessed service requests corresponding to the first target service instance of the target type. When the sixth number of acquisitions is zero, the first target service instance for the target type is closed.
In another possible implementation manner, when there are multiple first target service instances in the first execution node, and the number of unprocessed service requests corresponding to each first target service instance is different, the server may redistribute the unprocessed service requests. The server may distribute the unprocessed service requests to each first target service instance on average according to the number of the first target service instances and the number of the unprocessed service requests corresponding to the plurality of first target service instances.
And for each first execution node, when the plurality of first target service instances finish processing the unprocessed service requests corresponding to the plurality of first target service instances in the first execution node, closing the plurality of first target service instances together.
In another possible implementation manner, for each first execution node, when the plurality of first target service instances finish processing the unprocessed service requests corresponding to the plurality of first target service instances in the first execution node, the first execution node only receives the service request of the type sent by the specific service party.
In one possible implementation, the target type and number of second target service instances that create the target type within the second execution node may be the same as the target type and number of first target service instances within the first execution node. Correspondingly, the server obtains the target type and the third number of the first target service instance in the first execution node. The server creates a third number of second target service instances of the target type within the second execution node based on the target type and the third number.
In another possible implementation, the target type of the second target service instance of the target type created in the second execution node is the same as the target type of the first target service instance in the first execution node. The number of second target service instances is proportional to the number of service requests corresponding to the first target service instances within the first execution node. The proportional relationship between the number of the second target service instances and the number of the service requests corresponding to the first target service instances in the first execution node may be 1. Correspondingly, creating a second target service instance with the same type as the first target service instance in a second execution node comprises: the server determines the target type of the second target service instance according to the target type of the first target service instance in the first execution node. The server acquires a third quantity of service requests corresponding to the first target service instance in the first execution node; and determining the number of the second target service instances from the proportional relation between the number of the second target service instances and the number of the service requests corresponding to the first target service instances in the first execution node according to the third number.
In the embodiment of the application, for a plurality of execution nodes in a cloud service architecture, a server acquires the operation data of each execution node; the server determines a first execution node of the service instance to be migrated and a second execution node of the service instance to be received from a plurality of execution nodes according to the operation data of each execution node; the server selects a first target service instance to be migrated from the first execution node; a first target service instance within a first execution node is migrated into a second execution node. Therefore, when the first execution node with overlarge load exists in the cloud service architecture, the server can transfer the first target service instance in the first execution node into the second execution node, so that the load of the first execution node is reduced, and the speed of processing the network service request by the first execution node is increased. Therefore, the load adjustment method can realize load balance of a plurality of execution nodes in the cloud service architecture and improve the speed of processing the network service request by the plurality of execution nodes.
Fig. 4 is a schematic structural diagram of a load adjustment device of an execution node according to an embodiment of the present application. Referring to fig. 4, the apparatus includes:
an obtaining module 401, configured to obtain, for multiple execution nodes in a cloud service architecture, operation data of each execution node;
a determining module 402, configured to determine, according to the operation data of each executing node, a first executing node of the service instance to be migrated and a second executing node of the service instance to be received from the multiple executing nodes;
a selecting module 403, configured to select a first target service instance to be migrated from a first executing node;
a migration module 404, configured to migrate a first target service instance in a first execution node to a second execution node.
In another possible implementation manner, the selecting module 403 is further configured to determine a first number of unprocessed service requests corresponding to each service instance in the first executing node; a first target service instance is selected from within the first execution node based on a first number of unprocessed service requests corresponding to each service instance.
In another possible implementation manner, the selecting module 403 is further configured to select, according to the first number of unprocessed service requests corresponding to each service instance, a first target service instance with a smallest first number from the first executing node.
In another possible implementation manner, the selecting module 403 is further configured to determine, according to the first number of unprocessed service requests corresponding to each service instance and the type of each service instance, a second number of unprocessed service requests corresponding to each type in the first executing node; selecting a target type with the minimum second number from the first execution node according to the second number of the unprocessed service requests corresponding to each type; a first target service instance of a target type is selected from a first executing node.
In another possible implementation manner, the migration module 404 is further configured to create, according to the target type of the first target service instance, a second target service instance of the target type in the second execution node; processing the service request through a second target service instance when receiving the service request of the target type;
and closing the first target service instance in the first execution node when the first target service instance finishes processing the unprocessed service request.
In another possible implementation manner, the determining module 402 is further configured to determine a load of each execution node according to the operation data of each execution node; according to the load of each execution node, a first execution node with the load larger than a first load threshold value and a second execution node with the load smaller than a second load threshold value are determined from the plurality of execution nodes.
In another possible implementation manner, the operation data includes CPU occupancy and memory usage of the central processing unit, and the determining module 402 is further configured to perform weighted summation on the CPU occupancy and the memory usage of the execution node for each execution node to obtain a load of the execution node.
In the embodiment of the application, for a plurality of execution nodes in a cloud service architecture, a server acquires the operation data of each execution node; the server determines a first execution node of the service instance to be migrated and a second execution node of the service instance to be received from a plurality of execution nodes according to the operation data of each execution node; the server selects a first target service instance to be migrated from the first execution node; a first target service instance within a first execution node is migrated into a second execution node. In this way, when the first execution node with the overlarge load exists in the cloud service architecture, the server can migrate the first target service instance in the first execution node into the second execution node, so that the load of the first execution node is reduced, and the speed of processing the network service request by the first execution node is increased. Therefore, the load adjustment method can realize load balance of a plurality of execution nodes in the cloud service architecture and improve the speed of processing the network service request by the plurality of execution nodes.
It should be noted that: in the load adjustment apparatus provided in the above embodiment, when adjusting the load of the execution node, only the division of the function modules is illustrated, and in practical applications, the function distribution may be completed by different function modules according to needs, that is, the internal structure of the server is divided into different function modules to complete all or part of the functions described above. In addition, the load adjusting device and the load adjusting method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
Fig. 5 is a schematic structural diagram of a server according to an embodiment of the present application, where the server 500 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 501 and one or more memories 502, where the memory 502 stores at least one instruction, and the at least one instruction is loaded and executed by the processors 501 to implement the load adjustment method provided by the foregoing method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
The embodiment of the present application further provides a computer-readable storage medium, where at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is loaded by a processor and has an operation to implement the load adjustment method of the foregoing embodiment.
It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a storage medium, and the storage medium may be a read-only memory, a magnetic disk, an optical disk, or the like.
The above description is only an alternative embodiment of the present application and should not be construed as limiting the present application, and any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (14)

1. A method of performing load regulation of a node, the method comprising:
for a plurality of execution nodes in a cloud service architecture, acquiring operation data of each execution node;
for each execution node, according to the execution data of the execution node and the number of unprocessed service requests, determining the weight of the execution data and the weight of the number of unprocessed service requests from the corresponding relation between the ratio of the stored execution data and the number of unprocessed service requests and the weight of the execution data and the number of unprocessed service requests;
based on the weight of the operation data and the weight of the number of the unprocessed service requests, carrying out weighted summation on the operation data of the execution node and the number of the unprocessed service requests to obtain the load of the execution node;
determining a first execution node with a load larger than a first load threshold value and a second execution node with a load smaller than a second load threshold value from the plurality of execution nodes according to the load of each execution node;
selecting a first target service instance to be migrated from the first execution node;
migrating the first target service instance within the first execution node into the second execution node.
2. The method of claim 1, wherein selecting the first target service instance to be migrated from the first executing node comprises:
determining a first number of unprocessed service requests corresponding to each service instance within the first execution node;
and selecting the first target service instance from the first execution node according to the first quantity of the unprocessed service requests corresponding to each service instance.
3. The method of claim 2, wherein selecting the first target service instance from within the first execution node according to the first number of unprocessed service requests corresponding to each service instance comprises:
and selecting a first target service instance with the minimum first quantity from the first execution node according to the first quantity of the unprocessed service requests corresponding to each service instance.
4. The method of claim 3, wherein selecting the first target service instance from within the first execution node according to the first number of unprocessed service requests corresponding to each service instance comprises:
determining a second number of unprocessed service requests corresponding to each type in the first execution node according to the first number of unprocessed service requests corresponding to each service instance and the type of each service instance;
selecting a target type with the minimum second number from the first execution node according to the second number of the unprocessed service requests corresponding to each type;
a first target service instance of the target type is selected from the first executing node.
5. The method of claim 1, wherein migrating the first target service instance within the first execution node into the second execution node comprises:
creating a second target service instance of the target type in the second execution node according to the target type of the first target service instance; processing the service request by the second target service instance when the service request of the target type is received;
and closing the first target service instance in the first execution node when the first target service instance finishes processing the unprocessed service request.
6. The method of claim 1, wherein the operation data comprises CPU occupancy and memory usage, and wherein determining the load of each execution node according to the operation data of each execution node comprises:
and for each execution node, performing weighted summation on the CPU occupancy rate and the memory utilization rate of the execution node to obtain the load of the execution node.
7. An apparatus for load regulation of an execution node, the apparatus comprising:
the acquisition module is used for acquiring the operation data of each execution node for a plurality of execution nodes in the cloud service architecture;
a determining module, configured to determine, for each execution node, a weight of the running data and a weight of the number of unprocessed service requests from a correspondence between a ratio of the stored running data to the number of unprocessed service requests and a weight of the running data to the number of unprocessed service requests according to the running data of the execution node and the number of unprocessed service requests; based on the weight of the operation data and the weight of the number of the unprocessed service requests, carrying out weighted summation on the operation data of the execution node and the number of the unprocessed service requests to obtain the load of the execution node; determining a first execution node with a load larger than a first load threshold value and a second execution node with a load smaller than a second load threshold value from the plurality of execution nodes according to the load of each execution node;
a selection module, configured to select a first target service instance to be migrated from the first execution node;
a migration module, configured to migrate the first target service instance in the first execution node to the second execution node.
8. The apparatus of claim 7, wherein the selection module is further configured to determine a first number of unprocessed service requests corresponding to each service instance in the first execution node; and selecting the first target service instance from the first execution node according to the first quantity of the unprocessed service requests corresponding to each service instance.
9. The apparatus of claim 8, wherein the selecting module is further configured to select a first target service instance with a smallest first number from the first executing node according to the first number of unprocessed service requests corresponding to each service instance.
10. The apparatus of claim 9, wherein the selection module is further configured to determine a second number of unprocessed service requests corresponding to each type in the first execution node according to the first number of unprocessed service requests corresponding to each service instance and the type of each service instance; selecting a target type with the minimum second number from the first execution node according to the second number of the unprocessed service requests corresponding to each type; a first target service instance of the target type is selected from the first executing node.
11. The apparatus of claim 7, wherein the migration module is further configured to create a second target service instance of the target type within the second execution node according to the target type of the first target service instance; when receiving the service request of the target type, processing the service request through the second target service instance;
and closing the first target service instance in the first execution node when the first target service instance finishes processing the unprocessed service request.
12. The apparatus of claim 7, wherein the operation data includes CPU occupancy and memory usage, and the determining module is further configured to perform weighted summation on the CPU occupancy and memory usage of the execution nodes for each execution node to obtain the load of the execution node.
13. A server, characterized in that the server comprises:
a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to implement operations in the method of load regulation of an execution node of any of claims 1 to 6.
14. A computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor, to perform the operations performed in the method for load regulation of an execution node of any of claims 1 to 6.
CN201911397938.0A 2019-12-30 2019-12-30 Load adjustment method and device of execution node, server and storage medium Active CN111131486B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911397938.0A CN111131486B (en) 2019-12-30 2019-12-30 Load adjustment method and device of execution node, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911397938.0A CN111131486B (en) 2019-12-30 2019-12-30 Load adjustment method and device of execution node, server and storage medium

Publications (2)

Publication Number Publication Date
CN111131486A CN111131486A (en) 2020-05-08
CN111131486B true CN111131486B (en) 2023-04-07

Family

ID=70505423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911397938.0A Active CN111131486B (en) 2019-12-30 2019-12-30 Load adjustment method and device of execution node, server and storage medium

Country Status (1)

Country Link
CN (1) CN111131486B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625334A (en) * 2020-05-21 2020-09-04 慧众行知科技(北京)有限公司 Service migration method and system
CN113407222B (en) * 2021-06-17 2022-11-11 南方电网数字电网研究院有限公司 Service updating method and device, computer equipment and storage medium
CN114003371B (en) * 2021-09-28 2023-03-07 中汽创智科技有限公司 Automatic driving load balancing method and device, electronic equipment and storage medium
CN114826908B (en) * 2022-05-09 2024-03-26 新华智云科技有限公司 kubernetes cluster service guaranteeing method, module and system
CN115277710A (en) * 2022-05-31 2022-11-01 马上消费金融股份有限公司 Resource management method, device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707586A (en) * 2016-08-08 2018-02-16 北京京东尚科信息技术有限公司 Load-balancing method and device
CN109040283A (en) * 2018-08-23 2018-12-18 上海海事大学 A kind of modified load-balancing algorithm based on difference reaction type

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080133738A1 (en) * 2006-12-04 2008-06-05 Robert Knauerhase Provider presence information with load factor
US9690829B2 (en) * 2013-04-15 2017-06-27 Vmware, Inc. Dynamic load balancing during distributed query processing using query operator motion
CN103369042B (en) * 2013-07-10 2016-03-30 中国人民解放军国防科学技术大学 A kind of data processing method and device
WO2015167538A2 (en) * 2014-04-30 2015-11-05 Hewlett-Packard Development Company, L.P. Migrating objects from a source service to a target service
US10432551B1 (en) * 2015-03-23 2019-10-01 Amazon Technologies, Inc. Network request throttling
WO2017143548A1 (en) * 2016-02-25 2017-08-31 华为技术有限公司 Method for automatically deploying application, and cloud management node
US11233873B2 (en) * 2017-05-12 2022-01-25 Oracle International Corporation Dynamic weighting for cloud-based provisioning systems
US10691504B2 (en) * 2017-08-14 2020-06-23 International Business Machines Corporation Container based service management
CN110602156A (en) * 2019-03-11 2019-12-20 平安科技(深圳)有限公司 Load balancing scheduling method and device
CN109831524B (en) * 2019-03-11 2023-04-18 平安科技(深圳)有限公司 Load balancing processing method and device
CN110049130B (en) * 2019-04-22 2020-07-24 北京邮电大学 Service deployment and task scheduling method and device based on edge computing
CN110149378A (en) * 2019-04-30 2019-08-20 冶金自动化研究设计院 A kind of people's air defense data server cluster based on WLC algorithm
CN110134495B (en) * 2019-05-21 2022-08-12 山东大学 Container cross-host online migration method, storage medium and terminal equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707586A (en) * 2016-08-08 2018-02-16 北京京东尚科信息技术有限公司 Load-balancing method and device
CN109040283A (en) * 2018-08-23 2018-12-18 上海海事大学 A kind of modified load-balancing algorithm based on difference reaction type

Also Published As

Publication number Publication date
CN111131486A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111131486B (en) Load adjustment method and device of execution node, server and storage medium
CN109218355B (en) Load balancing engine, client, distributed computing system and load balancing method
US11429449B2 (en) Method for fast scheduling for balanced resource allocation in distributed and collaborative container platform environment
US11010188B1 (en) Simulated data object storage using on-demand computation of data objects
US7702784B2 (en) Distributing and geographically load balancing location aware communication device client-proxy applications
CN110474966B (en) Method for processing cloud platform resource fragments and related equipment
CN111522661A (en) Micro-service management system, deployment method and related equipment
CN111694663A (en) Load balancing method, device and system for server cluster
US20150133214A1 (en) Video encoding based on areas of interest
KR101578177B1 (en) Method and system for migration based on resource utilization rate in cloud computing
CN109960579B (en) Method and device for adjusting service container
CN112817694A (en) Automatic load balancing method and device for distributed system
CN111338750A (en) Pressure adjusting method and device for execution node, server and storage medium
CN114564313A (en) Load adjustment method and device, electronic equipment and storage medium
Yi et al. Job allocation mechanism for battery consumption minimization of cyber-physical-social big data processing based on mobile cloud computing
CN112948114B (en) Edge computing method and edge computing platform
CN110928683B (en) Edge computing resource allocation method based on two types of intensive virtual machines
CN114237902A (en) Service deployment method and device, electronic equipment and computer readable medium
CN112181605A (en) Load balancing method and device, electronic equipment and computer readable medium
Rengasamy et al. A novel predictive resource allocation framework for cloud computing
CN113377866A (en) Load balancing method and device for virtualized database proxy service
Zamri et al. Equally Spread Current Execution Load Modelling with Optimize Response Time Brokerage Policy for Cloud Computing
CN113347016B (en) Virtualization network function migration method based on resource occupation and time delay sensitivity
Choudhary et al. Load balancing algorithm using JIQ methodology for virtual machines
CN113791863B (en) Virtual container-based power Internet of things proxy resource scheduling method and related equipment

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
GR01 Patent grant
GR01 Patent grant