Search

CN-115391043-B - Application creation method, device, equipment and computer readable storage medium

CN115391043BCN 115391043 BCN115391043 BCN 115391043BCN-115391043-B

Abstract

The invention discloses an application creation method, which comprises the following steps of obtaining initial CPU core numbers to be allocated to target applications when the target applications are created by using BestEffort Pod, obtaining preset CPU NUMA affinity initialization core numbers, carrying out CPU NUMA affinity operation according to the CPU NUMA affinity initialization core numbers to obtain affinity results, determining initial CPU cores to be bound when the CPU core binding conditions are met according to the initial CPU core numbers and the affinity results, and binding the target applications with the initial CPU cores to create the target applications by using the initial CPU cores. By applying the application creation method provided by the invention, the capability of the BestEffort Pod for efficiently executing the service is improved, the request time delay is reduced, and the application running efficiency is improved. The invention also discloses an application creation device, equipment and a storage medium, which have corresponding technical effects.

Inventors

  • LI LONGFENG

Assignees

  • 济南浪潮数据技术有限公司

Dates

Publication Date
20260505
Application Date
20220830

Claims (7)

  1. 1. An application creation method, comprising: when a target application is created by using BestEffort Pod, acquiring an initial CPU core number to be allocated to the target application; acquiring a preset CPU NUMA affinity initialization core number; Performing CPU NUMA affinity operation according to the CPU NUMA affinity initialization core number to obtain an affinity result; when the CPU core binding condition is determined to be met according to the initial CPU core number and the affinity result, determining an initial CPU core to be bound; Binding the target application with the initial CPU core so as to create the target application by utilizing the initial CPU core; after creating the target application using the initial CPU core, further comprising: Collecting CPU use data of the target application; calculating the number of target CPU cores to be allocated to the target application according to the CPU usage data; Comparing the target CPU core number with the initial CPU core number to obtain a comparison result; when the fact that the re-binding is needed is determined according to the comparison result, re-binding operation is carried out on the target application; Calculating a target CPU core number to be allocated to the target application according to the CPU usage data, including: constructing a target histogram corresponding to the CPU usage data by using a half-life index histogram model; calculating a CPU core number estimated value to be allocated to the target application according to the target peak value of the target histogram; performing confidence calculation on the CPU usage data to obtain target confidence; Calculating the target CPU core number according to the CPU core number estimated value and the target confidence coefficient; Performing confidence calculation on the CPU usage data to obtain a target confidence, including: acquiring a first sampling time corresponding to first sampling in a preset duration; acquiring a second sampling time corresponding to last sampling in the preset duration; Calculating a difference between the second sampling time and the first sampling time; Acquiring the total number of samples of CPU usage data acquired in the preset time period; Calculating the number of sub-samples of the CPU usage data acquired in a preset unit time according to the total number of samples, wherein the preset unit time is consistent with the time unit of the difference value; and selecting the small difference value and the small number of the divided samples as the target confidence.
  2. 2. The application creation method according to claim 1, wherein when it is determined that a CPU core binding condition is satisfied based on the initial CPU core number and the affinity result, determining an initial CPU core to be bound includes: Determining the idle CPU core number in the target NUMA to be allocated currently according to the affinity result; judging whether the idle CPU core number is larger than or equal to the initial CPU core number; If yes, determining an initial CPU core to be bound from idle CPU cores in the NUMA.
  3. 3. The application creation method according to claim 1 or 2, wherein when it is determined that re-nucleation is required according to the comparison result, re-nucleating the target application comprises: And when the comparison result shows that the target CPU core number is larger than the initial CPU core number, carrying out core binding operation on the target application again.
  4. 4. The application creation method according to claim 1 or 2, wherein when it is determined that re-nucleation is required according to the comparison result, re-nucleating the target application comprises: And when the fact that the re-binding is needed and the bindable CPU resource exists is determined according to the comparison result, carrying out the re-binding operation on the target application.
  5. 5. An application creation apparatus, comprising: the initial CPU core number acquisition module is used for acquiring the initial CPU core number to be allocated to a target application when the target application is created by using the BestEffort Pod; The NUMA affinity initialization core number acquisition module is used for acquiring the preset CPU NUMA affinity initialization core number; The affinity result obtaining module is used for carrying out CPU NUMA affinity operation according to the CPU NUMA affinity initialization core number to obtain an affinity result; The initial CPU core determining module is used for determining an initial CPU core to be bound when the CPU core binding condition is determined to be met according to the initial CPU core number and the affinity result; The application creation module is used for binding the target application with the initial CPU core so as to create the target application by utilizing the initial CPU core; Further comprises: the CPU usage data acquisition module is used for acquiring CPU usage data of the target application after the target application is created by utilizing the initial CPU core; The CPU core number calculation module to be allocated is used for calculating the target CPU core number to be allocated to the target application according to the CPU use data; The comparison result obtaining module is used for comparing the target CPU core number with the initial CPU core number to obtain a comparison result; The re-binding module is used for re-carrying out the binding operation on the target application when the re-binding is determined to be carried out according to the comparison result; the CPU core number calculation module to be allocated comprises: The histogram construction submodule is used for constructing a target histogram corresponding to the CPU use data by utilizing the half-life index histogram model; The core number estimation value calculation sub-module is used for calculating a CPU core number estimation value to be distributed to the target application according to the target peak value of the target histogram; the confidence coefficient calculation submodule is used for carrying out confidence coefficient calculation on the CPU use data to obtain target confidence coefficient; The CPU core number calculation sub-module to be allocated is used for calculating the target CPU core number according to the CPU core number estimation value and the target confidence coefficient; the confidence computation submodule includes: The first sampling time acquisition unit is used for acquiring a first sampling time corresponding to the first sampling in the preset duration; the second sampling time acquisition unit is used for acquiring a second sampling time corresponding to last sampling in the preset duration; A time difference calculating unit for calculating a difference between the second sampling time and the first sampling time; the sample total number acquisition unit is used for acquiring the total number of samples of the CPU usage data acquired in the preset duration; The CPU usage data acquisition unit is used for acquiring CPU usage data of the CPU usage data in a preset unit time length according to the total number of the samples, wherein the preset unit time length is consistent with the time unit of the difference value; and the confidence coefficient calculating unit is used for selecting the small difference value and the small sample number as the target confidence coefficient.
  6. 6. An application creation apparatus, comprising: A memory for storing a computer program; a processor for implementing the steps of the application creation method according to any of claims 1 to 4 when executing said computer program.
  7. 7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, implements the steps of the application creation method of any of claims 1 to 4.

Description

Application creation method, device, equipment and computer readable storage medium Technical Field The present invention relates to the field of container technologies, and in particular, to an application creation method, apparatus, device, and computer readable storage medium. Background In the container technology era, a large number of business applications are technically clouded by Kubernetes container orchestration. Kubernetes is an open source platform for automatic deployment, expansion and operation of container clusters, and is abbreviated as k8s. The deployed application will eventually run in the form of a Pod (container group). Pod is the smallest deployable unit in Kubernetes. Pod Qos is used to represent the quality of service of the currently running Pod, and the value of Pod Qos includes BestEffort, burstable, guaranteed. The Pod service level of Qos is Guaranted is higher, the Qos is the service preferentially Guaranteed by the Kubernetes cluster, the Pod service level of Qos is BestEffort is lower, if the node resources of the Kubernetes cluster are insufficient, the Pod of the type is preferentially recovered, and the Pod service level of Qos is Burstable is centered and relatively stable. The Pod using BestEffort does not limit the amount of resources used by the Pod when creating the application, and the application process causes context switching when using the CPU. The application is prolonged in the time of running the request, and the running efficiency is low. In summary, how to effectively solve the problems of prolonged request time and low running efficiency of the application created by using the Pod of BestEffort is an urgent need of those skilled in the art at present. Disclosure of Invention The invention aims to provide an application creation method which improves the capability of BestEffort Pod to efficiently execute services, reduces request time delay and improves application running efficiency, and provides an application creation device, equipment and a computer readable storage medium. In order to solve the technical problems, the invention provides the following technical scheme: An application creation method, comprising: when a target application is created by using BestEffort Pod, acquiring an initial CPU core number to be allocated to the target application; acquiring a preset CPU NUMA affinity initialization core number; Performing CPU NUMA affinity operation according to the CPU NUMA affinity initialization core number to obtain an affinity result; when the CPU core binding condition is determined to be met according to the initial CPU core number and the affinity result, determining an initial CPU core to be bound; Binding the target application with the initial CPU core so as to create the target application by using the initial CPU core. In one specific embodiment of the present invention, when it is determined that the CPU core binding condition is satisfied according to the initial CPU core number and the affinity result, determining the initial CPU core to be bound includes: Determining the idle CPU core number in the target NUMA to be allocated currently according to the affinity result; judging whether the idle CPU core number is larger than or equal to the initial CPU core number; If yes, determining an initial CPU core to be bound from idle CPU cores in the NUMA. In one embodiment of the present invention, after the target application is created by using the initial CPU core, the method further includes: Collecting CPU use data of the target application; calculating the number of target CPU cores to be allocated to the target application according to the CPU usage data; Comparing the target CPU core number with the initial CPU core number to obtain a comparison result; and when the fact that the core is required to be bound again is determined according to the comparison result, carrying out core binding operation on the target application again. In a specific embodiment of the present invention, when it is determined that the re-binding needs to be performed according to the comparison result, re-performing the core binding operation on the target application includes: And when the comparison result shows that the target CPU core number is larger than the initial CPU core number, carrying out core binding operation on the target application again. In a specific embodiment of the present invention, when it is determined that the re-binding needs to be performed according to the comparison result, re-performing the core binding operation on the target application includes: And when the fact that the re-binding is needed and the bindable CPU resource exists is determined according to the comparison result, carrying out the re-binding operation on the target application. In one embodiment of the present invention, calculating the target CPU core number to be allocated to the target application according to the CPU usage data includes: constructing