CN114461394A - Method, device, equipment and storage medium for controlling expansion and contraction of CPU (Central processing Unit) resources - Google Patents

Method, device, equipment and storage medium for controlling expansion and contraction of CPU (Central processing Unit) resources Download PDF

Info

Publication number
CN114461394A
CN114461394A CN202210109151.5A CN202210109151A CN114461394A CN 114461394 A CN114461394 A CN 114461394A CN 202210109151 A CN202210109151 A CN 202210109151A CN 114461394 A CN114461394 A CN 114461394A
Authority
CN
China
Prior art keywords
cpu
resource
container
recommended value
target container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210109151.5A
Other languages
Chinese (zh)
Inventor
李龙峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210109151.5A priority Critical patent/CN114461394A/en
Publication of CN114461394A publication Critical patent/CN114461394A/en
Pending legal-status Critical Current

Links

Images

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/5044Allocation 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 hardware capabilities

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method, a device and equipment for controlling CPU resource expansion and contraction and a computer readable storage medium, wherein the method comprises the following steps: acquiring a CPU resource expansion instruction of a target container in a K8s cluster; calculating a recommended value of the CPU memory resource corresponding to the target container by utilizing a CPU throughput algorithm according to the CPU resource expansion instruction; adjusting CPU memory resources corresponding to the target container in the container group according to the recommended value; according to the CPU resource expansion instruction, the recommended value of the CPU memory resource corresponding to the target container is calculated by utilizing the CPU throughput algorithm, and the operation of expanding and contracting the CPU resource of the container group can be carried out based on the CPU throughput algorithm, so that the required CPU resource can be expanded in the CPU resource required by application; when the CPU resource consumed by the service application is reduced, the occupied redundant CPU resource is released, and the relative stability and the application reliability of the CPU resource used by the deployment application in the K8s cluster are improved.

Description

Method, device, equipment and storage medium for controlling expansion and contraction of CPU (Central processing Unit) resources
Technical Field
The invention relates to the field of cloud computing, in particular to a method, a device and equipment for controlling CPU resource expansion and contraction and a computer readable storage medium.
Background
In the container technology age, a large number of business application scenarios are technically clouded by Kubernetes (K8s) containers, where the CPU resources consumed by the clouded applications are constantly changing. Under the premise that Kubernetes cluster node resources are sufficient, CPU resources consumed by service applications are changed, some service applications do not need to expand or reduce the consumed CPU resources in time, and meanwhile, the relative stability of the CPU resources consumed by the service applications needs to be guaranteed. There is a need for a solution that not only ensures the stability of CPU resource consumption by the service application, but also has the ability to change the CPU resource consumption by the service application when the CPU resource consumption changes continuously.
Therefore, how to scale the CPU resources with continuously changing consumption while ensuring the stability of the CPU resources used by the deployed applications in the K8s cluster is an urgent problem to be solved today.
Disclosure of Invention
The invention aims to provide a method, a device and equipment for controlling the expansion and contraction of CPU resources and a computer readable storage medium, so that the operation of expanding and contracting the CPU resources of a container group is carried out based on a CPU throughput algorithm, and the relative stability of the CPU resources used for deploying applications in a K8s cluster and the reliability of the applications are improved.
In order to solve the above technical problem, the present invention provides a CPU resource scaling control method, including:
acquiring a CPU resource expansion instruction of a target container in a K8s cluster;
calculating a recommended value of the CPU memory resource corresponding to the target container by utilizing a CPU throughput algorithm according to the CPU resource expansion instruction;
and adjusting the CPU memory resource corresponding to the target container in the container group according to the recommended value.
Optionally, the obtaining a CPU resource scaling instruction of a target container in the K8s cluster includes:
acquiring the CPU resource expansion instruction according to the expansion parameter information of the K8s cluster; and the flexible parameter information comprises the flexible starting and stopping condition of the CPU corresponding to each container and the starting and stopping condition of the CPU throughput algorithm.
Optionally, the obtaining the CPU resource scaling instruction according to the scaling parameter information of the K8s cluster includes:
and determining the container with the CPU stretching start-stop condition as an opening state and the CPU throughput algorithm start-stop condition as an opening state as the target container, and generating the CPU resource stretching instruction.
Optionally, the scaling parameter information further includes a resource threshold corresponding to each container.
Optionally, before adjusting the CPU memory resource corresponding to the target container in the container group according to the recommended value, the method further includes:
judging whether the automatic telescopic starting and stopping condition in the telescopic parameter information of the K8s cluster is an opening state;
if yes, executing a step of adjusting the CPU memory resource corresponding to the target container in the container group according to the recommended value;
and if not, storing the recommended value.
Optionally, the calculating, according to the CPU resource scaling instruction, a recommended value of a CPU memory resource corresponding to the target container by using a CPU throughput algorithm includes:
calculating the recommended value by using a CPU throughput algorithm according to the CPU resource expansion instruction and the CPU throughput algorithm parameter information; the CPU throughput algorithm parameter information comprises a safety threshold range and CPU throughput calculation time, and the recommended value is in the safety threshold range.
Optionally, the CPU throughput algorithm parameter information further includes a condition of sample data cleaning configuration.
The invention also provides a CPU resource expansion control device, which comprises:
the instruction acquisition module is used for acquiring a CPU resource expansion instruction of a target container in the K8s cluster;
the recommended value calculation module is used for calculating the recommended value of the CPU memory resource corresponding to the target container by utilizing a CPU throughput algorithm according to the CPU resource expansion instruction;
and the adjusting module is used for adjusting the CPU memory resources corresponding to the target container in the container group according to the recommended value.
The invention also provides a CPU resource expansion control device, which comprises:
a memory for storing a computer program;
and a processor, configured to implement the steps of the CPU resource scaling control method when executing the computer program.
Furthermore, the present invention also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when being executed by a processor, the computer program realizes the steps of the CPU resource scaling control method.
The invention provides a CPU resource expansion control method, which comprises the following steps: acquiring a CPU resource expansion instruction of a target container in a K8s cluster; calculating a recommended value of the CPU memory resource corresponding to the target container by utilizing a CPU throughput algorithm according to the CPU resource expansion instruction; adjusting the CPU memory resource corresponding to the target container in the container group according to the recommended value;
therefore, the recommended value of the CPU memory resource corresponding to the target container is calculated by utilizing the CPU throughput algorithm according to the CPU resource expansion instruction, the operation of expanding the CPU resource of the container group can be carried out based on the CPU throughput algorithm, and the required CPU resource can be expanded in the CPU resource required by application; when the CPU resource consumed by the service application is reduced, the occupied redundant CPU resource is released for other loads to use, and the relative stability of the CPU resource used by the deployed application in the K8s cluster and the reliability of the application are improved. In addition, the invention also provides a CPU resource expansion control device, equipment and a computer readable storage medium, and the CPU resource expansion control device, the equipment and the computer readable storage medium also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a CPU resource scaling control method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of another CPU resource scaling control method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another CPU resource scaling control method according to an embodiment of the present invention;
fig. 4 is a block diagram of a CPU resource scaling control apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a CPU resource scaling control device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a CPU resource scaling control device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a CPU resource scaling control method according to an embodiment of the present invention. The method can comprise the following steps:
step 101: and acquiring a CPU resource scaling instruction of a target container in the K8s cluster.
The K8s (kubernets) may be an open source platform for automated deployment, capacity expansion, and operation and maintenance of container clusters; the container group may be a bearer for the user traffic to run in the K8s cluster, i.e., the service may be provided in a manner of running the container group; the containers can be the constituent units of the container group, a plurality of containers can be operated in one container group, and the number of the containers can be understood as the number of the operation services; the application can be an embodiment form of deploying service in a K8s cluster, and mainly can be in a working load form of stateless load, stateful load, task, timing task and the like; the node of the K8s cluster may be a running unit of the K8s cluster resource, and may be a server or a virtual machine on which the container group runs.
It can be understood that the target container in this step may be any container in the K8s cluster that needs to use a CPU throughput algorithm to perform the recommended value calculation of CPU resource scaling (i.e., CPU memory resource scaling); the CPU resource scaling instruction in this step may be an instruction for controlling calculation of a recommended value of CPU resource scaling corresponding to the target container using a CPU throughput algorithm.
Specifically, for the specific manner in which the processor in this embodiment obtains the CPU resource scaling instruction of the target container in the K8s cluster, the specific manner may be set by a designer according to a practical scenario and a user requirement, for example, the processor may directly receive the CPU resource scaling instruction of the target container, and for example, the processor in the node of the K8s cluster may directly receive the CPU resource scaling instruction sent by the user configuration. The processor can also generate a CPU resource scaling instruction of the target container, for example, the processor can obtain the CPU resource scaling instruction according to scaling parameter information configured by the user; the flexible parameter information includes the CPU flexible start-stop condition and the CPU throughput algorithm start-stop condition corresponding to each container, which is not limited in this embodiment.
Correspondingly, the CPU expansion start-stop condition may be whether to start CPU expansion (i.e., CPU memory resource expansion), that is, the CPU expansion start-stop condition is to start the CPU expansion when the CPU expansion start-stop condition is in an open state, and the CPU expansion stop-stop condition is to close the CPU expansion when the CPU expansion start-stop condition is in a closed state; the start-stop condition of the CPU throughput algorithm may be whether the CPU throughput algorithm is started or not, that is, the CPU throughput algorithm is started when the start-stop condition of the CPU throughput algorithm is in an on state. That is, the processor may determine, as the target container, the container whose CPU scaling start-stop condition is the open state and whose CPU throughput algorithm start-stop condition is the open state, and generate the CPU resource scaling instruction.
It should be noted that, the method provided in this embodiment may further include a process of acquiring telescopic parameter information, as shown in fig. 2, the processor may acquire the telescopic parameter information through the telescopic device, that is, a user may set the telescopic parameter information by deploying the telescopic device; as shown in fig. 3, a user may configure scaling parameter information through deployment of a scaling device in a management platform (CMP), so that a processor in a K8s cluster may complete recommended value calculation (recommender) and update (updater) of CPU memory resource scaling by using a VPA (Vertical Pod application Vertical scaling tool).
Specifically, the specific content of the telescopic parameter information in this embodiment may be set by a designer according to a use scenario and a user requirement, for example, the telescopic parameter information may include a CPU telescopic start-stop condition and a CPU throughput algorithm start-stop condition corresponding to each container in the container group; the processor may only include the CPU scaling start-stop condition in the CPU scaling start-stop condition and the CPU throughput algorithm start-stop condition, that is, the processor may default to start the CPU throughput algorithm to calculate the recommended value of the CPU scaling when the CPU scaling start-stop condition is in the on state. The expansion parameter information may further include an automatic expansion start-stop condition corresponding to the container group, that is, a condition whether to start automatic expansion of the CPU memory resource, for example, when the automatic expansion start-stop condition is an open state, the CPU memory resource can be started to automatically expand and contract, so that after a recommended value of the CPU memory resource corresponding to the target container is obtained through calculation, the CPU memory resource corresponding to the target container is automatically adjusted by using the recommended value; when the automatic expansion starting and stopping condition is a closing state, the automatic expansion of the CPU memory resource can be closed, so that after the recommended value of the CPU memory resource corresponding to the target container is obtained through calculation, the recommended value can be stored so that a user can check the recommended value of the expansion of the CPU memory resource. The scaling parameter information may also include other resource scaling start-stop conditions, such as the memory resource scaling start-stop condition indicating whether to start memory scaling in fig. 2, so that when the other resource scaling start-stop condition is an open state, a corresponding built-in algorithm is started to calculate the scaling recommended values of the other resources. The telescopic parameter information can also be a resource threshold value, so that the telescopic range of automatic telescopic is in the range of the set resource threshold value, and the safety and reliability of automatic telescopic are ensured.
Step 102: and calculating the recommended value of the CPU memory resource corresponding to the target container by utilizing a CPU throughput algorithm according to the CPU resource expansion instruction.
It can be understood that, in this embodiment, the processor may, under the condition that the CPU scalability is started and the CPU throughput algorithm is enabled, calculate the recommended value of the CPU memory resource corresponding to the target container by using the CPU throughput algorithm, to calculate the recommended value of the CPU memory resource that needs to be scaled and corresponds to the target container by using the CPU throughput algorithm, so that the scalability of the CPU memory resource is associated with the CPU throughput, thereby making the CPU resource consumption need to be kept relatively stable, and also making the application of scaling when the CPU resource consumption continuously changes, when the CPU resource consumption continuously increases, the service may automatically expand the CPU resource; when the CPU resource consumed by the application is continuously reduced, the service can retract the CPU memory resource; the characteristics that the CPU resources used by the deployed application in the K8s cluster are relatively stable and the application is reliable are improved.
Specifically, the processor in this step may calculate the recommended value by using a CPU throughput algorithm according to the CPU resource scaling instruction and the CPU throughput algorithm parameter information; the CPU throughput algorithm parameter information comprises a safety threshold range and CPU throughput calculation time, and the recommended value is in the safety threshold range. That is, the processor may use the CPU throughput algorithm parameter information to start the CPU throughput algorithm to calculate the recommended value of the CPU memory resource corresponding to the target container according to the CPU resource scaling instruction.
Correspondingly, the method provided by this embodiment may further include a process of obtaining CPU throughput algorithm parameter information, as shown in fig. 2, the processor may obtain the CPU throughput algorithm parameter information through the CPU throughput algorithm parameter setting device, that is, the user may set the CPU throughput algorithm parameter information by deploying the CPU throughput algorithm parameter setting device; as shown in fig. 3, a user may configure CPU throughput algorithm parameter information through the deployment of CPU throughput algorithm parameter setting means in a management platform (CMP).
It should be noted that, for the specific content of the CPU throughput algorithm parameter information in this embodiment, the specific content may be set by a designer according to a use scenario and a user requirement, for example, the CPU throughput algorithm parameter information may include a CPU throughput calculation time, that is, a time length for calculating the CPU throughput, that is, a detection time width of the CPU throughput algorithm parameter information, and for example, a default value may be 15 minutes; the CPU throughput algorithm parameter information may further include a safety threshold range, such as a range between an upper limit and a lower limit of the safety threshold in fig. 2, to ensure the safety of the recommended value calculated by the algorithm; the CPU throughput algorithm parameter information can also comprise a condition of clearing configuration of the offset sample data, namely whether the offset sample data is cleared or not, and if the condition of clearing configuration of the offset sample data is in an open state, the data which is greatly deviated from an average value sample within the detection time width can be cleaned, so that the consumed resources are not changed greatly; correspondingly, the CPU throughput algorithm parameter information may further include a deviation amplitude value for the deviation sample data cleaning, for example, the default deviation amplitude value may be 0.1.
Specifically, as shown in fig. 2, in this embodiment, the processor may start the CPU throughput algorithm parameter information transmitted by the CPU throughput algorithm parameter setting device to calculate the recommended value of the CPU memory resource corresponding to the target container by using the CPU throughput algorithm parameter information when the CPU is started to scale and the CPU throughput algorithm is started according to the scaling parameter information read from the scaling device.
Correspondingly, in this embodiment, the processor may further calculate, by using an existing built-in algorithm (e.g., a CPU spike sensitive built-in algorithm), a recommended value of a CPU memory resource corresponding to the corresponding container when the CPU scaling is started and the CPU throughput algorithm is not enabled. That is to say, the method provided by this embodiment may further include the processor obtaining a conventional CPU resource scaling instruction of a conventional target container in the K8s cluster; calculating a conventional recommended value of the CPU memory resource corresponding to the conventional target container by utilizing a CPU spike sensitive built-in algorithm according to the conventional CPU resource expansion instruction; and adjusting the CPU memory resources corresponding to the conventional target container in the container group according to the conventional recommended value.
Step 103: and adjusting the CPU memory resources corresponding to the target container in the container group according to the recommended value.
Specifically, in this step, the processor may apply the calculated recommended value to the CPU memory resource of the container group to adjust the CPU memory resource corresponding to the target container in the container group, that is, adjust the CPU memory resource corresponding to the target container to the recommended value. That is to say, in this step, the processor may automatically adjust the CPU memory resource corresponding to the target container in the container group by using the recommended value corresponding to the target container obtained through calculation when the automatic scaling is started.
Correspondingly, the method may further include a process of determining whether to start the automatic stretching, for example, determining whether the automatic stretching start-stop condition in the stretching parameter information of the K8s cluster is an open state; if yes, entering the step; if not, the recommended value is stored for the follow-up user to inquire. That is to say, when the automatic stretching start-stop condition corresponding to the container group in the stretching parameter information is an open state, and the CPU stretching start-stop condition corresponding to a certain container in the container group and the CPU throughput algorithm are both open states, the processor may use the container as a target container, calculate the recommended value of the CPU memory resource corresponding to the target container by using the CPU throughput algorithm, and automatically adjust the CPU memory resource corresponding to the target container in the container group according to the recommended value; correspondingly, when the automatic stretching start-stop condition corresponding to the container group in the stretching parameter information is an open state, the CPU stretching start-stop condition corresponding to a certain container in the container group is an open state, and the CPU throughput algorithm is a closed state, the processor may use the container as a conventional target container, calculate a conventional recommended value of the CPU memory resource corresponding to the conventional target container by using a conventional built-in algorithm (e.g., a CPU spike sensitive built-in algorithm), and automatically adjust the CPU memory resource corresponding to the target container in the container group according to the conventional recommended value.
It should be understood that, this embodiment is exemplified by the scaling control of the CPU memory resource of one container (i.e., a target container) in the K8s cluster by the processor, and the scaling control of the CPU memory resource of other containers in the K8s cluster may be implemented in the same or similar manner as the method provided in this embodiment, which is not limited in this embodiment.
In the embodiment, the recommended value of the CPU memory resource corresponding to the target container is calculated by utilizing the CPU throughput algorithm according to the CPU resource expansion instruction, and the operation of expanding the CPU resource of the container group can be carried out based on the CPU throughput algorithm, so that the required CPU resource can be expanded in the CPU resource required by application; when the CPU resource consumed by the service application is reduced, the occupied redundant CPU resource is released for other loads to use, and the relative stability of the CPU resource used by the deployed application in the K8s cluster and the reliability of the application are improved.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a CPU resource scaling control device, and a CPU resource scaling control device described below and a CPU resource scaling control method described above may be referred to in correspondence.
Referring to fig. 4, fig. 4 is a block diagram illustrating a CPU resource scaling control apparatus according to an embodiment of the present invention. The CPU resource scaling control apparatus may include:
the instruction acquisition module 10 is configured to acquire a CPU resource expansion instruction of a target container in the K8s cluster;
a recommended value calculation module 20, configured to calculate, according to the CPU resource scaling instruction, a recommended value of a CPU memory resource corresponding to the target container by using a CPU throughput algorithm;
and an adjusting module 30, configured to adjust, according to the recommended value, a CPU memory resource corresponding to the target container in the container group.
Optionally, the instruction obtaining module 10 may be specifically configured to obtain a CPU resource expansion instruction according to expansion parameter information of a K8s cluster; the flexible parameter information comprises the flexible starting and stopping condition of the CPU corresponding to each container and the starting and stopping condition of the CPU throughput algorithm.
Optionally, the instruction obtaining module 10 may include:
and the instruction generation submodule is used for determining the container with the CPU stretching start-stop condition being the start state and the CPU throughput algorithm start-stop condition being the start state as a target container and generating a CPU resource stretching instruction.
Optionally, the scaling parameter information further includes a resource threshold corresponding to each container.
Optionally, the apparatus may further include:
the judging module is used for judging whether the automatic telescopic starting and stopping condition in the telescopic parameter information of the K8s cluster is in an opening state; if the state is the on state, a starting signal is sent to the adjusting module 30;
and the storage module is used for storing the recommended value if the state is not the opening state.
Optionally, the recommended value calculating module 20 may be specifically configured to calculate the recommended value by using a CPU throughput algorithm according to the CPU resource scaling instruction and the CPU throughput algorithm parameter information; the CPU throughput algorithm parameter information comprises a safety threshold range and CPU throughput calculation time, and the recommended value is in the safety threshold range.
Optionally, the CPU throughput algorithm parameter information further includes a bias sample data cleaning configuration condition.
In this embodiment, according to the CPU resource expansion instruction, the recommendation value calculation module 20 calculates the recommendation value of the CPU memory resource corresponding to the target container by using the CPU throughput algorithm, and can perform the operation of expanding and contracting the CPU resource of the container group based on the CPU throughput algorithm, thereby expanding the requested CPU resource in the CPU resource required by the application; when the CPU resource consumed by the service application is reduced, the occupied redundant CPU resource is released for other loads to use, and the relative stability of the CPU resource used by the deployed application in the K8s cluster and the reliability of the application are improved.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a CPU resource scaling control device, and a CPU resource scaling control device described below and a CPU resource scaling control method described above may be referred to in correspondence.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a CPU resource scaling control device according to an embodiment of the present invention. The CPU resource scaling control apparatus may include:
a memory D1 for storing computer programs;
and the processor D2 is configured to, when executing the computer program, implement the steps of the CPU resource scaling control method provided in the foregoing method embodiment.
Specifically, referring to fig. 6, fig. 6 is a schematic diagram illustrating a specific structure of a CPU resource scaling control device according to an embodiment of the present invention, which may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 322 (e.g., one or more processors) and a memory 332, and one or more storage media 330 (e.g., one or more mass storage devices) storing an application 342 or data 344. Memory 332 and storage media 330 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 330 may include one or more modules (not shown), each of which may include a sequence of instructions operating on the device. Still further, the central processor 322 may be configured to communicate with the storage medium 330 to execute a series of instruction operations in the storage medium 330 on the CPU resource scaling control device 310.
The CPU resource scaling control device 310 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input-output interfaces 358, and/or one or more operating systems 341. Such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
The CPU resource scaling control device 310 may be specifically a node in the K8s cluster.
The steps in the CPU resource scaling control method described above may be implemented by the structure of a CPU resource scaling control device.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a readable storage medium, and a readable storage medium described below and a CPU resource scaling control method described above may be referred to in correspondence.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the CPU resource scaling control method of the above-described method embodiments.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various other readable storage media capable of storing program codes.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The detailed description of the method, the apparatus, the device and the computer readable storage medium for controlling CPU resource scaling provided by the present invention is provided above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. A CPU resource scaling control method is characterized by comprising the following steps:
acquiring a CPU resource expansion instruction of a target container in a K8s cluster;
calculating a recommended value of the CPU memory resource corresponding to the target container by utilizing a CPU throughput algorithm according to the CPU resource expansion instruction;
and adjusting the CPU memory resource corresponding to the target container in the container group according to the recommended value.
2. The method according to claim 1, wherein the obtaining the CPU resource scaling instruction of the target container in the K8s cluster comprises:
acquiring the CPU resource expansion instruction according to the expansion parameter information of the K8s cluster; and the flexible parameter information comprises the flexible starting and stopping condition of the CPU corresponding to each container and the starting and stopping condition of the CPU throughput algorithm.
3. The method for controlling CPU resource scaling according to claim 2, wherein the obtaining the CPU resource scaling instruction according to the scaling parameter information of the K8s cluster includes:
and determining the container with the CPU stretching start-stop condition as an opening state and the CPU throughput algorithm start-stop condition as an opening state as the target container, and generating the CPU resource stretching instruction.
4. The method according to claim 2, wherein the scaling parameter information further includes a resource threshold corresponding to each container.
5. The method for controlling scaling of CPU resources according to claim 1, wherein before adjusting the CPU memory resources corresponding to the target container in the container group according to the recommended value, the method further comprises:
judging whether the automatic stretching start-stop condition in the stretching parameter information of the K8s cluster is an opening state;
if yes, executing a step of adjusting the CPU memory resource corresponding to the target container in the container group according to the recommended value;
and if not, storing the recommended value.
6. The method for controlling CPU resource scaling according to any one of claims 1 to 5, wherein the calculating, according to the CPU resource scaling instruction, the recommended value of the CPU memory resource corresponding to the target container by using a CPU throughput algorithm includes:
calculating the recommended value by using a CPU throughput algorithm according to the CPU resource expansion instruction and the CPU throughput algorithm parameter information; the CPU throughput algorithm parameter information comprises a safety threshold range and CPU throughput calculation time, and the recommended value is in the safety threshold range.
7. The method according to claim 6, wherein the CPU throughput algorithm parameter information further comprises offset sample data cleaning configuration.
8. A CPU resource scaling control device, comprising:
the instruction acquisition module is used for acquiring a CPU resource expansion instruction of a target container in the K8s cluster;
the recommended value calculation module is used for calculating the recommended value of the CPU memory resource corresponding to the target container by utilizing a CPU throughput algorithm according to the CPU resource expansion instruction;
and the adjusting module is used for adjusting the CPU memory resource corresponding to the target container in the container group according to the recommended value.
9. A CPU resource scaling control apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the CPU resource scaling control method of any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the CPU resource scaling control method according to any one of claims 1 to 7.
CN202210109151.5A 2022-01-28 2022-01-28 Method, device, equipment and storage medium for controlling expansion and contraction of CPU (Central processing Unit) resources Pending CN114461394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210109151.5A CN114461394A (en) 2022-01-28 2022-01-28 Method, device, equipment and storage medium for controlling expansion and contraction of CPU (Central processing Unit) resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210109151.5A CN114461394A (en) 2022-01-28 2022-01-28 Method, device, equipment and storage medium for controlling expansion and contraction of CPU (Central processing Unit) resources

Publications (1)

Publication Number Publication Date
CN114461394A true CN114461394A (en) 2022-05-10

Family

ID=81411866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210109151.5A Pending CN114461394A (en) 2022-01-28 2022-01-28 Method, device, equipment and storage medium for controlling expansion and contraction of CPU (Central processing Unit) resources

Country Status (1)

Country Link
CN (1) CN114461394A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116980421A (en) * 2023-09-25 2023-10-31 厦门她趣信息技术有限公司 Method, device and equipment for processing tangential flow CPU resource surge under blue-green deployment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116980421A (en) * 2023-09-25 2023-10-31 厦门她趣信息技术有限公司 Method, device and equipment for processing tangential flow CPU resource surge under blue-green deployment
CN116980421B (en) * 2023-09-25 2023-12-15 厦门她趣信息技术有限公司 Method, device and equipment for processing tangential flow CPU resource surge under blue-green deployment

Similar Documents

Publication Publication Date Title
CN108632365B (en) Service resource adjusting method, related device and equipment
CN113726846B (en) Edge cloud system, resource scheduling method, equipment and storage medium
CN108076082A (en) A kind of expansion method of application cluster, device and system
CN106886434B (en) Distributed application installation method and device
CN112929408A (en) Dynamic load balancing method and device
CN112764920B (en) Edge application deployment method, device, equipment and storage medium
CN104113576A (en) Method and device for updating client
WO2016169166A1 (en) Virtual machine scheduling method and device
CN105808341A (en) Method, apparatus and system for scheduling resources
CN113992691B (en) Method, device and equipment for distributing edge computing resources and storage medium
CN104239156A (en) External service call method and system
CN112465146A (en) Quantum and classical hybrid cloud platform and task execution method
CN114461394A (en) Method, device, equipment and storage medium for controlling expansion and contraction of CPU (Central processing Unit) resources
CN109960579B (en) Method and device for adjusting service container
CN114637650A (en) Elastic expansion method based on Kubernetes cluster
CN110875838A (en) Resource deployment method, device and storage medium
EP3340534A1 (en) A local sdn controller and corresponding method of performing network control and management functions
CN114706675A (en) Task deployment method and device based on cloud edge cooperative system
WO2023089350A1 (en) An architecture for a self-adaptive computation management in edge cloud
CN111831447B (en) Application elastic capacity expansion method and device based on performance monitoring
CN106886477B (en) Method and device for setting monitoring threshold in cloud system
CN104135525A (en) Resource expanding method and device for cloud platform ELB components
CN108770014B (en) Calculation evaluation method, system and device of network server and readable storage medium
CN115048186A (en) Method and device for processing expansion and contraction of service container, storage medium and electronic equipment
CN107682409B (en) Cluster resource pre-stretching method and 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