Resource allocation method and device and computing platform
By obtaining the stream processor usage of the container and aggregating it on the target processor, the problem of low resource utilization of public cloud processors is solved, efficient resource sharing and stability is achieved, and a computing platform suitable for tidal attribute services is used. .
Patent Information
- Application Number
- CN202411111685.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-10
AI Technical Summary
In terms of improving processor resource utilization, the existing technology mainly adopts automatic replication or reduction of container instances, resulting in low efficiency and affecting cluster stability. Especially when the service has tidal attributes, the processor utilization rate is not high or Too high to meet user access needs.
By obtaining the stream processor usage of the container, identifying containers that are lower than the preset quota usage, and aggregating them on target processors that are lower than the preset usage, leveraging multi-process service technology and virtualization technology, Realize efficient sharing and utilization of processor resources.
It improves the utilization rate of processor resources, ensures that the processor can meet user needs, reduces response delay, and optimizes resource configuration during tidal time periods, improving the stability and efficiency of the computing platform.
Smart Images

Figure CN119105865A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of container virtualization, and in particular to a resource configuration method, a device and a computing platform. Background Art
[0002] With the continuous advancement of artificial intelligence technology, when faced with increasingly large-scale and complex artificial intelligence computing tasks, public clouds currently mainly use automatic replication or reduction of container instances to achieve dynamic resource allocation in order to improve the utilization of processor resources (such as image processors). This cannot effectively improve the utilization of processor resources. Summary of the invention
[0003] The present application provides a resource configuration method and device and a computing platform, which can effectively improve the resource utilization of the processor.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] In a first aspect, the present application provides a resource configuration method, which may include: obtaining a stream processor usage rate of each container in at least one container; wherein the stream processor usage rate of the container is based on the ratio between the resources occupied by the container on the running processor and all the resources of the running processor; determining the containers whose stream processor usage rate is lower than a preset quota usage rate as a first container set; wherein the preset quota usage rate is used to characterize the ratio between the maximum resources that the container can request from the running processor and all the resources of the running processor; aggregating the first container set onto at least one first target processor; wherein the usage rate of the first target processor is lower than the preset usage rate.
[0006] In a second aspect, the present application provides a resource configuration device, which may include: a first acquisition module, used to obtain the stream processor usage of each container in at least one container; wherein the stream processor usage of the container is based on the ratio between the resources occupied by the container on the running processor and all the resources of the running processor; a first determination module, used to determine the containers whose stream processor usage is lower than the preset quota usage as a first container set; wherein the preset quota usage is used to characterize the ratio between the maximum resources that the container can request from the running processor and all the resources of the running processor; a first aggregation module, used to aggregate the first container set to at least one first target processor; wherein the usage of the first target processor is lower than the preset usage.
[0007] In a third aspect, the present application provides a computing platform, including a resource management component and at least two processors, wherein at least one container runs on each of the processors;
[0008] The resource management component is used to obtain the stream processor usage of each container in at least one container; wherein the stream processor usage of the container is based on the ratio between the resources occupied by the container on the running processor and all the resources of the running processor; the containers whose stream processor usage is lower than the preset quota usage are determined as the first container set; wherein the preset quota usage is used to characterize the ratio between the maximum resources that the container can request from the running processor and all the resources of the running processor; the first container set is aggregated onto at least one first target processor; wherein the usage of the first target processor is lower than the preset usage.
[0009] In a fourth aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned resource configuration method when executing the computer program.
[0010] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the above-mentioned resource configuration method.
[0011] In a sixth aspect, the present application provides a computer program, comprising computer-readable program instructions. When the computer-readable program instructions are executed in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0012] In a seventh aspect, the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, can implement the above-mentioned resource configuration method.
[0013] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0015] Figure 1 This is a schematic diagram of a first implementation flow of the resource configuration method in an embodiment of the present application;
[0016] Figure 2 A schematic diagram of a second implementation flow of the resource configuration method in an embodiment of the present application;
[0017] Figure 3 This is a schematic diagram of a third implementation flow of the resource configuration method in the embodiment of the present application;
[0018] Figure 4 This is a schematic diagram of a fourth implementation flow of the resource configuration method in the embodiment of the present application;
[0019] Figure 5 This is a schematic diagram of a fifth implementation flow of the resource configuration method in the embodiment of the present application;
[0020] Figure 6 A schematic diagram of the overall architecture of the resource configuration method in the embodiment of the present application;
[0021] Figure 7 This is implementation scenario 1 of the resource configuration method in the embodiment of the present application;
[0022] Figure 8 This is the second implementation scenario of the resource configuration method in the embodiment of the present application;
[0023] Fig. 9 A schematic diagram of the structure of a resource configuration device in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0025] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific order for the objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing this application and are not intended to limit this application.
[0027] In container virtualization technology, the existing resource configuration method usually uses third-party software to obtain the processor usage, but cannot obtain the container's stream processor usage.
[0028] The current dynamic allocation of public clouds prioritizes business stability and secondly pursues a higher resource sales ratio. The dynamic configuration (dynamic expansion and contraction) mechanism is mainly based on monitoring operating performance indicators such as the query rate per second (QPS) and traffic. The containers running on the processor are copied or reduced based on the operating performance indicators. This results in low efficiency and affects the stability of the cluster.
[0029] In addition, some types of services have tidal properties. During a period of time, such as at night, the number of requests for this type of service is very low, but during other time periods, such as during the day, the number of requests for this type of service may be very high. Therefore, if only the containers running on the processor are replicated, the processor utilization may be low when the number of requests is very low at night. Similarly, if only the containers running on the processor are reduced, the processor may not be able to meet the user's access needs and respond slowly when the number of requests is very high during the day.
[0030] In order to solve the above problems, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0031] The embodiment of the present application provides a resource configuration method, which is implemented by a resource management component in a distributed computing platform, the computing platform comprising a resource management component and at least two processors, wherein at least one container is running on each of the processors; the resource management component is used to implement Figure 1 The method shown can effectively improve the resource utilization of processors in the cluster.
[0032] Figure 1 FIG. 1 is a schematic diagram of a first implementation flow of the resource configuration method in the embodiment of the present application. Figure 1 As shown, the resource configuration method may include steps S100 to S300.
[0033] In step S100, a stream processor usage rate of each container in at least one container is obtained.
[0034] The container's streaming multiprocessor (SM) usage is based on the ratio of the resources occupied by the container on the processor on which it is running to all the resources of the processor on which it is running.
[0035] The stream processor is the basic unit for executing parallel computing tasks on the processor and is a key component of the stream processor performance. The SM usage rate can be understood as the usage of the stream processor in the GPU to which the container is assigned.
[0036] Containers can provide a lightweight, portable, independent operating environment that can include applications and dependencies. Container virtualization technology allows users to flexibly configure the resource usage of containers according to the actual needs of the application, such as by simulating or encapsulating processor devices so that containers can directly access processor resources. By reasonably setting the resource limits and request values of the container, it can be ensured that the container can obtain sufficient resources and run stably. The more commonly used container virtualization technology is implemented using a container cluster management platform (Kubernetes, K8s). The container cluster management platform relies on container virtualization technology to deploy containers in the cluster, and provides a wealth of tools and interfaces to help users monitor and optimize application performance. At the same time, K8s also supports automated expansion and contraction functions, which can dynamically adjust resource allocation to optimize performance according to the load of the application.
[0037] In some embodiments, the stream processor usage of the container can be obtained using K8s tools and interfaces, where the stream processor usage of the container reflects the degree to which the stream processor resources of the processor are occupied when executing computing tasks.
[0038] It is understandable that multiple containers can be run on a single processor (which can be a stream processor) to achieve effective sharing and utilization of processor resources, where the stream processor utilization rate can be used as a measurement indicator to evaluate the frequency or degree of processor resources being used by containers. Then, when performing resource configuration, the stream processor utilization rate of each of the multiple containers in the cluster can be obtained.
[0039] In some embodiments, the stream processor usage of each container in at least one container can be obtained by calling the NVIDIA Management Llibrary (NVML) interface to obtain the processor usage and the stream processor usage of each container running on the processor from the processor's kernel computing cycle level. NVML is a dynamic library developed by NVIDIA, and its main function is to monitor and manage various states of NVIDIA processor devices, including but not limited to parameters such as the temperature of the graphics card, the processor usage, and the stream processor usage of the container.
[0040] In some embodiments, when using deep learning frameworks such as TensorFlow, Keras, and PyTorch, the usage of the stream processor of the container running on the processor can be viewed by writing code. For example, in TensorFlow, the usage of the processor is verified by creating an interactive session and checking the available processors, and the usage of the stream processor of the container can be viewed. For Keras and PyTorch, the corresponding libraries can be imported and the relevant usage information of the processor device can be viewed, and the usage of the stream processor of the container can also be viewed.
[0041] In step S200, containers whose stream processor usage is lower than a preset quota usage are determined as a first container set.
[0042] The preset quota usage rate is used to represent the ratio between the maximum resource that the container can request from the running processor and all resources of the running processor.
[0043] The first container set includes at least two first containers.
[0044] It can be understood that when the stream processor usage of the container is lower than the preset quota usage, it means that the stream processor usage of the container does not reach the preset usage standard, thereby reducing the resource utilization of the processor, so it is necessary to determine the container whose stream processor usage is lower than the preset quota usage. Then, when executing step S200, the container whose stream processor usage is lower than the preset quota usage obtained in step S100 can be determined as the first container, and the first container set including all first containers is further obtained.
[0045] Furthermore, the preset quota usage rate is a minimum usage rate standard that the container needs to meet in order to use the preset quota.
[0046] In some embodiments, when a container is created, a preset quota usage rate of the processor corresponding to the container can be set by adjusting the container's configuration file, etc., thereby allocating an available share of processor resources to each container, thereby achieving fine management of the container and fair allocation and efficient use of processor resources.
[0047] In some embodiments, the preset quota usage rate may also be adjusted dynamically. By monitoring and tuning the preset quota usage rate, it may be ensured that the processor can process user requests more efficiently and meet business needs.
[0048] In some embodiments, the historical usage data of the processor can be obtained based on the monitoring system Prometheus and / or the visualization tool Grafana, and the historical usage data of the processor in different time periods can be calculated in combination with the operating environment of the processor and the monitoring tool, and the preset quota usage rate is calculated for each container. Among them, the monitoring system Prometheus is a system for collecting and storing time series data, which can regularly capture the usage data of the processor. The usage data can include the usage data of the containers running on the processor, and the historical usage data is stored in the time series database. The visualization tool Grafana can also collect the usage data of the processor, and can monitor and analyze the historical usage data of the processor based on its own chart editing function.
[0049] In some embodiments, a preset quota usage rate can also be configured at the Namespace level of the Kubernetes system to configure the processor resources that can be requested by the container, thereby providing a more stable and efficient cluster environment for users or applications that require high-performance computing. Among them, the Namespace in the Kubernetes system provides a mechanism to logically isolate the resource objects of multiple processors in the cluster, and different containers can be configured at the Namespace level, including configuring the preset quota usage rate that each container can use on the processor.
[0050] In some embodiments, a graphics processing unit (GPU) is divided into multiple virtual graphics processing units (vGPU) using virtualization technology, and each vGPU is assigned an independent preset quota. Virtualization technology enables multiple users or applications to run independently on the same processor, and each user or application can use the resources on the processor.
[0051] In some embodiments, there are many reasons why the stream processor usage of a container is lower than the preset quota usage, including but not limited to: 1) The requested task may not be effectively allocated to each processor, causing some processors to be idle, resulting in low stream processor usage of the container. 2) The parallelism of the stream processors in the processor is not high, resulting in the container being unable to fully utilize the stream processor resources of the processor, resulting in low stream processor usage of the container. 3) In a cluster environment, multiple containers may compete for stream processor resources at the same time, but due to improper scheduling strategies, processor resources cannot be continuously and effectively utilized, resulting in low stream processor usage of the container.
[0052] In step S300, a first set of containers is aggregated onto at least one first target processor.
[0053] The usage rate of the first target processor is lower than the preset usage rate.
[0054] It is understandable that multiple stream processors with usage rates lower than the preset quota usage rate can be aggregated to a processor that does not meet the preset usage rate, so as to use processor resources to a greater extent and improve the processor usage rate. Then, when executing step S300, one or more first containers can be selected from the first container set obtained in step S200 and aggregated to a processor that does not meet the preset usage rate.
[0055] The method provided in the embodiment of the present application is applicable to the operation process of realizing container virtualization in at least one processor using multi-process service (MPS) technology. MPS is a method of executing a program using multiple processes. Multiple processes can run simultaneously, where each process is an independent instance of the program. This technology utilizes the multitasking capability of the operating system and can significantly reduce the idle time of the processor in the operating system, thereby improving the execution efficiency of the program and the resource utilization of the processor.
[0056] In some embodiments, the first container set is aggregated onto at least one first target processor, and multiple containers can be aggregated onto one processor using multi-process service technology. Multiple containers can run simultaneously and share processor resources, rather than one process monopolizing the entire processor as in the traditional way.
[0057] Docker is an open source application container engine used to package, distribute, and run any application. It has built-in container orchestration and management tools, and provides rich functions to define, deploy, and manage containerized applications, thereby achieving container aggregation and collaborative work.
[0058] In some embodiments, the first set of containers is aggregated onto at least one first target processor, and the processor resources can be allocated to the containers through the container orchestration and management tools built into Docker to ensure that multiple containers can reasonably share the processor resources.
[0059] Figure 2 FIG. 1 is a schematic diagram of a second implementation flow of the resource configuration method in the embodiment of the present application. Figure 2 As shown, step S100 "obtaining the stream processor usage of each container in at least one container" may include steps S110 to S120. Figure 2 The steps shown are explained.
[0060] In step S110, the length of the time slice for each container to run on the processor is obtained based on the time division multiplexing technology.
[0061] It can be understood that time division multiplexing technology can effectively allocate time resources to each container. When the resources on the processor are used by the container, it can be considered that the container has obtained a certain time slice to perform tasks. That is, the active state of the container within the time slice can be considered as the container's use of the processor, reflecting the container's stream processor utilization rate. Then, when calculating the container's stream processing utilization rate, the length of the time slice for each container running on the processor can be obtained based on the time division multiplexing technology.
[0062] In some embodiments, the length of the time slice for the container to run can also be obtained by using a system monitoring tool to view detailed information of the system process. The detailed information of the system process includes the running time length of one or more processes running in the container. The system monitoring tool may include command line tools top, htop, and ps.
[0063] In step S120, based on the length of the time slice during which each container is running on each processor, the stream processor usage of the container is determined.
[0064] It is understandable that the time resource occupied by the container can be used as an indicator to reflect the utilization rate of the container's resources, that is, the container's stream processor utilization rate. Then, when executing step S120, the container's stream processor utilization rate can be determined by the length of the time slice of each container of the processor obtained in step S110.
[0065] In some embodiments, the processor divides the time provided for the entire channel to transmit information into a number of time slices, and allocates the time slices to each container for use. Each container can run on a different time slice.
[0066] In some embodiments, by obtaining the stream processor usage of each container, each container whose stream processor usage is lower than the preset quota usage is determined as a first container, and finally multiple first containers are aggregated to a first target processor whose processor usage is lower than the preset usage. Containers with lower usage on multiple processors can be configured to one processor, freeing up multiple processors with low access rates, thereby improving the resource utilization of processors in the cluster.
[0067] Figure 3 FIG. 1 is a schematic diagram of a third implementation flow of the resource configuration method in the embodiment of the present application. Figure 3 As shown, step S120 "determining the stream processor usage of the container based on the time slice length of each container running on each processor" may include: step S121 to step S122, which will be combined with Figure 3 The steps shown are explained.
[0068] In step S111, the sum of the time slice lengths of the containers running on the processor is determined as the time slice length of the processor running.
[0069] It is understandable that a processor may include multiple containers, and each container may use the processor's resources at different times, that is, each container corresponds to a different time slice length when it is running, and the sum of the time slice lengths of all containers running on the processor can be used as the time slice length of the processor. Then, the time slice lengths of each container running on the processor can be accumulated to obtain the time slice length of the processor.
[0070] In step S112, the percentage of the length of a time slice during which a container is run relative to the length of a time slice during which the container is run on the processor is determined as the stream processor usage rate of each container in the at least one container.
[0071] It can be understood that by calculating the ratio of the length of the time slice of the container operation to the length of the time slice of the processor operation, the utilization rate of the container on the processor can be reflected. Then, when executing step S112, the percentage of the length of the time slice of a container operation relative to the length of the time slice of the processor operation determined in step S112 can be calculated, and the obtained percentage is determined as the container's stream processor utilization rate.
[0072] In some embodiments of the present invention, when the multi-process service technology is not enabled, the length of the time slice of each container running on the processor is obtained based on the time division multiplexing technology, and then the flow processor utilization rate of the container is determined based on the length of the time slice of each container running on the processor. The percentage of the time slice length of the container running to the time slice length of the processor running is corresponded to the flow processor utilization rate at the container level to obtain the flow processor utilization rate of the container, without the need to monitor and count the resources used by the container and the resources provided by the processor, and can be flexibly applied to different application scenarios and requirements.
[0073] In some embodiments, step S300 of “aggregating the first set of containers onto at least one first target processor” may include step S310 .
[0074] In step S310, the first container set is aggregated onto at least one first target processor by creating a second container corresponding to each first container in the first container set on the first target processor.
[0075] It is understandable that in a cluster, when multiple containers are configured in a target processor through virtualization technology, it is necessary to create virtual containers corresponding to the containers on the target processor. Then, when aggregating the first container set to at least one first target processor, the first container set can be aggregated to at least one first target processor by creating a virtualized copy of each first container in the first set as a second container on the target processor.
[0076] In some embodiments, the internal configuration of the container generally remains unchanged during operation. When configuring the container using a containerization platform such as Docker or Kubernetes, the scheduling and configuration of the container is not achieved by modifying the configuration file, but by creating a new image container based on the configuration file.
[0077] In some embodiments, the container configuration file can be modified by using environment variables, mounting configuration files, using configuration management tools, and writing automated scripts.
[0078] In some embodiments, the processor on which the first container runs is an initial processor, and the method may include step S311.
[0079] In step S311, when the second container operates normally, the first container corresponding to the second container that operates normally is released on the initial processor.
[0080] It is understandable that virtualized container technology allows multiple virtual containers that support multi-process service technology to run on a physical machine. These containers share the resources of the host machine. If a container has a problem, it will affect the stability and availability of the entire system. In order to ensure effective resource management and system stability, it is necessary to shut down containers that are no longer in use. Then, when the second container is running normally, it is necessary to release the first container corresponding to the second container that is running normally on the initial processor.
[0081] In some embodiments, the first container set includes at least two first containers, and step S310 "aggregating the first container set onto at least one first target processor by creating a second container corresponding to each first container in the first container set on the first target processor" may include step S312.
[0082] In step S312, second containers supporting multi-process service technology corresponding one-to-one to each first container are created on at least one first target processor.
[0083] The usage rate of the first target processor where the second container is created meets the preset usage rate.
[0084] Understandably, with the support of multi-process service technology, containers can run in parallel on different processors, further realizing the aggregation of containers on processors and ensuring that containers can fully utilize the advantages of multiple processors. Then, second containers supporting multi-process service technology corresponding to each first container can be created on the first target processor whose utilization rate is lower than the preset utilization rate.
[0085] In some embodiments, the method further comprises at least one of the following:
[0086] In a first method, the first target processor may be selected by randomly selecting one of a plurality of processors whose usage rates are lower than a preset usage rate as the first target processor.
[0087] Mode 2: The mode of selecting the first target processor may also be to select a processor with the fastest bandwidth connection speed among multiple processors whose usage rates are lower than a preset usage rate as the first target processor.
[0088] Mode three, the mode of selecting the first target processor may also be to select a processor with the lowest network delay among multiple processors whose utilization rates are lower than a preset utilization rate as the first target processor.
[0089] Figure 4 FIG. 4 is a schematic diagram of a fourth implementation flow of the resource configuration method in the embodiment of the present application. Figure 4 As shown, the resource configuration method may include steps S400 to S500.
[0090] In step S400, the operating performance index of the first target processor is acquired in real time during a preset period of time.
[0091] It can be understood that the preset period is a tidal period when the computing platform is running. For example, the preset period can be an idle period in the tidal period. During the idle period, the usage rate of the stream processors of some containers is low, and the containers can be aggregated. During the busy period in the tidal period, the containers can also be restored to the original processor.
[0092] When containers are aggregated, since the number of processors is less than that before aggregation, the number of access requests that a single processor needs to process may be very large. When the operating performance index of the processor for processing access requests exceeds the range, the processor will be unable to process a large number of requests and the performance will be reduced. Therefore, within the preset period, it is necessary to obtain the operating performance index of the first target processor in real time to evaluate whether the processor can currently process the user's request efficiently.
[0093] The query rate per second represents the number of query requests that a computer system or network can process per second, and is often used to evaluate and compare the performance and load capacity of different systems. In addition, the operating performance indicators used to evaluate and compare the performance and load capacity of different systems include but are not limited to core frequency, video memory capacity and type, video memory bandwidth, heat dissipation capacity, pixel fill rate, texture fill rate, and floating-point computing power.
[0094] In some embodiments, the operating performance indicators may include query rate per second, core frequency, video memory capacity and type, video memory bandwidth, heat dissipation capability, pixel fill rate, texture fill rate, and floating point computing capability.
[0095] In step S500, when the running performance index of the first target processor does not meet the condition, the second container corresponding to the first container on the first target processor is aggregated to the second target processor.
[0096] The utilization rate of the aggregated second target processor is lower than the preset utilization rate.
[0097] The second target processor includes the processor of the first container before aggregation.
[0098] It can be understood that when the operating performance index of the processor does not meet the conditions, it means that the processor can no longer process or efficiently process the user's request. At this time, it is necessary to disperse the user's request for the processor aggregated with the container and allocate the container to other processors. Then, when executing step S500, if it is determined that the operating performance index of the first target processor obtained in step S400 does not meet the conditions, the second containers corresponding to the first containers on the multiple first target processors are aggregated to the second target container whose usage rate is lower than the preset usage rate.
[0099] In some embodiments, the operating performance index of the first target processor is obtained in real time during a preset period of time. If the operating performance index of the first target processor does not meet the condition, the second container corresponding to the first container on the first target processor is aggregated to the second target processor. When the current operating performance index of the processor does not meet the condition, it means that the processor can no longer process or efficiently process the user's request, and the containers are dispersed to different processors, thereby improving the response speed of the processor.
[0100] In one embodiment, if the stream processor usage of multiple containers is less than the preset quota usage, then the multiple containers with the stream processor usage less than the preset quota usage can be stored on one processor. For example, the preset quota usage is 30%, and if the stream processor usage of two containers is less than 30%, then the two containers can be aggregated to one processor.
[0101] In some embodiments, two time periods may be set: from 8:00 to 20:00, and from 20:00 to 8:00 the next day. During the time period from 20:00 to 8:00 the next day, the stream processor usage of the container is monitored in real time, and the container whose stream processor usage is lower than the preset quota usage is configured on the processor whose usage is lower than the preset usage, so that the processor usage meets the preset usage. Similarly, during the time period from 8:00 to 20:00, the aggregated containers are dispersedly scheduled to the idle processors, or the containers are restored to the processors before aggregation.
[0102] In some embodiments, the average QPS in the time period from 20:00 to 8:00 the next day is used as the standard query rate per second. If the average QPS of the processor within one hour is higher than the standard query rate per second, the container is dispersed and scheduled to the idle processor, or the container is restored to the processor before aggregation. Similarly, if the average QPS of the processor within one hour is lower than the standard query rate per second, the container is scheduled to one processor as much as possible.
[0103] Figure 5 Schematic diagram of the fifth implementation process of the resource configuration method in the embodiment of the present application, such as Figure 5 The step S500 of “aggregating the second container corresponding to the first container on the first target processor to the second target processor” may include steps S510 to S520. Figure 5 The steps shown are explained.
[0104] In step S510, a third container that does not support the multi-process service technology and corresponds to each second container is created on the processor before aggregation.
[0105] It is understandable that when allocating containers to other processors, it is necessary to limit the number of containers and resource usage on the processors. Then, a third container that does not support multi-process service technology can be created corresponding to each second container.
[0106] In step S520, when each third container runs normally, the second container is released on the first target processor.
[0107] It is understandable that if the usage rate of the processor where the container is located before aggregation does not meet the preset usage rate, the container where the aggregation operation occurs can be restored to the processor where it was located before aggregation. Then, when executing step S520, if each third container runs normally, the third container obtained in step S510 can be restored to the processor before aggregation.
[0108] In some embodiments, the container is restored to the processor where it was before aggregation. The first container aggregated on the first target processor may be restored to the first target processor before aggregation by backtracking the scheduling decision.
[0109] In some embodiments, the containers are restored to the processors where they were before aggregation, and the scheduling state may be restored to a previous point in time to restore the third containers corresponding to the first containers to the processors before aggregation.
[0110] In some embodiments, new scheduling rules may be formulated, and containers for aggregation may be allocated to other processors according to the new scheduling rules.
[0111] In some embodiments, containers for aggregation may also be randomly allocated to other idle processors.
[0112] The embodiment of the present application can be implemented based on the container cloud platform GaiaStack, which is a container private cloud platform built based on Kubernetes. GaiaStack allows users to use Kubernetes's resource allocation, configuration and scheduling, container availability management, cross-infrastructure expansion or removal of containers and other features to build and manage application services across multiple containers. One of the methods for implementing resource configuration using Kubernetes is to modify the YAML file of Kubernetes. The YAML file is used to specify the deployment, service exposure, storage volume mounting, environment variables and other configuration information of the application in a declarative manner. By modifying the YAML file, the resource configuration in the cluster can be realized.
[0113] In some embodiments, the container cloud platform GaiaStack can use Kubernetes configuration and scheduling tools to enable multiple containers to share processor resources. The container cloud platform GaiaStack includes a resource management component, an agent Kubelet, a container configuration adjustment component, a virtualization management component, etc. The interaction process between the components in the container cloud platform GaiaStack includes:
[0114] In step 1, the resource management component communicates with the Kubernetes node’s agent, Kubelet, to advertise available GPU resources.
[0115] Step 2: When the user issues a request instruction, the proxy Kubelet receives the instruction information and parses it to obtain a parsing result, and sends a request instruction for requesting a GPU to the container configuration adjustment component in GaiaStack according to the parsing result.
[0116] Step 3, the container configuration adjustment component allocates GPU resources to the container used to respond to the request instruction based on the request instruction. If the GPU resources are successfully allocated to the container, the container configuration adjustment component will send the configuration information of the container to the virtualization management component in GaiaStack.
[0117] Step 4: The virtualization management component returns the configuration information of the container to the proxy Kubelet.
[0118] Step 5: The proxy Kubelet creates and initializes a container based on the configuration information of the container, and the container can call processor resources.
[0119] In the above process, Kubernetes uses namespaces to isolate multiple containers created by the proxy Kubelet, ensuring that each container can only access and operate resources within its own namespace, thereby enabling multiple containers to share processor resources and providing strong support for maintaining cluster stability.
[0120] In some embodiments, the resource configuration method provided in the embodiments of the present application can be applied to the Tencent container cloud platform to improve the utilization of limited processor resources in the cluster while ensuring the stability of the cluster.
[0121] In some embodiments, the resource configuration method provided in the embodiments of the present application can also be applied to a variety of private cloud model products, and can also improve the utilization of limited processor resources in the cluster while ensuring the stability of the cluster.
[0122] The embodiment of the present application starts with monitoring the stream processor on the processor, dynamically allocates resources from the hardware level of the processor, and makes full use of the limited processor resources in the cluster as much as possible. Based on dynamic allocation, a hardware resource aggregation technology is proposed, and hardware aggregation of containers is performed based on stream processor monitoring data to greatly improve the hardware resource utilization of the processor. In addition, based on tidal theory, after adjusting the container configuration to a container that supports multi-process services, multiple containers can be realized. After aggregating multiple containers, according to the query rate per second of the cluster, the time period of the current cluster, or other operating performance indicators, the container is restored and configured in time, and dispersed to different processors to reduce the response delay of the processor.
[0123] In some embodiments, the DCGM technology can be used to implement the method of the present application. First, monitor the stream processor utilization rate at the container level and identify the container with low stream processor utilization rate. Secondly, for these containers with low utilization rate, adjust their configuration files, configure them as containers (new containers) that support multi-process services, and add them to the cluster. Thirdly, monitor the working status of the new container to ensure its normal operation, and gradually add new containers and close the old containers whose configuration files are not adjusted corresponding to the new containers to achieve dynamic optimization of resources. Finally, monitor the stream processor utilization rate of the new container, and perform hardware aggregation on the new container based on the size of the stream processor utilization rate, that is, aggregate multiple containers onto one processor, maximize the use of GPU resources in the cluster, and further improve the utilization efficiency of resources, which can not only improve computing performance and shorten task completion time, but also reduce costs and save energy, thereby achieving more efficient and economical computing resource management. Among them, the Data Center GPU Manager (DCGM) technology is a technology for monitoring and managing GPU resources, which can collect and provide various key performance indicators about GPU, including but not limited to fan speed, clock frequency, memory usage, temperature, power consumption, etc. This data is extremely valuable for evaluating the performance of the GPU, diagnosing potential problems, and optimizing resource usage.
[0124] In some embodiments, the working status of the new container can be monitored using Docker built-in commands, dashboards, and visualizations.
[0125] In some embodiments, the monitoring tool can be integrated with the alarm system to realize automatic monitoring of the working status of the new container. When the working status of the new container is abnormal, the alarm is promptly issued through the alarm system so that timely measures can be taken.
[0126] In some embodiments, based on the tidal theory, a container recovery mechanism is designed. When cluster resources are sufficient and the number of requests per second is high, the configuration of the new container is restored to the original configuration and restored to the original processor or other distributed processors to improve the cluster GPU response speed.
[0127] Figure 6 FIG. 1 is a schematic diagram of the overall architecture of the resource configuration method in the embodiment of the present application. Figure 6 Detailed description of the implementation steps of this application solution to achieve containerized application deployment and management through the Kubernetes system and GaiaStack platform.
[0128] The resource management component 601 is responsible for detecting the available GPU resources in the cluster and obtaining the real-time usage of the GPU from the resource monitoring component 602. The real-time usage of the GPU includes the container-level GPU stream processor usage and GPU memory usage collected by the resource monitoring component 602 from the virtualization management component 603. The resource management component 601 can also access the quota component 604 to obtain container quota information from the quota component 604. The container quota information may include, for example, information that needs to be configured, such as preset quota usage rate and preset usage rate.
[0129] Among them, the resource monitoring component 602 is responsible for monitoring the stream processor usage of each container, and then the resource management component 601 can evaluate the load of the container to determine whether the container needs to be configured. The resource monitoring component 602 uses time division multiplexing technology to monitor the container operation corresponding to each time slice, and corresponds the time slice to the DCGM stream processor usage of the entire card GPU, and then obtains the stream processor usage at the container level.
[0130] The resource management component 601 compares the real-time monitored stream processor usage of the container with the preset quota usage in the quota information to evaluate the container load and determine whether the container configuration needs to be adjusted. When it is determined that the stream processor usage of the container is less than the preset quota usage, it is determined that the container load is small, and the container configuration adjustment instruction is sent to the container configuration adjustment component 603. The container configuration adjustment component 603 receives the container configuration adjustment instruction issued by the resource management component 601, adjusts the YAML file of the container based on the configuration adjustment instruction, and configures the container as a new container that supports multi-process services. After the container configuration is completed, the container configuration adjustment component 603 is responsible for monitoring the running status of the new container, ensuring that the new container can work normally and complete the task, and reporting the container's running information to the resource management component 601. When the container's running status is normal, the resource management component 601 schedules vGPU resources on the virtualization management component 605 to implement the aggregation operation of the container on the GPU.
[0131] After the aggregation operation is completed, the resource management component 601 obtains the QPS of the cluster in real time by calling the Kubernetes application programming interface (Application Programming Interface, API) server kube-apiserver 606, and determines whether the size of the QPS is the QPS size that the GPU can handle. In the case where the resource management component 601 determines that the current QPS size is the QPS size that the GPU cannot handle, the container configuration adjustment instruction is sent to the container configuration adjustment component 603, and the container configuration adjustment component 603 adjusts the YAML file of the container based on the configuration adjustment instruction, and configures the container as a container that does not support multi-process services. After the container configuration is completed, the container configuration adjustment component 603 is responsible for monitoring the running status of the container and reporting the running information of the container to the resource management component 601. When the running status of the container is normal, the resource management component 601 schedules vGPU resources on the virtualization management component 605 to achieve the dispersion of the container on different GPUs.
[0132] It should be noted that the operation steps for implementing container aggregation on the virtualization management component 605 can be found in the following section of this specification. Figure 7 For the embodiment shown, the operation steps of implementing container restoration on the virtualization management component 605 can be found in the following section of this specification. Figure 8 The embodiments shown are not described in detail here.
[0133] The architecture also includes a container deployment component 607, which can create workload objects for defining and running application instances, and manage and coordinate these workload objects by calling Kubernetes' API server kube-apiserver 606. As one of the core components in the Kubernetes cluster, Kubelet 608 can receive creation instructions sent by kube-apiserver 606 and report available GPU resources to kube-apiserver 606. Through interaction with kube-apiserver 606 and Kubelet 608, the stable operation and efficient scheduling of the Kubernetes cluster can be ensured. At the same time, Kubelet 608 also provides rich resource monitoring and log management functions, which can synchronize the GPU resource status sent by the resource management component 601, providing strong support for cluster operation and troubleshooting.
[0134] In addition, kube-apiserver 606 can define multiple namespaces for the cluster system, that is, multiple containers, and set quotas for multiple resources for multiple containers. The quota component 604 counts and stores the quota usage by calling kube-apiserver 606, and the container deployment component 607 implements the inspection and supervision of the quota execution.
[0135] The present application embodiment further provides a resource configuration method based on the container cloud platform GaiaStack. Figure 6 , adding components such as a resource management component 601, a resource monitoring component 602, and a container configuration adjustment component 603, the method comprising: using MPS to implement container virtualization in at least one processor, the resource monitoring component obtains the usage rate of a monitored container among multiple containers, and sends the usage rate of the monitored container to the resource management component; the resource management component determines the monitored container whose usage rate is lower than the preset quota usage rate as the first container; the resource management component sends a container configuration adjustment instruction to the container configuration adjustment component; the container configuration adjustment instruction includes the identifier of the first container; the container configuration adjustment component creates a second container corresponding to the first container in response to the container configuration adjustment instruction; the resource management component aggregates all second containers onto one or more first target processors.
[0136] In other embodiments, the method further includes: the resource management component obtains the query rate per second of the cluster in real time; when the query rate per second of the cluster exceeds the preset query rate per second, the resource management component sends a container configuration restoration instruction to the container configuration adjustment component; the container configuration restoration instruction includes an identifier of the second container; the container configuration adjustment component creates a third container corresponding to the second container in response to the container configuration restoration instruction; and the resource management component restores all third containers to the processor before aggregation.
[0137] Figure 7 This is implementation scenario one of the resource configuration method in the embodiment of the present application. Figure 7 In the scenario shown, the GPU resources in the cluster are limited, the stream processor usage of multiple containers is less than the preset quota usage, and the containers are distributed on different GPUs. In this case, you need to use the resource configuration method to schedule these containers to the same GPU as much as possible, and adjust the container configuration to support multi-process services.
[0138] In cluster 700, which does not perform aggregation operations on containers, there are containers 701, 702, and 703. vGPU 705 is allocated on GPU 704 for container 701, and the usage rate of vGPU 705 is 20%; similarly, vGPU 707 and vGPU 708 are allocated on GPU 706 for container 702, and the usage rates of vGPU 707 and vGPU 708 are 20% and 30% respectively; in addition, vGPU 7010 is allocated on GPU 709 for container 703, and the usage rate of vGPU 7010 is 50%.
[0139] With the preset quota usage rate of 40%, it can be seen that the usage rate of vGPU 705 allocated to container 701 does not meet the preset quota usage rate, and the usage rates of vGPU 707 and vGPU 708 allocated to container 702 do not meet the preset quota usage rate. Therefore, it is necessary to configure container 701 and container 702 as containers that support multi-process services to achieve aggregation of container 701 and container 702 on one GPU to share the resources of one GPU. Since the usage rate of vGPU 7010 allocated to container 703 on the GPU meets the preset quota usage rate, there is no need to configure container 703.
[0140] The configuration scheme for container 701 and container 702 is: configure vGPU 705 as vGPU 7011 supporting multi-process services, configure vGPU 707 as vGPU 7012 supporting multi-process services, and configure vGPU 708 as vGPU 7013 supporting multi-process services.
[0141] By using virtualization technology, the configured vGPU 7011 is created on GPU 706 to aggregate container 701 on GPU 706, and at the same time release vGPU 705 allocated to container 701. It can be seen that after the container is aggregated, GPU 704 will be idle, and the utilization rate of GPU 706 will increase.
[0142] Similarly, after configuration, vGPU 7012 and vGPU 7013 can also be created on GPU 704 to achieve aggregation of container 702 on GPU 701.
[0143] In this way, it is possible to schedule scattered containers with low stream processor usage to one GPU at night or when the QPS of the cluster is not high, freeing up other GPUs.
[0144] The open source distributed resource management framework Mesos can abstract the computing resources (such as memory) of a data center or cluster, and configure and adjust the computing resources in the cluster through a unified platform, so as to aggregate containers on a single processor through virtualization technology.
[0145] In some embodiments, the container deployment function of the Docker platform, Kubernetes platform, or Mesos platform can be used to perform the above Figure 7 The operation shown aggregates as many containers as possible onto the same processor.
[0146] Figure 8 This is the second implementation scenario of the resource configuration method in the embodiment of the present application. Figure 8 In the scenario shown: Based on the tidal theory, when the current time period is between 8:00 and 20:00, and the average QPS of the cluster within 1 hour is higher than the average QPS from 20:00 to 8:00 the next day, in order to improve response efficiency, the containers aggregated by multi-process service technology are scheduled to the initial state if there are available resources in the cluster.
[0147] After the container aggregation operation is performed on the cluster 800, the container 801, the container 802 and the container 803 are included. The container 801 and the container 802 are containers that support multi-process services. The available memory of the container 801 on the GPU 804 includes the vGPU 807. The available memory of the container 802 on the GPU 804 includes the vGPU 805 and the vGPU 806.
[0148] The operation scheme configured for container 801 and container 802 is: configure vGPU 807 as vGPU 8011 that does not support multi-process services, configure vGPU 805 as vGPU 8012 that does not support multi-process services, and configure vGPU 806 as vGPU 8013 that supports multi-process services.
[0149] By using virtualization technology, the configured vGPU 8011 is created on GPU 8010, and the vGPU 807 allocated to container 802 is released, so as to restore container 801 to GPU 8010. It can be seen that after the container is restored, there is no idle GPU, which improves the response speed of the GPU.
[0150] Similarly, after configuration, vGPU 8012 and vGPU 8013 can be created on GPU 8010, and vGPU 8011 can also be created on GPU 804, so as to restore the container to different GPUs. If the above process is implemented by a platform such as Docker, Kubernetes or Mesos for implementing container orchestration, the container deployment function of the platform itself can be used to allocate the container to different processors.
[0151] At this point, the method for configuring resources on the computing platform is completed.
[0152] The solution of this application is applied to NVIDIA GPU, but its working principle can also be applied to other GPUs. Exemplarily, the working principle includes but is not limited to monitoring hardware utilization indicators and dynamically allocating containers based on the tidal principle.
[0153] In an embodiment of the present application, the stream processor usage of each container is obtained, each container whose stream processor usage is lower than a preset quota usage is determined as a first container, and finally multiple first containers are aggregated to a first target processor whose processor usage is lower than the preset usage. In this way, containers with low resource utilization can be aggregated to one processor, thereby improving the resource utilization of processors in the cluster.
[0154] The advantages of adopting the technical solution provided by the embodiment of the present application are: 1) The present application implements dynamic adjustment of container configuration based on hardware-level utilization, and realizes dynamic allocation of containers in the cluster. Compared with the simple duplication or reduction of containers in the prior art, it realizes improving the resource utilization of processors in the cluster from the hardware level. 2) The present application monitors the stream processor utilization rate of the container and the preset quota utilization rate. On the basis that the stream processor utilization rate of the container does not meet the preset quota utilization rate, the container is scheduled to a processor as much as possible, so as to utilize multi-process service technology to achieve container aggregation to a greater extent, so that the processor utilization rate meets the preset utilization rate, thereby improving the processor utilization rate. 3) The embodiment of the present application is based on tidal theory. When the cluster resources are sufficient and the QPS is high, it can be achieved that the containers are allocated to different processors to improve the response speed of the processors in the cluster.
[0155] Based on the same inventive concept, an embodiment of the present application also provides a resource configuration device, and the modules included in the resource configuration device, as well as the units included in each module, can be implemented by a processor of an electronic device; of course, they can also be implemented by a logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0156] Fig. 9 A schematic diagram of a structure of a resource configuration device in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the resource configuration device 900 may include: an acquisition module 901, used to obtain the stream processor usage of each container in at least one container; wherein the stream processor usage of the container is based on the ratio between the resources occupied by the container on the running processor and all the resources of the running processor; a first determination module 902, used to determine the containers whose stream processor usage is lower than the preset quota usage as the first container set; wherein the preset quota usage is used to characterize the ratio between the maximum resources that the container can request from the running processor and all the resources of the running processor; an aggregation module 903, used to aggregate the first container set to at least one first target processor; wherein the usage of the first target processor is lower than the preset usage.
[0157] In some embodiments, the first acquisition module 901 may include: a first acquisition unit, used to obtain the time slice length of each container running on the processor based on time division multiplexing technology; a determination unit, used to determine the stream processor usage of each container in at least one container based on the time slice length of each container running on each processor.
[0158] In some embodiments, the determination unit is used to determine the sum of the time slice lengths of the containers running on the processor as the time slice length of the processor running; and determine the percentage of the time slice length of a container running relative to the time slice length of the container running on the processor running as the stream processor usage rate of each container in the at least one container.
[0159] In some embodiments, the first aggregation module 903 is configured to aggregate the first container set onto at least one first target processor by creating a second container corresponding to each first container in the first container set on the first target processor.
[0160] In some embodiments, the processor on which the first container runs is an initial processor, and the device further includes: a release module, which is used to release the first container corresponding to the normally running second container on the initial processor when the second container runs normally.
[0161] In some embodiments, the first container set includes at least two first containers, and the first aggregation module is used to create second containers supporting multi-process service technology on at least one first target processor that correspond one-to-one to each of the first containers, wherein the usage rate of the first target processor on which the second containers are created meets the preset usage rate.
[0162] In some embodiments, the apparatus further includes a second determining module configured to perform at least one of the following:
[0163] Randomly selecting one of a plurality of processors whose utilization rates are lower than a preset utilization rate as the first target processor;
[0164] Selecting the processor with the fastest bandwidth connection speed among the plurality of processors whose utilization rates are lower than a preset utilization rate as the first target processor;
[0165] A processor with the lowest network delay among the multiple processors whose utilization rates are lower than a preset utilization rate is selected as the first target processor.
[0166] In some embodiments, the resource configuration device 900 may further include: a second acquisition module, used to acquire the operating performance indicator of the first target processor in real time during a preset time period; a second aggregation module, used to aggregate the second container corresponding to the first container on the first target processor to the second target processor when the operating performance indicator of the first target processor does not meet the conditions, wherein the utilization rate of the aggregated second target processor is lower than the preset utilization rate.
[0167] In some embodiments, the second target processor includes the processor before aggregation of the first container, and a second aggregation module is used to create a third container that does not support multi-process service technology and corresponds to each second container on the processor before aggregation; when each of the third containers runs normally, the second container is released on the first target processor.
[0168] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0169] Based on the same inventive concept, an embodiment of the present application also provides a distributed computing platform, which may include a resource management component and at least two computing nodes, each computing node running at least one container; the resource management component is used to implement the method provided in the above embodiment.
[0170] The description of the computing platform embodiment for implementing resource configuration above is similar to the description of the method embodiment above, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the computing platform provided in the embodiments of the present disclosure can be used to execute the method described in the method embodiment above. For technical details not disclosed in the computing platform embodiment for implementing resource configuration in this application, please refer to the description of the method embodiment of this application for understanding.
[0171] It should be noted that in the embodiment of the present application, if the above-mentioned resource configuration method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.
[0172] The processor may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of processors include, but are not limited to, central processing units, graphics processing units, various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor may execute the various methods and processes described above, such as executing the resource configuration method described above.
[0173] In some embodiments, the resource configuration method described above may be implemented as a computer software program, which is stored in a machine-readable medium, such as a memory. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by a processor, one or more steps in the resource configuration method described above may be performed. Alternatively, in other embodiments, the processor may be configured to perform one or more steps in the resource configuration method described above by any other appropriate means (e.g., by means of firmware).
[0174] It should be further noted that the present application may include methods, devices, systems and / or computer program products. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present application.
[0175] The embodiment of the present application provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method can be implemented. The computer-readable storage medium can be transient or non-transient.
[0176] An embodiment of the present application provides a computer program, including computer-readable program instructions. When the computer-readable program instructions are executed in a computer device, a processor in the computer device executes some or all of the steps in the above method.
[0177] The present application embodiment provides a computer program product, including a computer program or an instruction, which, when executed by a processor, can implement some or all of the steps in the above method. The computer program product can be implemented by hardware, software, or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium, and in other embodiments, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc.
[0178] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. Computer readable storage medium can include (non-exhaustive list): a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM), a flash memory, a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof. The computer-readable storage medium used in this document is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated through a waveguide or other transmission medium (for example, light pulses through a fiber optic cable), or an electrical signal transmitted through wires.
[0179] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or to a processing device, or to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0180] The computer program instructions for performing the operation of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as C language or similar programming languages. The computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, by utilizing the state information of computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array, or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of the present application.
[0181] Various aspects of the present application are described herein with reference to the flow chart and / or step diagram of the method, device (system), and computer program product according to the exemplary embodiments of the present application. It should be understood that each step of the flow chart and / or step diagram and the combination of each step in the flow chart and / or step diagram can be implemented by computer-readable program instructions.
[0182] These computer-readable program instructions can be provided to a processor in a voice interaction device, a general-purpose computer, a special-purpose computer, or a processing unit of other programmable data processing devices, thereby producing a machine, so that when these instructions are executed by a processing unit of a computer or other programmable data processing device, a device that implements the functions / steps specified in one or more steps in a flowchart and / or a step diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions enable a computer, a programmable data processing device, and / or other devices to work in a specific manner, so that a computer-readable medium storing instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / steps specified in one or more steps in a flowchart and / or a step diagram.
[0183] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / steps specified in one or more steps in the flowchart and / or step diagram.
[0184] The flow chart and step diagram in the accompanying drawings show the possible architecture, function and operation of the equipment, method and computer program product according to multiple embodiments of the present application. In this regard, each step in the flow chart or step diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the steps can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each step in the step diagram and / or flow chart, and the combination of the steps in the step diagram and / or flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0185] The above description is only an exemplary implementation of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of protection involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the technical concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A resource configuration method, the method comprising: Obtaining a stream processor usage rate of each container in at least one container; wherein the stream processor usage rate of the container is based on a ratio between resources occupied by the container on the processor on which it is running and all resources of the processor on which it is running; Determine the containers whose stream processor usage is lower than the preset quota usage as the first container set; wherein the preset quota usage is used to represent the ratio between the maximum resource that the container can request from the running processor and all resources of the running processor; The first container set is aggregated onto at least one first target processor; wherein the usage rate of the first target processor is lower than a preset usage rate.
2. The method according to claim 1, wherein: The obtaining of the stream processor usage of each container in the at least one container includes: Obtaining the time slice length of each container running on the processor based on time division multiplexing technology; Based on the length of the time slice for each container to run on each of the processors, a stream processor usage rate of each container in the at least one container is determined.
3. The method according to claim 2, wherein: The determining, based on the time slice length of each container running on each of the processors, the stream processor usage rate of each container in the at least one container comprises: The sum of the time slice lengths of each container running on the processor is determined as the time slice length of the processor running; The percentage of a time slice length of a container operation relative to a time slice length of the container operation on the processor is determined as the stream processor usage rate of each container in the at least one container.
4. The method according to any one of claims 1 to 3, wherein: The aggregating the first set of containers on at least one first target processor includes: Aggregating the first container set to at least one of the first target processors is achieved by creating a second container corresponding to each first container in the first container set on the first target processor.
5. The method according to claim 4, wherein: The processor on which the first container runs is an initial processor, and the method further includes: In a case where the second container operates normally, a first container corresponding to the second container that operates normally is released on the initial processor.
6. The method according to claim 4, wherein: The first container set includes at least two first containers, and the step of aggregating the first containers onto at least one first target processor by creating a second container corresponding to each first container in the first container set includes: Second containers supporting multi-process service technology corresponding to each of the first containers are created on at least one first target processor, wherein a usage rate of the first target processor on which the second containers are created meets the preset usage rate.
7. The method according to any one of claims 1 to 6, wherein: The method further comprises at least one of the following: Randomly selecting one of a plurality of processors whose utilization rates are lower than a preset utilization rate as the first target processor; Selecting the processor with the fastest bandwidth connection speed among the plurality of processors whose utilization rates are lower than a preset utilization rate as the first target processor; A processor with the lowest network delay among the multiple processors whose utilization rates are lower than a preset utilization rate is selected as the first target processor.
8. The method according to any one of claims 1 to 6, wherein: The method further comprises: During the preset period, obtaining the operating performance index of the first target processor in real time; When the operating performance indicator of the first target processor does not meet the condition, aggregating the second container corresponding to the first container on the first target processor to the second target processor, wherein the utilization rate of the aggregated second target processor is lower than the preset utilization rate.
9. The method according to claim 8, wherein: The second target processor includes the processor of the first container before aggregation, and aggregating the second container corresponding to the first container on the first target processor to the second target processor includes: Creating a third container that does not support the multi-process service technology and corresponds to each second container on the processor before aggregation; When each of the third containers runs normally, the second container is released on the first target processor.
10. A resource configuration device, comprising: A first acquisition module is used to acquire a stream processor usage rate of each container in at least one container; wherein the stream processor usage rate of the container is based on a ratio between resources occupied by the container on the processor on which it is running and all resources of the processor on which it is running; A first determination module is used to determine containers whose stream processor usage is lower than a preset quota usage as a first container set; wherein the preset quota usage is used to represent the ratio between the maximum resource that the container can request from the running processor and all resources of the running processor; The first aggregation module is used to aggregate the first container set onto at least one first target processor; wherein the usage rate of the first target processor is lower than a preset usage rate.
11. A computing platform comprising a resource management component and at least two processors, wherein: At least one container is running on each of the processors; The resource management component is used to obtain the stream processor usage of each container in at least one container; wherein the stream processor usage of the container is based on the ratio between the resources occupied by the container on the running processor and all the resources of the running processor; the containers whose stream processor usage is lower than the preset quota usage are determined as the first container set; wherein the preset quota usage is used to characterize the ratio between the maximum resources that the container can request from the running processor and all the resources of the running processor; the first container set is aggregated onto at least one first target processor; wherein the usage of the first target processor is lower than the preset usage.
