A container deployment method, apparatus, device, and storage medium
Patent Information
- Application Number
- CN202211214386.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2042-09-30
AI Technical Summary
[0003]不同容器产品对硬件资源配置存在较大差异,往往需要定制不同资源比例的机型才能更好利用资源,鉴于机器成本考虑,往往企业希望采购通用的几种机型来满足所有的诉求,在通用机型下进行不同规格不同产品部署时,基于现有的K8S调度算法,常会出现资源浪费
[0018] This invention improves resource utilization by, upon receiving a container deployment instruction, acquiring first performance metrics of at least two types of container products under stress testing and second performance metrics of container instances deployed on each host in a first host set; filtering the first host set based on the second performance metrics of container instances deployed on each host in the first host set and the first performance metrics of at least two types of container products under stress testing to obtain a second host set; filtering the second host set to obtain a target host, and deploying container instances on the target host.
Smart Images

Figure CN115495199B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a container deployment method, apparatus, device and storage medium. Background Technology
[0002] Microservices and containerization technologies are currently being widely adopted in the industry. A common challenge when deploying containers is how to deploy container instances reasonably to ensure that the utilization of the host machine in the production environment is as reasonable as possible, making full use of the resources without overloading it.
[0003] Different container products have significantly different hardware resource configurations, often requiring customized machine models with varying resource ratios to better utilize resources. Due to cost considerations, enterprises often prefer to purchase a few general-purpose machine models to meet all their needs. However, when deploying different specifications and products on these general-purpose models, resource waste frequently occurs based on existing Kubernetes scheduling algorithms. For example, if the host machine has remaining CPU / memory space but has exhausted its disk space, scheduling will fail. Summary of the Invention
[0004] This invention provides a container deployment method, apparatus, device, and storage medium that can improve resource utilization.
[0005] According to one aspect of the present invention, a container deployment method is provided, comprising:
[0006] Upon receiving a container deployment instruction, obtain the first performance metrics of at least two types of container products under a stress test environment and the second performance metrics of container instances deployed on each host in the first host set.
[0007] The first host set is filtered based on the second performance index of the container instances deployed on each host in the first host set and the first performance index of at least two types of container products under stress testing environment to obtain the second host set.
[0008] The second set of host machines is filtered to obtain the target host machine, and a container instance is deployed on the target host machine.
[0009] According to another aspect of the present invention, a container deployment apparatus is provided, the container deployment apparatus comprising:
[0010] The acquisition module is used to acquire, after receiving the container deployment instruction, the first performance indicators of at least two types of container products under the stress test environment and the second performance indicators of container instances deployed on each host in the first host set.
[0011] The filtering module is used to filter the first host set based on the second performance index of the container instances deployed on each host in the first host set and the first performance index of at least two types of container products under stress testing environment, so as to obtain the second host set.
[0012] The deployment module is used to filter the second set of host machines to obtain target host machines, and deploy container instances on the target host machines.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the container deployment method according to any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the container deployment method according to any embodiment of the present invention.
[0018] This invention improves resource utilization by, upon receiving a container deployment instruction, acquiring first performance metrics of at least two types of container products under stress testing and second performance metrics of container instances deployed on each host in a first host set; filtering the first host set based on the second performance metrics of container instances deployed on each host in the first host set and the first performance metrics of at least two types of container products under stress testing to obtain a second host set; filtering the second host set to obtain a target host, and deploying container instances on the target host.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart of a container deployment method according to an embodiment of the present invention;
[0022] Figure 2 This is a flowchart of another container deployment method in an embodiment of the present invention;
[0023] Figure 3 This is a schematic diagram of the structure of a container deployment device according to an embodiment of the present invention;
[0024] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] Example 1
[0028] Figure 1This is a flowchart illustrating a container deployment method provided in an embodiment of the present invention. This embodiment is applicable to container deployment scenarios. The method can be executed by the container deployment device in this embodiment, which can be implemented in software and / or hardware, such as... Figure 1 As shown, the method specifically includes the following steps:
[0029] S110, after receiving the container deployment instruction, obtain the first performance indicators of at least two types of container products under the stress test environment and the second performance indicators of container instances deployed on each host in the first host set.
[0030] The first performance metric can be either a read performance metric or a write performance metric, and the second performance metric can be either a read performance metric or a write performance metric. It should be noted that if the first performance metric is a read performance metric, then the second performance metric is also a read performance metric, and if the first performance metric is a write performance metric, then the second performance metric is also a write performance metric.
[0031] One method for obtaining the first performance metrics of at least two types of container products under a stress test environment can be: obtaining the performance metrics of the service specifications (CPU and memory, excluding disk) and each service rule corresponding to the target type of container product under a stress test environment. The target type includes: the type of container product to be deployed and the type of deployed container instance. For example, if the first type of container product includes: service specification a, service specification b, and service specification c, then the performance metrics of service specification a, service specification b, and service specification c under a stress test environment can be obtained.
[0032] The first performance metrics of the at least two types of container products under stress testing include: the performance metrics of the container product to be deployed under stress testing and the first performance metrics of the deployed container instances under stress testing. For example, if the host machine has already deployed container instance A and container instance B, where container instance A is the container instance corresponding to the first type of container product and container instance B is the container instance corresponding to the second type of container product, and the container product to be deployed is a third type of container product, then it is necessary to obtain the first performance metrics of the first type of container product, the first performance metrics of the second type of container product, and the first performance metrics of the third type of container product under stress testing.
[0033] The host set refers to the collection of host machines that the enterprise has purchased. In other words, if a container needs to be deployed, a host machine needs to be selected from the host set, and the container instance needs to be deployed on the selected host machine.
[0034] The second performance metric for the deployed container instance includes: the performance metrics of the deployed container instance at different time periods (which can be determined based on historical data), and / or, the peak performance metrics for the deployed container instance corresponding to the business. The peak performance metrics for the deployed container instance can be determined based on the performance metrics of the deployed container instance at different time periods. For example, it could be by obtaining business data of the deployed container instance at different time periods, and determining the peak performance metrics for the deployed container instance based on the performance metrics and business data of the deployed container instance at different time periods.
[0035] Specifically, after receiving a container deployment instruction, the method for obtaining the first performance indicators of at least two types of container products under a stress test environment and the second performance indicators of each container instance deployed on a host in the first host set can be as follows: After receiving a container deployment instruction, obtain the identification information of the container product to be deployed carried in the container deployment instruction; determine the first performance indicator of the container product to be deployed under a stress test environment based on the identification information of the container product to be deployed; obtain the type information of the container product corresponding to each container instance deployed on a host; determine the first performance indicator of the container product corresponding to each container instance deployed on a host under a stress test environment based on the type information of the container product corresponding to each container instance deployed on a host; and obtain the second performance indicators of each container instance deployed on a host at different time periods.
[0036] S120, the first host set is filtered based on the second performance index of the container instances deployed on each host in the first host set and the first performance index of at least two types of container products under stress testing environment to obtain the second host set.
[0037] Specifically, the method for filtering the first host set to obtain the second host set based on the second performance metric of the container instances deployed on each host in the first host set and the first performance metric of at least two types of container products under stress testing conditions can be as follows: obtaining the performance metrics of the container instances deployed on each host in the first host set at different time periods; determining the average value of the performance metrics of the container instances deployed on each host in the first host set at different time periods as the second performance metric; determining the average performance degradation ratio of the container instances deployed on each host in the first host set based on the second performance metric and the first performance metric of at least two types of container products under stress testing conditions; and deleting hosts in the first host set whose average performance degradation ratio is greater than or equal to the ratio threshold to obtain the second host set. The method of filtering the first host set to obtain the second host set based on the second performance index of the container instances deployed on each host in the first host set and the first performance index of at least two types of container products under stress testing environment can also be as follows: obtain the performance index of the container instances deployed on each host in the first host set during peak business hours, and determine the performance index of the deployed container instances during peak business hours as the second performance index; determine the average performance degradation ratio of the container instances deployed on each host in the first host set based on the second performance index and the first performance index of at least two types of container products under stress testing environment; delete the hosts in the first host set whose average performance degradation ratio is greater than or equal to the ratio threshold to obtain the second host set.
[0038] S130, the second set of host machines is filtered to obtain the target host machine, and a container instance is deployed on the target host machine.
[0039] Specifically, the method for filtering the second set of host machines to obtain target host machines and deploying container instances on the target host machines can be as follows: obtaining at least one of the following: the service specifications of the container to be deployed carried in the container deployment instruction, the hardware resource information of each host machine in the second set of host machines, and the resource usage distribution level of each host machine in the second set of host machines; filtering the second set of host machines according to at least one of the following: the service specifications of the container to be deployed, the hardware resource information of each host machine in the second set of host machines, and the resource usage distribution level of each host machine in the second set of host machines, to obtain target host machines, and deploying container instances on the target host machines.
[0040] Optionally, the first host set is filtered based on the second performance metric of the container instances deployed on each host in the first host set and the first performance metric of at least two types of container products under stress testing conditions to obtain a second host set, including:
[0041] The average performance degradation ratio of each container instance deployed on each host in the first host set is determined based on the second performance metric of each host in the first host set and the first performance metric of at least two types of container products under stress testing.
[0042] Remove hosts from the first host set whose average performance degradation ratio is greater than or equal to the ratio threshold to obtain the second host set.
[0043] The second performance metric for each container instance deployed on each host in the first host set can be the average performance metric of each container instance deployed on each host in the first host set over different time periods. Correspondingly, the second performance metric can be obtained by acquiring the performance metrics of each container instance deployed on each host in the first host set over different time periods, and determining the average performance metric of each container instance deployed on each host in the first host set over different time periods as the second performance metric.
[0044] The second performance metric for each container instance deployed on each host in the first host set can also be: the performance metric for each container instance deployed on each host in the first host set during peak business periods. Correspondingly, the second performance metric can be obtained by: pre-obtaining the performance metric and business volume of each container instance deployed on each host in the first host set at different time periods; obtaining the performance metric corresponding to the time period with the highest number of business periods, and determining the performance metric corresponding to the time period with the highest number of business periods as the second performance metric.
[0045] Specifically, the method for determining the average performance degradation ratio of each container instance deployed on each host in the first host set based on the second performance metric of each host in the first host set and the first performance metric of at least two types of container products under a stress test environment can be as follows: determine the third performance metric of each container instance deployed on each host in the first host set under a stress test environment based on the first performance metric of at least two types of container products under a stress test environment; determine the first ratio corresponding to each host in the first host set based on the second performance metric of each host in the first host set and the third performance metric of each host in the first host set under a stress test environment; and determine the average performance degradation ratio of each container instance deployed on each host in the first host set based on the first ratio corresponding to each host in the first host set.
[0046] Optionally, the average performance degradation ratio of each container instance deployed on each host in the first host set is determined based on a second performance metric of the container instances deployed on each host in the first host set and a first performance metric of at least two types of container products under a stress test environment, including:
[0047] A third performance metric is determined for each deployed container instance in the first host set under a stress test environment based on a first performance metric for at least two types of container products under a stress test environment.
[0048] The first ratio for each host in the first host set is determined based on the second performance metric of the container instances deployed on each host in the first host set and the third performance metric of the container instances deployed on each host in the stress test environment.
[0049] The average performance degradation ratio of the container instances deployed on each host in the first host set is determined based on the first ratio corresponding to each host in the first host set.
[0050] The first performance indicators of the at least two types of container products under stress testing can include: the first performance indicators of the container to be deployed and the performance indicators of the already deployed containers. The first performance indicators of the at least two types of container products under stress testing can include: the first performance indicators of all currently existing types of container products under stress testing. The first performance indicators of the at least two types of container products under stress testing can include: the first performance indicators of all types of container products that the enterprise project needs to deploy under stress testing.
[0051] Specifically, determining the third performance indicator of each deployed container instance on the first host machine set under stress testing based on the first performance indicators of at least two types of container products under stress testing can be achieved by: filtering the performance indicators of deployed containers from the first performance indicators of at least two types of container products under stress testing. Alternatively, determining the third performance indicator of each deployed container instance on the first host machine set under stress testing can be achieved by: obtaining the service specification corresponding to the deployed container instance, querying the first performance indicators of at least two types of container products under stress testing based on the service specification, and obtaining the performance indicator of the service specification corresponding to the deployed container instance under stress testing, which is the third performance indicator.
[0052] Specifically, the method for determining the first ratio for each host in the first host set based on the second performance metric of each container instance deployed on each host in the first host set and the third performance metric of each container instance deployed on each host under a stress test environment can be as follows: determine the ratio for each container instance based on the ratio of the second performance metric of each container instance to the third performance metric of each container instance under a stress test environment, and determine the first ratio for each host based on the average of the ratios for the container instances deployed on each host. Alternatively, the method for determining the first ratio for each host in the first host set based on the second performance metric of each container instance deployed on each host in the first host set and the third performance metric of each container instance deployed on each host under a stress test environment can be as follows: determine the performance metric for the most recent busy time period based on the performance metric of each container instance deployed on each host in the first host set at different time periods, and determine the performance metric for the most recent busy time period as the second performance metric, and determine the ratio of the second performance metric to the third performance metric for the same container instance as the first ratio. For example, if the first host set includes: host R and host T, host R has deployed container instance S and container instance Y, and host T has deployed container instance O, obtain the performance metrics of container instance S, container instance Y, and container instance O at different time periods, determine the performance metrics of container instance S at peak business conditions based on the performance metrics of container instance S at different time periods, determine the performance metrics of container instance Y at peak business conditions based on the performance metrics of container instance Y at different time periods, and determine the performance metrics of container instance O at peak business conditions based on the performance metrics of container instance O at different time periods. Since container instance S corresponds to service specification a, container instance Y corresponds to service specification b, and container instance O corresponds to service specification c, the performance metrics of service specifications a, b, and c under the stress test environment are obtained. The ratio of the performance metric of container instance S at the business peak to the performance metric of service specification a under the stress test environment is determined as the ratio corresponding to container instance S. The ratio of the performance metric of container instance Y at the business peak to the performance metric of service specification b under the stress test environment is determined as the ratio corresponding to container instance Y. The average of the ratios corresponding to container instance S and container instance Y is determined as the first ratio corresponding to host machine R. The ratio of the performance metric of container instance O at the business peak to the performance metric of service specification c under the stress test environment is determined as the first ratio corresponding to host machine T.
[0053] Optionally, the average performance degradation ratio of the container instances deployed on each host in the first host set is determined based on a first ratio corresponding to each host in the first host set, including:
[0054] The average performance degradation ratio of each deployed container instance on each host in the first host set is determined based on the following formula:
[0055]
[0056] Where P is the average performance degradation ratio of the container instances deployed on the host machine, n is the number of container instances deployed on the host machine, x / z is the first ratio corresponding to the host machine, x is the third performance indicator of the container instances deployed on the host machine under the stress test environment, and z is the second performance indicator of the container instances deployed on the host machine.
[0057] Optionally, the second set of host machines is filtered to obtain target host machines, and container instances are deployed on the target host machines, including:
[0058] Obtain at least one of the following: resource requirements of the container to be deployed, hardware resource information of each host in the second host set, and resource usage distribution level of each host in the second host set;
[0059] The second host set is filtered based on at least one of the following: the resource requirements of the container to be deployed, the hardware resource information of each host in the second host set, and the resource usage distribution level of each host in the second host set, to obtain the target host, and the container instance is deployed on the target host.
[0060] The hardware resource information of each host in the second host set can be the hardware specifications of each host, and the service specifications of the container to be deployed can include: CPU, memory and disk information.
[0061] The resource requirements of the container to be deployed include the CPU space, memory space, and disk space required for deployment.
[0062] Specifically, the method for obtaining at least one of the following: the resource requirement information of the container to be deployed, the hardware resource information of each host in the second host set, and the resource usage distribution level of each host in the second host set, can be: obtaining at least one of the following: the resource requirement information of the container to be deployed carried by the container deployment instruction, the hardware resource information of each host in the second host set, and the resource usage distribution level of each host in the second host set.
[0063] Specifically, the second host set is filtered based on at least one of the following: the resource requirements of the container to be deployed, the hardware resource information of each host in the second host set, and the resource usage distribution level of each host in the second host set, to obtain target hosts. The method for deploying container instances on the target hosts can be as follows: At least one of the following three elements is input into the target model: the resource requirements of the container to be deployed, the hardware resource information of each host in the second host set, and the resource usage distribution level of each host in the second host set. A score is obtained for each host in the second host set, and the host with the highest score is determined as the target host. This method ensures resource balance on the host machines at each time period and prevents the performance of containers from affecting each other.
[0064] Optionally, the second host set is filtered based on at least one of the resource requirement information of the container to be deployed, the hardware resource information of each host in the second host set, and the resource usage distribution level of each host in the second host set to obtain target hosts, and container instances are deployed on the target hosts, including:
[0065] The target remaining resources of each host in the second host set are determined based on the resource requirement information of the container to be deployed and the hardware resource information of each host in the second host set.
[0066] The target time matching degree of each host in the second host set is determined based on the resource usage distribution level of each host in the second host set and the resource requirement information of the container to be deployed;
[0067] Each host's score is determined based on its remaining target resources and target time matching degree.
[0068] The second set of host machines is filtered based on the score of each host machine to obtain the target host machine, and a container instance is deployed on the target host machine.
[0069] The method for determining the target remaining resources of each host in the second host set based on the resource requirement information of the container to be deployed and the hardware resource information of each host in the second host set can be as follows: determine the available resources of each host in the second host set based on the hardware resource information of each host in the second host set; determine the resource usage of the container to be deployed based on the resource requirement information of the container to be deployed; and determine the target remaining resources of each host based on the difference between the available resources of each host and the resource usage of the container to be deployed.
[0070] Specifically, the method of filtering the second set of host machines based on the score of each host machine to obtain the target host machine and deploying container instances on the target host machine can be as follows: the host machine with the highest score in the second set of host machines is determined as the target host machine, and the container instance is deployed on the target host machine.
[0071] Optionally, a score for each host machine is determined based on the target remaining resources and target time matching degree, including:
[0072] The score for each host in the second host set is determined based on the following formula:
[0073] S i =M1*R + M2*F;
[0074] Among them, S i Let R be the score of host i, M1 be the first weight, M2 be the second weight, R be the target remaining resources of host i, and F be the target time matching degree of host i.
[0075] Where R = R1 - R2, R1 is the amount of available resources on host machine i, and R2 is the amount of resources used by the container to be deployed.
[0076] Optionally, the target remaining resources of each host in the second host set are determined based on the resource requirement information of the container to be deployed and the hardware resource information of each host in the second host set, including:
[0077] The available resources of each host in the second host set are determined based on the hardware resource information of each host in the second host set;
[0078] Determine the resource usage of the containers to be deployed based on their resource requirements.
[0079] The target remaining resources for each host are determined based on the difference between the available resources of each host and the resource usage of the containers to be deployed.
[0080] For example, it could be a second host set Max = {S0, S1, S2, ..., Si}. The calculation formula based on the host set is: Si = M1*(R1-R2) + M2*F, where S... i Let R1 be the score of host i, M1 be the first weight, M2 be the second weight, R1 be the available resources of host i, R2 be the resource usage of the container to be deployed, and F be the target time matching degree of host i.
[0081] This invention employs pre-recorded hardware resource configurations for different service specifications of container products and their optimal performance during stress tests as benchmarks. It continuously records host machine hardware resource usage and historical instance performance at different times during business operation. An improved BFD (Best Fit Descending) algorithm is used for filtering to obtain target hosts. Simultaneously, the peak performance indicators of deployed container instances and the host machine resource balance rate at different time periods are used as relaxation factors. This considers the time-dependent resource consumption of multiple product services at the start of scheduling, thereby improving resource utilization. The improved BFD algorithm determines the score of each host in the second host set based on the following formula: Host Score = First Weight * Target Remaining Resources + Second Weight * Target Time Matching Degree. The first and second weights can be pre-set weights, which can be the same or different. The first and second weights can also be adjusted based on the host machine's resource usage after deploying container instances. The remaining resources of each host after deploying container instances, i.e., the target remaining resources, are determined based on the resource requirements of the containers to be deployed and the hardware resource information of each host in the second host set. The target time matching degree is determined based on the business time of the deployed container instances and the resource usage distribution level of each host in the second host set. It should be noted that determining the host score based on the target time matching degree is to ensure that the deployed containers are distributed across different time periods.
[0082] In a specific example, such as Figure 2 As shown, the hardware resources required for different service specifications of container products, and the performance under stress tests of different service specifications are registered as basic information; the performance indicators of deployed container instances at different time periods and the resource consumption level of the host machines of deployed container instances are recorded; it is determined whether the performance drop ratio of all instances on the host machine compared to the stress test exceeds a preset threshold. If it does, the host machine is directly filtered out in the predicate phase and does not participate in the Kubernetes priority scheduling; otherwise, execution continues. In the priority scheduling phase, an improved BFD algorithm is used to select the optimal host machine, that is, the target host machine, and the container instances are deployed on the target host machine.
[0083] In another specific example, the service specifications (CPU / memory) of various container products, along with their performance metrics under stress testing, are first registered as baseline values. Performance metrics corresponding to peak service loads of all container instances running on the existing cluster are collected, along with the distribution of host machine resource usage (resource utilization and remaining resources for each host machine at different times for CPU / memory / disk). Before scheduling, it is determined whether the average performance degradation rate of deployed container instances in the existing Kubernetes cluster is less than a predetermined threshold (which can be 20%). If it is less than 20%, the host machine is directly filtered out. The next instance deployment score is estimated based on the improved BFD algorithm to select the target host machine. It should be noted that while the existing BFD bin packing algorithm can meet the CPU / memory / disk resource requirements of the Pod to be scheduled and schedule the Pod to the Node with the most resources, in most cases, the best utilization of Node resources is not the optimal solution. There are often differences in resource runtime, which leads to uneven resource utilization. When selecting the most suitable host, the peak business time period of the Pod in the historical running records is added as a judgment condition to the original BFD scheduling algorithm to determine which host to select. It is not just about selecting the most efficient host (allowing for a certain range of deviation), but about selecting a suboptimal host that balances the spatial and temporal deviations. That is, the percentage of working time / non-working time of each host gradually increases synchronously, and the resource utilization of each machine is as similar as possible, with fluctuations of less than 20%.
[0084] The technical solution of this embodiment, after receiving a container deployment instruction, obtains the first performance indicators of at least two types of container products under a stress test environment and the second performance indicators of container instances deployed on each host in a first host set; filters the first host set according to the second performance indicators of container instances deployed on each host in the first host set and the first performance indicators of at least two types of container products under a stress test environment to obtain a second host set; filters the second host set to obtain a target host, and deploys container instances on the target host. Through the technical solution of this invention, resource utilization can be improved.
[0085] Example 2
[0086] Figure 3 This is a schematic diagram of a container deployment device provided in an embodiment of the present invention. This embodiment is applicable to container deployment scenarios. The device can be implemented using software and / or hardware, and can be integrated into any device that provides container deployment functionality, such as… Figure 3 As shown, the container deployment device specifically includes: an acquisition module 210, a filtering module 220, and a deployment module 230.
[0087] The acquisition module is used to acquire, after receiving the container deployment instruction, the first performance indicators of at least two types of container products under the stress test environment and the second performance indicators of container instances deployed on each host in the first host set.
[0088] The filtering module is used to filter the first host set based on the second performance index of the container instances deployed on each host in the first host set and the first performance index of at least two types of container products under stress testing environment, so as to obtain the second host set.
[0089] The deployment module is used to filter the second set of host machines to obtain target host machines, and deploy container instances on the target host machines.
[0090] The above-described products can perform the methods provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects for performing the methods.
[0091] The technical solution of this embodiment, after receiving a container deployment instruction, obtains the first performance indicators of at least two types of container products under a stress test environment and the second performance indicators of container instances deployed on each host in a first host set; filters the first host set according to the second performance indicators of container instances deployed on each host in the first host set and the first performance indicators of at least two types of container products under a stress test environment to obtain a second host set; filters the second host set to obtain a target host, and deploys container instances on the target host. Through the technical solution of this invention, resource utilization can be improved.
[0092] Example 3
[0093] Figure 4 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0094] like Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0095] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0096] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as container deployment methods.
[0097] In some embodiments, the container deployment method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the container deployment method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the container deployment method by any other suitable means (e.g., by means of firmware).
[0098] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0099] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0100] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0102] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0103] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0104] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0105] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A container deployment method, characterized in that, include: After receiving the container deployment instruction, obtain the first performance index of at least two types of container products under the stress test environment and the second performance index of container instances deployed on each host in the first host set. The second performance index of container instances deployed on each host in the first host set is the average of the performance index of container instances deployed on each host in the first host set at different time periods. The first host set is filtered based on the second performance index of the container instances deployed on each host in the first host set and the first performance index of at least two types of container products under stress testing environment to obtain the second host set. The second set of host machines is filtered to obtain target host machines, and container instances are deployed on the target host machines; The step of filtering the first host set based on the second performance metric of the container instances deployed on each host in the first host set and the first performance metric of at least two types of container products under stress testing to obtain the second host set includes: A third performance metric is determined for each deployed container instance in the first host set under a stress test environment based on a first performance metric for at least two types of container products under a stress test environment. The first ratio for each host in the first host set is determined based on the second performance metric of the container instances deployed on each host in the first host set and the third performance metric of the container instances deployed on each host in the stress test environment. The average performance degradation ratio of the container instances deployed on each host in the first host set is determined based on the first ratio corresponding to each host in the first host set; Remove hosts from the first host set whose average performance degradation ratio is greater than or equal to the ratio threshold to obtain the second host set.
2. The method according to claim 1, characterized in that, The average performance degradation ratio of deployed container instances on each host in the first host set is determined based on the first ratio corresponding to each host in the first host set, including: The average performance degradation ratio of each deployed container instance on each host in the first host set is determined based on the following formula: in, This represents the average performance degradation ratio of container instances already deployed on the host machine. This represents the number of container instances already deployed on the host machine. This is the first ratio corresponding to the host machine. This is the third performance metric for container instances already deployed on the host machine under stress testing conditions. This is the second performance metric for container instances already deployed on the host machine.
3. The method according to claim 1, characterized in that, The second set of host machines is filtered to obtain target host machines, and container instances are deployed on the target host machines, including: Obtain at least one of the following: resource requirements of the container to be deployed, hardware resource information of each host in the second host set, and resource usage distribution level of each host in the second host set; The second host set is filtered based on at least one of the following: the resource requirements of the container to be deployed, the hardware resource information of each host in the second host set, and the resource usage distribution level of each host in the second host set, to obtain the target host, and the container instance is deployed on the target host.
4. The method according to claim 3, characterized in that, The second host set is filtered based on at least one of the following: the resource requirements of the container to be deployed, the hardware resource information of each host in the second host set, and the resource usage distribution level of each host in the second host set, to obtain target host sets. Container instances are then deployed on the target host sets, including: The target remaining resources of each host in the second host set are determined based on the resource requirement information of the container to be deployed and the hardware resource information of each host in the second host set. The target time matching degree of each host in the second host set is determined based on the resource usage distribution level of each host in the second host set and the resource requirement information of the container to be deployed; Each host's score is determined based on its remaining target resources and target time matching degree. The second set of host machines is filtered based on the score of each host machine to obtain the target host machine, and a container instance is deployed on the target host machine.
5. The method according to claim 4, characterized in that, Each host's score is determined based on its target remaining resources and target time matching degree, including: The score for each host in the second host set is determined based on the following formula: S i =M1*R+M2*F; Among them, S i Let R be the score of host i, M1 be the first weight, M2 be the second weight, R be the target remaining resources of host i, and F be the target time matching degree of host i.
6. A container deployment device, characterized in that, include: The acquisition module is used to acquire, after receiving the container deployment instruction, the first performance index of at least two types of container products under the stress test environment and the second performance index of the container instances deployed on each host in the first host set. The second performance index of the container instances deployed on each host in the first host set is the average of the performance index of the container instances deployed on each host in the first host set at different time periods. The filtering module is used to filter the first host set based on the second performance index of the container instances deployed on each host in the first host set and the first performance index of at least two types of container products under stress testing environment, so as to obtain the second host set. The deployment module is used to filter the second set of host machines to obtain target host machines, and deploy container instances on the target host machines; Specifically, the filtering module is used for: A third performance metric is determined for each deployed container instance in the first host set under a stress test environment based on a first performance metric for at least two types of container products under a stress test environment. The first ratio for each host in the first host set is determined based on the second performance metric of the container instances deployed on each host in the first host set and the third performance metric of the container instances deployed on each host in the stress test environment. The average performance degradation ratio of the container instances deployed on each host in the first host set is determined based on the first ratio corresponding to each host in the first host set; Remove hosts from the first host set whose average performance degradation ratio is greater than or equal to the ratio threshold to obtain the second host set.
7. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the container deployment method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the container deployment method of any one of claims 1-5.
Citation Information
Patent Citations
Container scheduling method and device and electronic equipment
CN113553180A