CN110196767B - Service resource control method, device, equipment and storage medium - Google Patents

Service resource control method, device, equipment and storage medium Download PDF

Info

Publication number
CN110196767B
CN110196767B CN201810180279.4A CN201810180279A CN110196767B CN 110196767 B CN110196767 B CN 110196767B CN 201810180279 A CN201810180279 A CN 201810180279A CN 110196767 B CN110196767 B CN 110196767B
Authority
CN
China
Prior art keywords
target service
resource
service
node
determining
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
CN201810180279.4A
Other languages
Chinese (zh)
Other versions
CN110196767A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810180279.4A priority Critical patent/CN110196767B/en
Publication of CN110196767A publication Critical patent/CN110196767A/en
Application granted granted Critical
Publication of CN110196767B publication Critical patent/CN110196767B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a service resource control method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring current operation data of each node in the target service, determining the current load state and service state of each node in the target service according to the current operation data of each node, judging whether the target service meets the resource adjustment condition according to the current load state and/or service state of each node, and adjusting the resource amount corresponding to the target service according to the current load state and/or service state of each node if the current load state and/or service state of each node meets the resource adjustment condition. Therefore, not only is the adjustment of the resource quantity realized according to the load state, but also the adjustment of the resource quantity is realized according to the service quality, and the resource utilization rate is improved while the service quality is ensured.

Description

Service resource control method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a service resource control method, apparatus, device, and storage medium.
Background
With the continuous development of cloud technology, the scale of a cloud platform is larger and larger, and services running by the cloud platform are more and more.
At present, in order to solve the problem of low and empty load of a machine in an operation process of a cloud platform and improve the resource utilization rate in the cloud platform, a method for carrying out resource capacity reduction or capacity expansion based on a load state of a service node is generally adopted to carry out resource control on services running in the cloud platform. Specifically, the load state of each service node is monitored, and when the node load of a certain service is detected to be lower or higher, the service is subjected to resource capacity reduction or resource capacity expansion so as to ensure that the resource utilization rate is always at a higher level.
However, in actual use, the applicant finds that the above-mentioned resource adjustment method cannot perform automatic resource expansion under the scenario that the resource expansion is not required by a high load when the quota of the service node is improper.
Disclosure of Invention
The present invention aims to solve at least one of the technical problems in the related art to some extent.
The invention provides a service resource control method, which adjusts the resource quantity of target service according to the load state and/or the service state of a node, thereby realizing not only the resource quantity adjustment according to the load state, but also the resource quantity adjustment according to the service quality, and improving the resource utilization rate while ensuring the service quality.
An embodiment of a first aspect of the present invention provides a service resource control method, including:
acquiring current operation data of each node in a target service;
determining the current load state and service state of each node in the target service according to the current operation data of each node;
judging whether the target service meets a resource adjustment condition according to the current load state and/or service state of each node;
and if so, adjusting the resource quantity corresponding to the target service according to the current load state and/or service state of each node.
As a possible implementation manner of an embodiment of an aspect of the present invention, before the adjusting the amount of resources corresponding to the target service, the method further includes:
acquiring a historical load state of the target service;
the adjusting the resource amount corresponding to the target service includes:
and adjusting the resource quantity corresponding to the target service according to the historical load state of the target service, the current load state of each node and/or the service state.
As a possible implementation manner of an embodiment of an aspect of the present invention, the adjusting the resource amount corresponding to the target service includes:
Determining the current required resource amount of the target service according to the historical load state of the target service, the current load state of each node and/or the service state;
and adjusting the resource quantity corresponding to the target service according to the current required resource quantity of the target service.
As a possible implementation manner of an embodiment of an aspect of the present invention, the determining whether the target service meets a resource adjustment condition includes:
determining the total number of nodes with abnormal load in the target service, wherein the nodes with abnormal load refer to nodes with the difference value between the actual load and the load quota being larger than a first threshold;
judging whether the proportion of the load abnormal nodes in the target service to all the nodes in the target service is larger than a second threshold value or not;
if yes, determining that the target service meets the resource adjustment condition.
As a possible implementation manner of the embodiment of the aspect of the present invention, the determining the amount of resources currently required by the target service includes:
determining the current actual load of each node in the target service, the load quota of each node, the preset resource utilization rate and the number of nodes included in the target service, and determining the current required resource amount of the target service.
As a possible implementation manner of an embodiment of an aspect of the present invention, the determining whether the target service currently meets a resource adjustment condition includes:
determining the total number of nodes with abnormal service states in the target service;
judging whether the proportion of the nodes with abnormal service states to all the nodes in the target service is larger than a third threshold value or not;
if yes, judging whether the current highest access amount of the target service is larger than the historical access amount peak value of the target service;
if yes, determining that the target service meets the resource adjustment condition.
As a possible implementation manner of the embodiment of the aspect of the present invention, the determining the amount of resources currently required by the target service includes:
and determining the current required resource quantity of the target service according to the current highest access quantity of the target service, the historical access quantity peak value and the total resource quota of the target service.
As one possible implementation manner of the embodiment of the aspect of the present invention, the historical highest load value of the node in the target service is greater than a fourth threshold;
before determining the current required resource amount of the target service, the method further comprises:
determining a corresponding first resource utilization rate of the node when the node is at the highest historical load value;
Determining reasonable access quantity corresponding to the target service according to the historical access quantity peak value, the first resource utilization rate and the preset resource utilization rate;
the determining the amount of resources currently required by the target service includes:
and determining the current required resource amount of the target service according to the reasonable access amount, the current highest access amount and the total resource quota of the target service.
As a possible implementation manner of an embodiment of an aspect of the present invention, before the adjusting the amount of resources corresponding to the target service, the method further includes:
determining a target adjustment mode according to the number of the nodes currently included by the target service and the current resource quota of each node;
the adjusting the resource amount corresponding to the target service includes:
and according to the target adjustment mode, adjusting the number of nodes included in the target service and/or the resource quota of each node in the target service.
As a possible implementation manner of an embodiment of an aspect of the present invention, the determining a target adjustment mode includes:
when the current resource quota of each node in the target service is smaller than a fifth threshold, determining that the target adjustment mode is to adjust the resource quota of each node;
Or alternatively, the process may be performed,
when the current resource quota of each node in the target service is greater than or equal to the fifth threshold and smaller than the sixth threshold and the number of the nodes included in the target service is in a preset range, determining that the target adjustment mode is to adjust the resource quota of each node;
or alternatively, the process may be performed,
when the current resource quota of each node in the target service is greater than or equal to the fifth threshold and smaller than the sixth threshold, and the number of nodes included in the target service is not in the preset range, determining that the target adjustment mode is to adjust the number of nodes included in the target service;
or alternatively, the process may be performed,
and when the current resource quota of each node in the target service is greater than the sixth threshold, determining the target adjustment mode to adjust the number of nodes included in the target service.
As a possible implementation manner of an embodiment of an aspect of the present invention, before the adjusting the amount of resources corresponding to the target service, the method further includes:
and determining that the resource quantity corresponding to the target service is unchanged in a preset time interval.
According to the service resource control method, the current operation data of each node in the target service is obtained, the current load state and the service state of each node in the target service are determined according to the current operation data of each node, whether the target service meets the resource adjustment condition is judged according to the current load state and/or the service state of each node, and when the target service meets the resource condition, the resource quantity corresponding to the target service is adjusted according to the current load state and/or the service state of each node. Therefore, not only is the adjustment of the resource quantity realized according to the load state, but also the adjustment of the resource quantity is realized according to the service quality, and the resource utilization rate is improved while the service quality is ensured.
Another embodiment of the present invention provides a service resource control device, including:
the acquisition module is used for acquiring current operation data of each node in the target service;
the first determining module is used for determining the current load state and service state of each node in the target service according to the current operation data of each node;
the judging module is used for judging whether the target service meets the resource adjustment condition according to the current load state and/or service state of each node;
and the adjusting module is used for adjusting the resource quantity corresponding to the target service according to the current load state and/or service state of each node when the target service meets the resource adjusting condition.
As a possible implementation manner of the embodiment of another aspect of the present invention, the obtaining module is further configured to:
before the resource quantity corresponding to the target service is adjusted, acquiring a historical load state of the target service;
and the adjusting module is also used for adjusting the resource quantity corresponding to the target service according to the historical load state of the target service, the current load state of each node and/or the service state.
As a possible implementation manner of another embodiment of the present invention, the adjusting module includes:
a determining unit, configured to determine a current required resource amount of the target service according to a historical load state of the target service, a current load state of each node, and/or a service state;
and the adjusting unit is used for adjusting the resource quantity corresponding to the target service according to the current required resource quantity of the target service.
As a possible implementation manner of the embodiment of another aspect of the present invention, the judging module is further configured to:
determining the total number of nodes with abnormal load in the target service, wherein the nodes with abnormal load refer to nodes with the difference value between the actual load and the load quota being larger than a first threshold;
judging whether the proportion of the load abnormal nodes in the target service to all the nodes in the target service is larger than a second threshold value or not;
if yes, determining that the target service meets the resource adjustment condition.
As a possible implementation manner of the embodiment of another aspect of the present invention, the determining unit is further configured to:
determining the current actual load of each node in the target service, the load quota of each node, the preset resource utilization rate and the number of nodes included in the target service, and determining the current required resource amount of the target service.
As a possible implementation manner of the embodiment of another aspect of the present invention, the judging module is further configured to:
determining the total number of nodes with abnormal service states in the target service;
judging whether the proportion of the nodes with abnormal service states to all the nodes in the target service is larger than a third threshold value or not;
if yes, judging whether the current highest access amount of the target service is larger than the historical access amount peak value of the target service;
if yes, determining that the target service meets the resource adjustment condition.
As a possible implementation manner of the embodiment of another aspect of the present invention, the determining unit is further configured to:
and determining the current required resource quantity of the target service according to the current highest access quantity of the target service, the historical access quantity peak value and the total resource quota of the target service.
As another possible implementation manner of the embodiment of the present invention, the historical highest load value of the node in the target service is greater than a fourth threshold, and the apparatus further includes:
the second determining module is used for determining the corresponding first resource utilization rate of the node when the node is at the highest historical load value;
the calculation module is used for determining reasonable access quantity corresponding to the target service according to the historical access quantity peak value, the first resource utilization rate and the preset resource utilization rate;
And the determining unit is further used for determining the current required resource amount of the target service according to the reasonable access amount, the current highest access amount and the total resource quota of the target service.
As a possible implementation manner of the embodiment of another aspect of the present invention, the apparatus further includes:
the third determining module is used for determining a target adjustment mode according to the number of the nodes currently included by the target service and the current resource quota of each node;
and the adjusting module is also used for adjusting the number of nodes included in the target service and/or the resource quota of each node in the target service according to the target adjusting mode.
As a possible implementation manner of the embodiment of another aspect of the present invention, the third determining module is further configured to:
when the current resource quota of each node in the target service is smaller than a fifth threshold, determining that the target adjustment mode is to adjust the resource quota of each node;
or alternatively, the process may be performed,
when the current resource quota of each node in the target service is greater than or equal to the fifth threshold and smaller than the sixth threshold and the number of the nodes included in the target service is in a preset range, determining that the target adjustment mode is to adjust the resource quota of each node;
Or alternatively, the process may be performed,
when the current resource quota of each node in the target service is greater than or equal to the fifth threshold and smaller than the sixth threshold, and the number of nodes included in the target service is not in the preset range, determining that the target adjustment mode is to adjust the number of nodes included in the target service;
or alternatively, the process may be performed,
and when the current resource quota of each node in the target service is greater than the sixth threshold, determining the target adjustment mode to adjust the number of nodes included in the target service.
As a possible implementation manner of the embodiment of another aspect of the present invention, the apparatus further includes:
and the fourth determining module is used for determining that the resource quantity corresponding to the target service is not changed in a preset time interval before the resource quantity corresponding to the target service is adjusted.
According to the service resource control device provided by the embodiment of the invention, the current operation data of each node in the target service is obtained, the current load state and the service state of each node in the target service are determined according to the current operation data of each node, whether the target service meets the resource adjustment condition is judged according to the current load state and/or the service state of each node, and when the resource adjustment condition is met, the resource quantity corresponding to the target service is adjusted according to the current load state and/or the service state of each node. Therefore, not only is the adjustment of the resource quantity realized according to the load state, but also the adjustment of the resource quantity is realized according to the service quality, and the resource utilization rate is improved while the service quality is ensured.
Another embodiment of the present invention provides a service resource control device, including: the system comprises a memory and a processor, wherein the processor executes a program corresponding to executable program codes stored in the memory by reading the executable program codes, so as to realize the service resource control method according to the embodiment.
Another aspect of the present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a service resource control method as described in the above embodiments.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
fig. 1 is a flow chart of a first service resource control method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an application scenario provided in an embodiment of the present invention;
fig. 3 is a schematic diagram of a process for obtaining a current load status of a node according to an embodiment of the present invention;
Fig. 4 is a schematic diagram of a process for obtaining a current service state of a node according to an embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating a process of historical load status of a target service according to an embodiment of the present invention;
fig. 6 is a flow chart of a second service resource control method according to an embodiment of the present invention;
fig. 7 is a flowchart of a third service resource control method according to an embodiment of the present invention;
fig. 8 is a flowchart of a fourth service resource control method according to an embodiment of the present invention;
fig. 9 is a flowchart of a fifth service resource control method according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a service resource control device according to an embodiment of the present invention;
fig. 11 is a block diagram of an exemplary service resource control device suitable for use in implementing embodiments of the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative and intended to explain the present invention and should not be construed as limiting the invention.
The service resource control method, apparatus, device and storage medium of the embodiments of the present invention are described below with reference to the accompanying drawings.
The embodiments of the present application mainly aim at the current method for performing capacity reduction or capacity expansion on service resources based on the load state of a service node, and in the actual use process, when the quota of the service node is improper, when a user configures the quota for the service node, for example, when the CPU quota or the memory quota is improper, the problem that automatic resource expansion cannot be performed in a non-high load resource expansion requirement scene is provided.
For example, the quota of each node is smaller, if it is determined that the service does not need to be expanded according to the load state, but at this time, in the service running process, the response time of the service is longer due to the lower quota of the node, so that the service quality is seriously affected, and at this time, the service quality can be improved by adding resources of the service. That is, when the user allocation quota is improper, the method of adjusting the service resource according to the load state cannot cope with the situation that the non-load state needs to be expanded.
In view of the above problem, the embodiments of the present invention provide a service resource control method, which adjusts the resource amount of a target service according to the load state and/or the service state of a node, so as to not only implement resource amount adjustment according to the load state, but also implement resource amount adjustment according to the service quality, thereby improving the resource utilization rate while ensuring the service quality.
Fig. 1 is a flowchart of a first service resource control method according to an embodiment of the present invention. Fig. 2 is a schematic diagram of an application scenario provided in an embodiment of the present invention. In fig. 2, at least one node is respectively arranged on the server 1, the server 2, the server … … and the server N, and the server can upload load states of the nodes, such as consumption conditions of a CPU, a memory and the like, and service states, such as time consumption, time-out and the like of service interaction, to the decision device in real time. The decision device can adjust the resource quantity corresponding to the target service according to the load state or the service state of the node, and sends an adjustment command to the corresponding server for execution.
It should be noted that, the determiner in this embodiment may be understood as a server for executing the service resource control method provided in the embodiment of the present invention.
As shown in fig. 1, the service resource control method includes:
step 101, current operation data of each node in the target service is obtained.
In this embodiment, the arbiter may obtain current operation data of each node in the target service, such as the number of currently operated services, the access amount, the response time of each access, the waiting time, the CPU usage rate, the memory consumption, and so on, from the server.
Step 102, determining the current load state and/or service state of each node in the target service according to the current operation data of each node.
Taking the application scenario shown in fig. 2 as an example, as shown in fig. 3, a node manager may be disposed on each server. The node manager can collect load information such as real-time CPU and memory consumption of each node on the server through the cgroup and send the load information to the judging device, so that the judging device can determine the current load state of each node in the target service according to the received load information. Where cgroup is an abbreviation of control groups, and is a Linux kernel function that performs packet management on arbitrary processes.
In this embodiment, the current service state of each node may be determined in the manner shown in fig. 4. As shown in fig. 4, an application framework layer is added between the main call service and the called service, so that the application framework layer collects the operation data such as the access quantity, the response time and the waiting time of each access, which are mutually called by the service, and sends the operation data to the decision device. The determiner can determine the service states of time consuming and overtime of service call of each node according to the received current operation data of each node, such as response time and waiting time of each access.
Step 103, judging whether the target service meets the resource adjustment condition according to the current load state and/or service state of each node.
In this embodiment, whether the target service meets the resource adjustment condition may be determined according to the current load state or service state of each node, or whether the target service meets the resource adjustment condition may be determined according to the current load state and service state of each node.
The method for determining whether the target service meets the resource adjustment condition according to the current load state or service state of each node will be described in detail in the following embodiments, which are further described herein.
And 104, if the current load state and/or service state of each node are met, adjusting the resource quantity corresponding to the target service.
When the resource condition is met, the judging device can adjust the resource quantity corresponding to the target service according to the current load state or service state of each node. In this embodiment, the adjustable resource amount includes, but is not limited to, a CPU quota, a memory quota, a number of nodes, and the like of each node.
The decision device can adjust the resource quantity of the target service according to the obtained current load state or service state of each node, and can also adjust the resource quantity of the target service according to the current load state and service state of each node.
In this embodiment, the quota of each node corresponding to the same service is the same, that is, the CPU quota and the memory quota of each node are consistent, and after the resource amount is adjusted, the quota of each node is still the same.
The service resource control method in the embodiment of the invention can also take the service state as the basis for adjusting the resource quantity, for example, when the service is adjusted overtime, the resource quantity of the node can be adjusted, thereby solving the problem that the non-load state can not be processed according to the adjustment method of the load state alone in the related technology. Therefore, the resource control method provided by the embodiment of the invention can greatly improve the utilization rate of resources.
On the basis of the above embodiment, in order to further improve the utilization rate of the resources, before adjusting the amount of resources corresponding to the target service, the historical load state of the target service may be obtained, and the historical load state is used as a basis for adjusting the amount of resources corresponding to the target service. That is, the amount of resources corresponding to the target service is adjusted according to the historical load status, the current load status of each node, and/or the service status. The specific process can be seen in the following examples.
In this embodiment, the historical load state of the target service may be obtained according to the manner shown in fig. 5. As shown in fig. 5, the load status of the node collected by the node manager, such as CPU utilization, memory consumption, etc., is sent to the load status record database. The load state analyzer can analyze and process the load state of each service for a preset time length to obtain a load highest value, a load peak-to-average value, a load average value and the like of the service for the preset time length, and then store the analysis result into the load state analysis result database.
Taking a preset time length as an example of one day, the load state analyzer can analyze and process the load states of all the services daily to obtain a daily load maximum value, a load peak average value, a load average value and the like of the services.
It should be noted that the load state analysis result database may be located in the decision device, or may be disposed in another device, where the decision device may obtain a historical load state from the load state analysis result database. It will be appreciated that the load state analyzer and the load state analyzer may be located in the determiner or may be located in other devices, which is not limited in this embodiment.
In order to more clearly explain the above embodiments, a service resource control method according to an embodiment of the present invention is described below with reference to fig. 6. Fig. 6 is a flowchart of a second service resource control method according to an embodiment of the present invention.
As shown in fig. 6, the service resource control method includes:
step 201, current operation data of each node in the target service is obtained.
Step 202, determining the current load state and service state of each node in the target service according to the current operation data of each node.
Step 203, obtain the historical load status of the target service.
In this embodiment, the method for obtaining the current operation data of each node in the target service, determining the load status and the service status according to the operation data, and the method for obtaining the historical load status of the target service may refer to the relevant content in the foregoing embodiment, which is not described herein.
Step 204, judging whether the target service meets the resource adjustment condition according to the historical load state of the target service, the current load state of each node and/or the service state.
After the current load state and service state of each node in the target service and the historical load state of the target service are obtained, whether the target service meets the resource adjustment condition can be judged. In this embodiment, the judgment may be performed according to any one or more of a historical load state, a current load state of each node, and a service state.
As one possible implementation, it may be determined whether the target service meets the resource adjustment condition according to a historical load state of the target service, such as a CPU usage peak. Specifically, whether the CPU utilization peak value in the first preset time period is smaller than a first preset value or not is judged, and whether the CPU utilization peak value in the second preset time period is smaller than a second preset value or not is judged, wherein the second preset time period comprises the first preset time period.
The first preset duration, the first preset value, the second preset duration, the second preset value and the like can be adjusted according to actual needs.
For example, it is determined whether the CPU usage peak value is less than or equal to 30% on the previous day, and the CPU usage peak value is less than or equal to 45% in the last week. If so, the amount of resources required by the target service can be considered to be small, and the resources can be scaled, namely, the target service is determined to meet the resource adjustment condition.
As another possible implementation manner, it may also be determined whether the target service meets the resource adjustment condition according to the historical consumption memory peak value of the target service. The specific method is similar to the method for judging whether the target service meets the resource adjustment condition according to the historical CPU usage peak value of the target service, and is not described herein.
In this embodiment, a method for determining whether the target service meets the resource adjustment condition according to the current load state or service state of each node is described in detail in the following embodiments, which are further described herein.
Step 205, if yes, determining the current required resource amount of the target service according to the historical load state of the target service, the current load state of each node, and/or the service state.
In this embodiment, when it is determined that the target service meets the resource condition, the current required resource amount of the target service may be determined according to the historical load state, the current load state or service state of each node, and the like.
As a possible implementation manner, when it is determined that the amount of resources corresponding to the target service needs to be adjusted according to the historical CPU usage peak value, the required total CPU quota may be calculated according to the CPU usage peak-to-average value within the second preset duration. Specifically, the method is shown in a formula (1).
The peak-to-average value of the CPU utilization rate in the second preset time period is equal to the average value of the CPU utilization rate peaks in all the first preset time periods in the second preset time period.
For example, the first preset time period is a peak value of CPU usage in one day, and then the peak-to-average value of CPU usage in the last week is equal to the average value of CPU usage peaks in seven days.
As another possible implementation, when it is determined that the amount of resources corresponding to the target service needs to be adjusted according to the peak value of the historical consumption memory, the total memory required for the current service may be determined in a similar manner to the formula (1).
And step 206, adjusting the resource quantity corresponding to the target service according to the current required resource quantity of the target service.
In this embodiment, after determining the current required resource amount of the target service, the resource amount corresponding to the target service, such as the CPU, the quota of the memory, and the like, may be adjusted according to the determined required resource amount.
For example, if it is determined that the total CPU quota currently required for the target service is 20 virtual units (Equal Compute unit, abbreviated as ECU) with CPU computing power (which may define 2000MHz CPU as 10ECU computing power), the current CPU quota of each node is 1ECU, and the total number of nodes is 10, the CPU quota of the node may be adjusted, and after adjustment, the CPU of each node is 2ECU.
Compared with the prior art that the resource quantity is adjusted by independently depending on the load state, the service resource control method not only realizes the resource quantity adjustment according to the load state, but also realizes the resource quantity adjustment of a scene requiring capacity expansion without high load, and the resource quantity can be adjusted according to the historical load state, so that the service resource control can be close to the actual requirement of the service, and the utilization rate of the resource is greatly improved.
On the basis of the above-described embodiment, how to judge whether or not the target service satisfies the resource adjustment condition according to the load abnormality, and the corresponding adjustment method are explained below in conjunction with fig. 7. Fig. 7 is a flowchart of a third service resource control method according to an embodiment of the present invention.
As shown in fig. 7, the service resource control method includes:
step 301, current operation data of each node in the target service is obtained.
Step 302, determining the current load state and service state of each node in the target service according to the current operation data of each node.
Step 303, obtain the historical load status of the target service.
In this embodiment, the method for determining the current load status and service status of each node in the target service and obtaining the historical load status of the target service may refer to the relevant content in the foregoing embodiment, which is not described herein again.
Step 304, determining the total number of nodes with abnormal load in the target service, wherein the nodes with abnormal load refer to nodes with a difference value between the actual load and the load quota being greater than a first threshold.
In this embodiment, according to the obtained load status of each node in the target service, the number of nodes whose difference between the actual load and the load quota of the node in the target service is greater than the first threshold may be counted. The actual load may be the CPU utilization or the consumed memory.
Specifically, the number of nodes with abnormal initial state load can be set to be zero, and whether the difference between the current actual load of the ith node and the load quota of the ith node in the target service is larger than a first threshold value is judged, wherein i is a positive integer smaller than or equal to N, and N is the total number of nodes in the target service. And if the total number of the nodes with abnormal loads in the target server is greater than the first threshold value, adding 1 to the total number of all the nodes with abnormal loads in the target server.
Step 305, determining whether the proportion of the load abnormal node in the target service to all nodes in the target service is greater than a second threshold.
After the total number of the nodes with abnormal loads in the target service is determined, the total number of the nodes with abnormal loads is compared with the total number of all the nodes in the target service, and the proportion of the nodes with abnormal loads is obtained. And then comparing the proportion with a second threshold value to judge whether the proportion occupied by the nodes with abnormal load is larger than the second threshold value.
And 306, if yes, determining that the target service meets the resource adjustment condition.
In this embodiment, when the proportion of the nodes with abnormal loads in the target service to all the nodes is greater than the second threshold, the target service may be considered to satisfy the resource adjustment condition.
Taking the CPU as an example, setting the second threshold to be 0.4, when the proportion of the node with abnormal CPU usage rate in all nodes of the target service exceeds 0.4, that is, when the node load exceeding 40% is abnormal, it can be considered that the resource amount of the target service needs to be adjusted, and it is determined that the target service meets the resource adjustment condition.
Step 307, determining the current actual load of each node in the target service, the load quota of each node, the preset resource utilization rate and the number of nodes included in the target service, and determining the current required resource amount of the target service.
Taking a CPU as an example, when the resource amount corresponding to the target service needs to be adjusted according to the CPU abnormality determination, the current required CPU total quota of the target service can be determined according to the current CPU actual load, CPU load quota, normal CPU utilization rate and the number of nodes included in the target service. In this embodiment, the total CPU quota currently required by the target service may be calculated according to the actual load of the node with the highest current load in the target service. As shown in equation (2).
Taking the memory as an example, when the resource amount corresponding to the target service needs to be adjusted according to the memory anomaly determination, the total memory quota currently required by the target service can be determined according to the actual load of the current memory of each node in the target service, the memory quota, the normal memory usage rate and the number of nodes included in the target service. In this embodiment, the total memory quota currently required by the target service may be calculated according to the actual load of the node with the highest current load in the target service. As shown in equation (3).
In this embodiment, the amount of resources currently required for the target service may be calculated according to the above formulas (2) and (3).
Step 308, adjusting the resource amount corresponding to the target service according to the current required resource amount of the target service.
In this embodiment, the load quota, such as the CPU quota and the memory quota, of each node in the target service may be adjusted, and the total number of nodes in the target service may also be adjusted.
According to the service resource control method provided by the embodiment of the invention, the total number of the nodes with abnormal loads in the target service and the proportion of the nodes with abnormal loads in all the nodes in the target service are counted, whether the target service meets the preset condition is determined by whether the preset threshold value is met, and compared with the method for independently adjusting the resource quantity by depending on the node load, the abnormal load condition of the nodes can be processed, and the utilization rate of the resources is improved.
How to determine that the target service satisfies the resource adjustment condition according to the service state abnormality and how to determine the required resource amount are explained below with reference to fig. 8. Fig. 8 is a flowchart of a fourth service resource control method according to an embodiment of the present invention.
As shown in fig. 8, the service resource control method includes:
step 401, current operation data of each node in the target service is obtained.
Step 402, determining the current load state and service state of each node in the target service according to the current operation data of each node.
Step 403, obtaining a historical load status of the target service.
In this embodiment, the determining device determines the current load status and service status of each node in the target service, and the method for obtaining the historical load status of the target service, which can be referred to the related content in the above embodiment, and will not be described herein.
Step 404, determining a total number of nodes with abnormal service states in the target service.
In this embodiment, the total number of nodes with abnormal service states of the nodes in the target service may be counted according to the acquired service states of the nodes in the target service. The service state exception may be that the target service is invoked for a time period or times out for more than a preset time period.
Specifically, the number of nodes with abnormal service states in the initial state can be set to be zero, and whether the service state of the ith node in the target service is abnormal or not is judged, wherein i is a positive integer less than or equal to N, and N is the total number of nodes in the target service. If the service state is abnormal, adding 1 to the number of nodes with abnormal service state in the target service until the total number of all the nodes with abnormal service state in the target server is determined.
Step 405, determining whether the proportion of the nodes with abnormal service states to all nodes in the target service is greater than a third threshold.
After the total number of the nodes with abnormal service states in the target service is determined, the total number of the nodes with abnormal service states is compared with the total number of all the nodes in the target service, and the proportion of the nodes with abnormal service states is obtained. And then comparing the proportion with a third threshold value to judge whether the proportion occupied by the nodes with abnormal service states is larger than the third threshold value.
And step 406, if yes, judging whether the current highest access amount of the target service is larger than the historical access amount peak value of the target service.
In this embodiment, the determiner may determine a historical access amount peak of the target service according to the obtained historical load state.
And after determining that the proportion of the nodes with abnormal service states to all nodes in the target service is greater than a third threshold, judging whether the current highest access quantity of the target service is greater than the historical access quantity peak value of the target service.
And step 407, if yes, determining that the target service meets the resource adjustment condition.
When the proportion of the nodes with abnormal service states to all the nodes in the target service is greater than a third threshold value and the current highest access amount of the target service is greater than the historical access amount peak value of the target service, the target service can be determined to meet the resource adjustment condition.
For example, assuming that the third threshold is 0.5, when 50% or more of the node service states in the target service are abnormal and the current highest access amount of the target service is greater than the historical access amount peak of the target service, it may be determined that the target service satisfies the resource adjustment condition.
Step 408, determining the current required resource amount of the target service according to the current highest access amount of the target service, the historical access amount peak value and the total resource quota of the target service.
In this embodiment, the amount of resources currently required by the target service may be calculated according to the node with the highest current access amount in the target service, as shown in formula (4).
The total resource quota of the target service may include a CPU total quota, a memory total quota, and the like, where the total resource quota of the target service is equal to the product of the number of nodes in the target service and the resource quota of a single node.
It can be appreciated that, by using the total memory quota of the target service, the total memory quota currently required by the target service can be calculated according to the above formula (4). Likewise, with the total CPU quota of the target service, the total CPU quota currently required by the target service can be calculated according to equation (4).
Further, it may also be determined whether the historical highest load value of the node in the target service is greater than a fourth threshold. And when the access quantity is larger than the fourth threshold value, determining the current required resource quantity of the target service according to the reasonable access quantity, the current highest access quantity and the total resource quota of the target service.
Specifically, according to the obtained historical load state, the historical highest load value of the node is determined. Then, when the node is at the highest load value of the history, the corresponding first resource usage rate, such as CPU usage rate, is determined. And then, according to the historical access peak value, the first resource utilization rate and the preset resource utilization rate, determining the reasonable access quantity corresponding to the target service, wherein the reasonable access quantity is shown in a formula (5).
The preset resource utilization rate may be a reasonable resource utilization rate, for example, a reasonable CPU utilization rate may be set to 50%.
After the reasonable access amount is determined, determining the current required resource amount of the target service according to the reasonable access amount, the current highest access amount and the total resource quota of the target service. As shown in equation (6).
For example, the fourth threshold is 70%, and when the historical highest load value of the node in the target service is greater than 70%, the current required resource amount of the target service is determined according to the above formula (5) and formula (6).
In this embodiment, when the historical highest load value of the node in the target service is greater than the fourth threshold, the current required resource amount of the target service can be determined according to the reasonable access amount, so that the resource adjustment is finer.
Step 409, adjusting the amount of resources corresponding to the target service according to the amount of resources currently required by the target service.
After determining the current required resource amount of the target service, the resource amount corresponding to the target service can be adjusted according to the current required resource amount and the current resource amount of the target service.
As an example, when the proportion of the nodes with abnormal service states to the nodes of the target service exceeds the third threshold and the current access amount is greater than the historical access peak, the service quality can be ensured by increasing the number of nodes in the target service. When the resource amount corresponding to the target service is adjusted, the resource amount to be increased can be determined according to the current required resource amount and the current resource amount of the target service. Then, dividing the needed increased resource quantity by the resource quota of each node in the target service to obtain the needed increased node quantity. Further, the nodes with the same resource quota and corresponding number are added in the target service.
According to the service resource control method provided by the embodiment of the invention, whether the target service meets the resource adjustment condition or not is judged according to the service state and the access quantity of the node in the target service, and the resource adjustment is carried out when the target service meets the adjustment condition.
On the basis of the above embodiment, in order to facilitate adjustment of the amount of resources corresponding to the target service and improve the adjustment efficiency, the target adjustment mode may be determined before the amount of resources corresponding to the target service is adjusted. The target adjustment mode comprises adjustment of resource quota of each node, adjustment of the number of nodes and the like. Fig. 9 is a flowchart of a fifth service resource control method according to an embodiment of the present invention.
As shown in fig. 9, the service resource control method includes:
step 501, current operation data of each node in the target service is obtained.
Step 502, determining the current load state and service state of each node in the target service according to the current operation data of each node.
Step 503, according to the current load status and/or service status of each node, it is determined whether the target service satisfies the resource adjustment condition.
In this embodiment, steps 501-503 are similar to steps 101-103 in the above embodiment, and thus are not described herein.
Step 504, if yes, determining a target adjustment mode according to the number of nodes currently included in the target service and the current resource quota of each node.
In this embodiment, whether to adjust the number of nodes, adjust the resource quota of each node, or adjust both the number of nodes and the resource quota of each node may be determined according to the number of nodes currently included in the target service and the current resource quota of each node.
As one example, when the current resource quota of each node in the target service is less than the fifth threshold, the target adjustment mode may be determined to adjust the resource quota of each node, for example, adjust the CPU quota, the memory quota, and the like of each node.
As another example, when the current resource quota of each node in the target service is greater than or equal to the fifth threshold and less than the sixth threshold, and the number of nodes included in the target service is within the preset range, the target adjustment mode may be determined to adjust the resource quota of each node.
As yet another example, when the current resource quota of each node in the target service is greater than or equal to the fifth threshold and less than the sixth threshold, and the number of nodes included in the target service is not within the preset range, the target adjustment mode may be determined to adjust the number of nodes included in the target service, that is, adjust the number of nodes in the target service.
As yet another example, when the current resource quota for each node in the target service is greater than the sixth threshold, the target adjustment mode may be determined to adjust the number of nodes included in the target service.
The above method for determining the target adjustment mode will be described with reference to table 1, taking the CPU as an example, wherein the fifth threshold is set to 10, the sixth threshold is set to 40, and the preset range is less than or equal to the minimum number of nodes, or greater than or equal to 20.
TABLE 1
As can be seen from table 1, when the CPU quota of each node in the target service is smaller than 10ECU (implicitly, greater than or equal to 1 ECU), the adjustment mode can be determined to increase the CPU quota of each node in the target service.
When the CPU quota of each node in the target service is greater than or equal to 10ECU and less than 40ECU, and the number of nodes in the target service is less than or equal to the minimum number of nodes, or greater than or equal to 20, it may be determined that the adjustment mode is to increase the CPU quota of each node in the target service.
When the CPU quota of each node in the target service is greater than or equal to 10ECU and less than 40ECU, and the number of nodes in the target service is greater than the minimum number of nodes and less than 20, the adjustment mode may be determined to increase the number of nodes in the target service.
When the CPU quota of each node in the target service is greater than 40ECU, it may be determined that the adjustment mode is to increase the number of nodes in the target service.
Step 505, according to the target adjustment mode, adjusting the number of nodes included in the target service and/or the resource quota of each node in the target service.
After the target adjustment mode is determined, the number of nodes included in the target service or the resource quota of each node in the target service can be adjusted according to the target adjustment mode, or the number of nodes and the resource quota of each node in the target service can be adjusted. For a specific method for determining the number of nodes required for the target service, the resource quota of each node, etc., reference may be made to the related content in the foregoing embodiment, which is not described herein.
According to the service resource control method, the adjustment mode is determined before the resource quantity of the target service is adjusted, and the resource quantity of the target service is adjusted according to the adjustment mode, so that the resource adjustment is more accurate and efficient.
When the target service resource quantity is adjusted according to the load abnormality and the service state abnormality, the target service resource quantity can be adjusted according to the method if the conditions are met. However, adjusting the amount of resources according to one approach followed by another approach may result in repeated increases in resources.
For example, the amount of resources of the target service is currently adjusted according to the CPU, then the amount of resources of the target service is determined to be adjusted according to the memory, and if the amount of resources of the target service is further determined to be the amount of resources of the target service according to the memory, the resources may be repeatedly increased, so that the resources are wasted, and the utilization rate of the resources is reduced.
In order to avoid the above situation, the present embodiment proposes that before adjusting the amount of resources corresponding to the target service, it is determined whether the amount of resources corresponding to the target service has changed within a preset time interval. If the resource amount is unchanged, the resource amount corresponding to the target service can be adjusted. Otherwise, the resource amount corresponding to the target service is not adjusted. After waiting for the preset time, continuing to judge whether the resource quantity corresponding to the target is changed or not, and adjusting the resource quantity corresponding to the target service until the resource quantity corresponding to the target service is determined not to be changed.
In this embodiment, before the adjustment of the amount of resources corresponding to the target service, when it is determined that the amount of resources corresponding to the target service is unchanged in a preset time interval, the amount of resources corresponding to the target service is adjusted, so that the continuous adjustment of resources can be avoided, the resources are repeatedly increased, the waste of resources is caused, and the utilization rate of the resources is further improved.
In order to implement the above embodiment, the embodiment of the present invention further provides a service resource control device. Fig. 10 is a schematic structural diagram of a service resource control device according to an embodiment of the present invention.
As shown in fig. 10, the service resource control apparatus includes: the device comprises an acquisition module 610, a first determination module 620, a judgment module 630 and an adjustment module 640.
The obtaining module 610 is configured to obtain current operation data of each node in the target service.
The first determining module 620 is configured to determine a current load status and a current service status of each node in the target service according to the current operation data of each node.
The judging module 630 is configured to judge whether the target service meets the resource adjustment condition according to the current load status and/or service status of each node.
The adjustment module 640 is configured to adjust, when the target service meets the resource adjustment condition, the amount of resources corresponding to the target service according to the current load status and/or service status of each node.
In one possible implementation manner of this embodiment, the obtaining module 610 is further configured to:
before adjusting the resource quantity corresponding to the target service, acquiring a historical load state of the target service;
the adjustment module 640 is further configured to adjust the amount of resources corresponding to the target service according to the historical load status of the target service, the current load status of each node, and/or the service status.
In one possible implementation manner of this embodiment, the adjusting module 640 includes:
the determining unit is used for determining the current required resource amount of the target service according to the historical load state of the target service, the current load state of each node and/or the service state;
and the adjusting unit is used for adjusting the resource quantity corresponding to the target service according to the current required resource quantity of the target service.
In one possible implementation manner of this embodiment, the judging module 630 is further configured to:
determining the total number of nodes with abnormal load in the target service, wherein the nodes with abnormal load refer to nodes with the difference value between the actual load and the load quota being larger than a first threshold;
judging whether the proportion of the load abnormal nodes in the target service to all the nodes in the target service is larger than a second threshold value or not;
If yes, determining that the target service meets the resource adjustment condition.
In a possible implementation manner of this embodiment, the determining unit is further configured to:
determining the current actual load of each node in the target service, the load quota of each node, the preset resource utilization rate and the number of nodes included in the target service, and determining the current required resource amount of the target service.
In one possible implementation manner of this embodiment, the judging module 630 is further configured to:
determining the total number of nodes with abnormal service states in the target service;
judging whether the proportion of the nodes with abnormal service states to all the nodes in the target service is larger than a third threshold value or not;
if yes, judging whether the current highest access amount of the target service is larger than the historical access amount peak value of the target service;
if yes, determining that the target service meets the resource adjustment condition.
In a possible implementation manner of this embodiment, the determining unit is further configured to:
and determining the current required resource quantity of the target service according to the current highest access quantity of the target service, the historical access quantity peak value and the total resource quota of the target service.
In a possible implementation manner of this embodiment, the historical highest load value of the node in the target service is greater than the fourth threshold, and the apparatus further includes:
The second determining module is used for determining the corresponding first resource utilization rate when the node is at the highest historical load value;
the computing module is used for determining reasonable access quantity corresponding to the target service according to the historical access quantity peak value, the first resource utilization rate and the preset resource utilization rate;
the determining unit is further configured to determine, according to the reasonable access amount, the current highest access amount, and the total resource quota of the target service, a current required resource amount of the target service.
In a possible implementation manner of this embodiment, the apparatus further includes:
the third determining module is used for determining a target adjustment mode according to the number of nodes currently included in the target service and the current resource quota of each node before adjusting the resource amount corresponding to the target service;
the adjustment module 640 is further configured to adjust, according to the target adjustment mode, the number of nodes included in the target service and/or a resource quota of each node in the target service.
In a possible implementation manner of this embodiment, the third determining module is further configured to:
when the current resource quota of each node in the target service is smaller than a fifth threshold value, determining that the target adjustment mode is to adjust the resource quota of each node;
Or alternatively, the process may be performed,
when the current resource quota of each node in the target service is greater than or equal to a fifth threshold and smaller than a sixth threshold, and the number of nodes included in the target service is in a preset range, determining that the target adjustment mode is to adjust the resource quota of each node;
or alternatively, the process may be performed,
when the current resource quota of each node in the target service is larger than or equal to a fifth threshold value and smaller than a sixth threshold value, and the number of nodes included in the target service is not in a preset range, determining that the target adjustment mode is to adjust the number of nodes included in the target service;
or alternatively, the process may be performed,
and when the current resource quota of each node in the target service is greater than a sixth threshold, determining that the target adjustment mode is to adjust the number of nodes included in the target service.
Further, in a possible implementation manner of the embodiment of the present invention, the apparatus may further include:
and the fourth determining module is used for determining that the resource quantity corresponding to the target service is not changed in a preset time interval before the resource quantity corresponding to the target service is adjusted.
It should be noted that the foregoing explanation of the embodiment of the service resource control method is also applicable to the service resource control device of this embodiment, and will not be repeated here.
According to the service resource control device provided by the embodiment of the invention, the current running data of each node in the target service is obtained, the current load state and the service state of each node in the target service are determined according to the current running data of each node, whether the target service meets the resource adjustment condition is judged according to the current load state and/or the service state of each node, and when the target service meets the resource adjustment condition, the resource quantity corresponding to the target service is adjusted according to the current load state and/or the service state of each node. Therefore, not only is the adjustment of the resource quantity realized according to the load state, but also the adjustment of the resource quantity is realized according to the service quality, and the resource utilization rate is improved while the service quality is ensured.
In order to achieve the above embodiment, the present invention further proposes a service resource control device, including: the system comprises a memory and a processor, wherein the processor executes a program corresponding to executable program code by reading the executable program code stored in the memory, for realizing the service resource control method as described in the above embodiments.
Fig. 11 illustrates a block diagram of an exemplary service resource control device suitable for use in implementing embodiments of the present invention. The service resource control device 12 shown in fig. 11 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present application.
As shown in fig. 11, the service resource control device 12 is in the form of a general purpose computing device. The components of the service resource control device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include industry Standard architecture (Industry Standard Architecture; hereinafter ISA) bus, micro channel architecture (Micro Channel Architecture; hereinafter MAC) bus, enhanced ISA bus, video electronics standards Association (Video Electronics Standards Association; hereinafter VESA) local bus, and peripheral component interconnect (Peripheral Component Interconnection; hereinafter PCI) bus.
The service resource control device 12 typically includes a variety of computer system readable media. Such media can be any available media that can be accessed by the service resource control device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (Random Access Memory; hereinafter: RAM) 30 and/or cache memory 32. The service resource control device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 11, commonly referred to as a "hard disk drive"). Although not shown in fig. 11, a magnetic disk drive for reading from and writing to a removable nonvolatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable nonvolatile optical disk (e.g., a compact disk read only memory (Compact Disc Read Only Memory; hereinafter CD-ROM), digital versatile read only optical disk (Digital Video Disc Read Only Memory; hereinafter DVD-ROM), or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the present application.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods in the embodiments described herein.
The service resource control device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the service resource control device 12, and/or with any device (e.g., network card, modem, etc.) that enables the service resource control device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the service resource control device 12 may communicate with one or more networks, such as a local area network (Local Area Network; hereinafter: LAN), a wide area network (Wide Area Network; hereinafter: WAN) and/or a public network, such as the Internet, via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the service resource control device 12 via the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with the service resource control device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing the methods mentioned in the foregoing embodiments.
In order to implement the above-described embodiments, the embodiments of the present invention also provide a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the service resource control method as described in the above-described embodiments.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order from that shown or discussed, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present invention.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.

Claims (11)

1. A method for controlling service resources, comprising:
acquiring current operation data of each node in a target service;
determining the current load state and service state of each node in the target service according to the current operation data of each node;
judging whether the target service meets a resource adjustment condition according to the current load state and/or service state of each node;
if so, adjusting the resource quantity corresponding to the target service according to the current load state and/or service state of each node;
the adjusting the resource amount corresponding to the target service includes:
determining the current required resource amount of the target service according to the historical load state of the target service, the current load state of each node and/or the service state;
Adjusting the resource quantity corresponding to the target service according to the current required resource quantity of the target service;
the determining the amount of resources currently required by the target service includes:
determining the current required resource amount of the target service according to the current highest access amount of the target service, the historical access amount peak value and the total resource quota of the target service;
the historical highest load value of the node in the target service is larger than a fourth threshold value; before determining the current required resource amount of the target service, the method further comprises:
determining a corresponding first resource utilization rate of the node when the node is at the highest historical load value;
determining reasonable access quantity corresponding to the target service according to the historical access quantity peak value, the first resource utilization rate and the preset resource utilization rate;
the determining the amount of resources currently required by the target service includes:
and determining the current required resource amount of the target service according to the reasonable access amount, the current highest access amount and the total resource quota of the target service.
2. The method of claim 1, wherein prior to adjusting the amount of resources corresponding to the target service, further comprising:
Acquiring a historical load state of the target service;
the adjusting the resource amount corresponding to the target service includes:
and adjusting the resource quantity corresponding to the target service according to the historical load state of the target service, the current load state of each node and/or the service state.
3. The method of claim 1, wherein the determining whether the target service satisfies a resource adjustment condition comprises:
determining the total number of nodes with abnormal load in the target service, wherein the nodes with abnormal load refer to nodes with the difference value between the actual load and the load quota being larger than a first threshold;
judging whether the proportion of the load abnormal nodes in the target service to all the nodes in the target service is larger than a second threshold value or not;
if yes, determining that the target service meets the resource adjustment condition.
4. The method of claim 3, wherein the determining the amount of resources currently required by the target service comprises:
determining the current actual load of each node in the target service, the load quota of each node, the preset resource utilization rate and the number of nodes included in the target service, and determining the current required resource amount of the target service.
5. The method of claim 1, wherein the determining whether the target service currently satisfies a resource adjustment condition comprises:
determining the total number of nodes with abnormal service states in the target service;
judging whether the proportion of the nodes with abnormal service states to all the nodes in the target service is larger than a third threshold value or not;
if yes, judging whether the current highest access amount of the target service is larger than the historical access amount peak value of the target service;
if yes, determining that the target service meets the resource adjustment condition.
6. The method of any of claims 1-5, wherein before the adjusting the amount of resources corresponding to the target service, further comprises:
determining a target adjustment mode according to the number of the nodes currently included by the target service and the current resource quota of each node;
the adjusting the resource amount corresponding to the target service includes:
and according to the target adjustment mode, adjusting the number of nodes included in the target service and/or the resource quota of each node in the target service.
7. The method of claim 6, wherein the determining the target adjustment mode comprises:
When the current resource quota of each node in the target service is smaller than a fifth threshold, determining that the target adjustment mode is to adjust the resource quota of each node;
or alternatively, the process may be performed,
when the current resource quota of each node in the target service is greater than or equal to the fifth threshold and smaller than the sixth threshold and the number of the nodes included in the target service is in a preset range, determining that the target adjustment mode is to adjust the resource quota of each node;
or alternatively, the process may be performed,
when the current resource quota of each node in the target service is greater than or equal to the fifth threshold and smaller than the sixth threshold, and the number of nodes included in the target service is not in the preset range, determining that the target adjustment mode is to adjust the number of nodes included in the target service;
or alternatively, the process may be performed,
and when the current resource quota of each node in the target service is greater than the sixth threshold, determining the target adjustment mode to adjust the number of nodes included in the target service.
8. The method of any of claims 1-5, wherein before the adjusting the amount of resources corresponding to the target service, further comprises:
and determining that the resource quantity corresponding to the target service is unchanged in a preset time interval.
9. A service resource control apparatus, comprising:
the acquisition module is used for acquiring current operation data of each node in the target service;
the first determining module is used for determining the current load state and service state of each node in the target service according to the current operation data of each node;
the judging module is used for judging whether the target service meets the resource adjustment condition according to the current load state and/or service state of each node;
the adjusting module is used for adjusting the resource quantity corresponding to the target service according to the current load state and/or service state of each node when the target service meets the resource adjusting condition;
the adjustment module includes:
a determining unit, configured to determine a current required resource amount of the target service according to a historical load state of the target service, a current load state of each node, and/or a service state;
the adjusting unit is used for adjusting the resource quantity corresponding to the target service according to the current required resource quantity of the target service;
the determining unit is further configured to determine, according to the current highest access amount of the target service, the historical access amount peak value, and the total resource quota of the target service, a current required resource amount of the target service;
The historical highest load value of the node in the target service is greater than a fourth threshold, and the service resource control device further comprises:
the second determining module is used for determining the corresponding first resource utilization rate of the node when the node is at the highest historical load value;
a calculation module, configured to determine a reasonable access amount 'corresponding to the target service according to the historical access amount peak value, the first resource usage rate and a preset resource usage rate'
The determining unit is further configured to determine a reasonable access amount corresponding to the target service according to the historical access amount peak value, the first resource usage rate and a preset resource usage rate;
and the third determining module is used for determining the current required resource amount of the target service according to the reasonable access amount, the current highest access amount and the total resource quota of the target service.
10. A service resource control device, comprising: a memory and a processor, wherein the processor runs a program corresponding to executable program code stored in the memory by reading the executable program code for implementing the service resource control method according to any one of claims 1 to 8.
11. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the service resource control method according to any of claims 1-8.
CN201810180279.4A 2018-03-05 2018-03-05 Service resource control method, device, equipment and storage medium Active CN110196767B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810180279.4A CN110196767B (en) 2018-03-05 2018-03-05 Service resource control method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810180279.4A CN110196767B (en) 2018-03-05 2018-03-05 Service resource control method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110196767A CN110196767A (en) 2019-09-03
CN110196767B true CN110196767B (en) 2023-07-25

Family

ID=67750970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810180279.4A Active CN110196767B (en) 2018-03-05 2018-03-05 Service resource control method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110196767B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602236B (en) * 2019-09-20 2021-12-14 腾讯科技(深圳)有限公司 Node control method, node control device, and storage medium
CN111046091B (en) * 2019-10-24 2023-12-08 杭州数梦工场科技有限公司 Operation method, device and equipment of data exchange system
CN110933178B (en) * 2019-12-09 2022-02-01 聚好看科技股份有限公司 Method for adjusting node configuration in cluster system and server
CN110888715B (en) * 2019-12-12 2021-02-02 深圳齐杉科技有限公司 Virtualization computing method
CN111243720B (en) * 2020-01-20 2023-03-24 重庆亚德科技股份有限公司 Clinical path management system with medical staff quantity adjustment reminding function
CN111625365A (en) * 2020-05-29 2020-09-04 中国工商银行股份有限公司 Method and device for regulating and controlling job execution, electronic equipment and storage medium
CN111767137B (en) * 2020-06-03 2023-09-01 北京奇艺世纪科技有限公司 System deployment method and device, electronic equipment and storage medium
CN112162827A (en) * 2020-10-20 2021-01-01 腾讯科技(深圳)有限公司 Cloud platform container descending and matching method, device and system and storage medium
CN113946376A (en) * 2021-10-29 2022-01-18 挂号网(杭州)科技有限公司 Load adjustment method and device, electronic equipment and storage medium
CN114548928A (en) * 2022-02-22 2022-05-27 中国工商银行股份有限公司 Application auditing method, device, equipment and medium
CN116048791B (en) * 2022-12-30 2024-01-30 长春吉大正元信息技术股份有限公司 Regulation and control method and device of test node, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102130938A (en) * 2010-12-03 2011-07-20 中国科学院软件研究所 Resource supply method oriented to Web application host platform
CN105808343A (en) * 2014-12-31 2016-07-27 中国科学院沈阳自动化研究所 Cluster resource control method used for complicated production management system
CN106484540A (en) * 2016-10-20 2017-03-08 腾讯科技(深圳)有限公司 A kind of resource allocation method and device
CN106933650A (en) * 2017-03-03 2017-07-07 北方工业大学 load management method and system of cloud application system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104580524A (en) * 2015-01-30 2015-04-29 华为技术有限公司 Resource scaling method and cloud platform with same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102130938A (en) * 2010-12-03 2011-07-20 中国科学院软件研究所 Resource supply method oriented to Web application host platform
CN105808343A (en) * 2014-12-31 2016-07-27 中国科学院沈阳自动化研究所 Cluster resource control method used for complicated production management system
CN106484540A (en) * 2016-10-20 2017-03-08 腾讯科技(深圳)有限公司 A kind of resource allocation method and device
CN106933650A (en) * 2017-03-03 2017-07-07 北方工业大学 load management method and system of cloud application system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Auto-tuning Performance of MPI Parallel Programs Using Resource Management in Container-based Virtual Cloud;Hongyi Ma等;《2016 IEEE 9th International Conference on Cloud Computing》;第545-552页 *
基于Docker swarm集群的动态加权调度策略;黄凯;孟庆永;谢雨来;冯丹;秦磊华;;计算机应用(05);全文 *

Also Published As

Publication number Publication date
CN110196767A (en) 2019-09-03

Similar Documents

Publication Publication Date Title
CN110196767B (en) Service resource control method, device, equipment and storage medium
US20100031259A1 (en) Estimating power consumption of a virtual server
US10884468B2 (en) Power allocation among computing devices
CN111506423A (en) Resource scheduling method and device, electronic equipment and storage medium
CN114490078A (en) Dynamic capacity reduction and expansion method, device and equipment for micro-service
US20230229216A1 (en) System and methods for server power management
CN110297743B (en) Load testing method and device and storage medium
CN113688001A (en) Dynamic balancing method and device for server hard disk power consumption, terminal and storage medium
CN114637603A (en) Resource control method and device, computer equipment and storage medium
CN112367384A (en) Kafka cluster-based dynamic speed limiting method and device and computer equipment
CN108415765B (en) Task scheduling method and device and intelligent terminal
CN113079062B (en) Resource adjusting method and device, computer equipment and storage medium
CN112073327B (en) Anti-congestion software distribution method, device and storage medium
KR101608859B1 (en) Cloud based intelligent power control system
CN111813535A (en) Resource configuration determining method and device and electronic equipment
CN113326170A (en) Task delay risk detection method, electronic device and storage medium
CN116382855B (en) Virtual machine migration method, electronic equipment and computer storage medium
CN110347546B (en) Dynamic adjustment method, device, medium and electronic equipment for monitoring task
US20080195447A1 (en) System and method for capacity sizing for computer systems
CN113971068A (en) Resource adjusting method, device, equipment and storage medium
CN108804152B (en) Method and device for adjusting configuration parameters
CN110794949A (en) Power consumption reduction method and system for automatically allocating computing resources based on component temperature
CN112437015A (en) Shunting scheduling method, device, system and computer readable storage medium
CN111913852B (en) Health management method and device for storage system
CN115756135A (en) Processor management method and computing device

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