Resource scheduling method for container cloud
By determining alternative hosts based on resource configuration information in the container cloud and applying for resources in real time, the problem of inefficient resource scheduling caused by frequent resource conflicts is solved, and more efficient resource scheduling is achieved.
Patent Information
- Application Number
- CN202510017209.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-05-02
AI Technical Summary
When multiple services or users share the same resource, resource conflicts occur more frequently, resulting in a reduced resource scheduling efficiency.
By obtaining the target scheduling tasks in the scheduling request queue, based on the resource configuration information of the host in the container cloud resource pool, the alternative host corresponding to the target scheduling task is determined, and resources are applied to the alternative host in real time, the target host is determined based on the application results, and the target scheduling task is finally executed through the target host.
This method can flexibly respond to changes in resource requirements, reduce the frequency of resource conflicts, and thus improve the efficiency of resource scheduling.
Smart Images

Figure CN119917219A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of cloud computing resource scheduling, and in particular to a resource scheduling method for a container cloud. Background Art
[0002] With the emergence of new services and the continuous changes in services, the resource requirements of data centers are also constantly changing. For example, the business traffic of mobile phone business halls and business hall systems has daily peaks and valleys, and peaks and valleys at the beginning and end of the month. During peak business traffic periods, data centers need to be able to quickly allocate sufficient resources to handle high loads and ensure service stability and responsiveness; during low business traffic periods, idle resources need to be recovered and allocated to other services or systems to improve resource utilization and overall efficiency.
[0003] When faced with high concurrency and burst traffic, data centers usually use open source scheduling frameworks (such as Marathon on Mesos, K8s, etc.) to achieve flexible resource management. At present, although shared scheduling of multiple frameworks can be achieved, when multiple businesses or users share the same resources, resource conflicts (such as simultaneous contention for CPU, memory, etc.) occur frequently, and frequent conflicts reduce the efficiency of resource scheduling. Summary of the invention
[0004] An embodiment of the present application provides a resource scheduling method for a container cloud, so as to at least solve the problem of high frequency of resource scheduling conflicts in related technologies.
[0005] In order to solve the above technical problems, this application is implemented as follows: In a first aspect, an embodiment of the present application provides a resource scheduling method for a container cloud, comprising: obtaining a target scheduling task in a scheduling request queue; determining at least one alternative host machine corresponding to the target scheduling task based on resource configuration information of the host machine in a container cloud resource pool; applying for resources from the at least one alternative host machine, and determining a target host machine based on the resource application result returned by the at least one alternative host machine; and executing the target scheduling task through the target host machine.
[0006] In the second aspect, an embodiment of the present application provides a resource scheduling device for a container cloud, comprising: a task acquisition module, used to obtain a target scheduling task in a scheduling request queue; a host determination module, used to determine at least one alternative host machine corresponding to the target scheduling task based on resource configuration information of the host machine in a container cloud resource pool; a resource application module, used to apply for resources from the at least one alternative host machine, and determine the target host machine based on the resource application result returned by the at least one alternative host machine; and a task execution module, used to execute the target scheduling task through the target host machine.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect above are implemented.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of the method described in the first aspect above.
[0010] In an embodiment of the present application, a target scheduling task in a scheduling request queue is obtained; based on the resource configuration information of the host in the container cloud resource pool, at least one candidate host corresponding to the target scheduling task is determined; resources are applied to at least one candidate host, and the target host is determined according to the resource application result returned by at least one candidate host; and the target scheduling task is executed through the target host. In this way, the candidate host of the target scheduling task is determined according to the resource configuration information, and resources are applied to the candidate host in real time and the resource application result is obtained, which can flexibly respond to changes in resource demand, reduce the frequency of resource conflicts, and thus improve the efficiency of resource scheduling.
[0011] 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
[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0013] Figure 1 A schematic diagram of the structure of the scheduling system is shown; Figure 2 A schematic diagram of a process flow of a resource scheduling method for a container cloud provided in an embodiment of the present application is shown; Figure 3 An example diagram of a scheduling system provided by an embodiment of the present application is shown; Figure 4 An example diagram showing a method for adjusting resource configuration information provided by an embodiment of the present application is shown; Figure 5A schematic diagram of a process for pre-screening a candidate host provided by an embodiment of the present application is shown; Figure 6 A schematic diagram of a process for determining a candidate host provided by an embodiment of the present application is shown; Figure 7 A framework hierarchy diagram of the scheduling calculation provided by an embodiment of the present application is shown; Figure 8 A schematic diagram of the structure of a resource scheduling device for a container cloud provided in an embodiment of the present application is shown; Fig. 9 A schematic diagram of the architecture hierarchy of the scheduling system provided in an embodiment of the present application is shown; Fig.10 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0014] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0015] With the emergence of new services and the continuous changes in services, the resource requirements of data centers are also changing. Some business promotions lead to applications facing high concurrency, burst traffic or high traffic, which is basically not feasible if the traditional resource allocation method in data centers is used. In the case of high concurrency, burst traffic or high traffic, the data center cannot accurately respond to the service resource requirements, resulting in unstable operation of the service.
[0016] In order to solve the above problems, the common practice in the industry is to use open source scheduling frameworks (Marathon on Mesos, K8s, etc.) to achieve rapid expansion of business instances, which can meet the needs of easy vertical and horizontal expansion of business instances. Before business pressure comes, without operating the underlying resources, by quickly starting instances to deal with business, business continuity can be guaranteed. Figure 1As shown in , a Master-Slave architecture can be adopted, where the Slave node represents the node that executes the task. In order to ensure the normal operation of the business, the data center administrator 110 will try to expand the configuration of the application, that is, the configuration parameters of the business instance, such as CPU and memory parameters, and allocate sufficient resources to it so that it can cope with sufficiently large business traffic. At the same time, when there is an activity, the business instance resources in the container cloud resource pool 130 can be quickly expanded through some scheduling frameworks 120 or platforms to avoid business pressure and business discontinuity problems caused by the inability to quickly expand applications during peak hours.
[0017] Although Mesos or K8s can be used to schedule CPU and memory resources in the data center to ensure the robustness of the business. However, in most cases, the analysis of the business operation status and resource requirements is not accurate enough. At the same time, some existing open source components have some pessimistic locking mechanisms. For example, when Mesos makes resource offers to multiple frameworks, the resource offers will only be assigned to one framework at a time, which creates a pessimistic mechanism in which resources are monopolized by a single framework unless the framework actively reports a timeout or releases resources. At the same time, when some existing technical frameworks are shared, the probability of conflicts increases due to frequent scheduling, which affects the performance of the overall scheduling. The following situations will cause the business operation of the data center to fail: 1) The increase in upper-level application frameworks will increase the load on the underlying resource scheduling framework, while the processing efficiency will decrease and the resource demand response will slow down; this will cause the business to respond slowly and affect customer perception. 2) When elastic scaling is frequent, resources are constantly sent and recovered, causing instability and discontinuity of the business. When the above problems occur, the data center can only perform maintenance in advance or in the future, and allocate enough resources to the application in advance, which greatly reduces the resource utilization of the data center, and then allocates resources to the overloaded business afterwards. When the business comes, the business system will be down and need to be restarted, which is unacceptable for the core system.
[0018] At present, although shared scheduling of multiple frameworks can be achieved, when multiple services or users share the same resources, resource conflicts (such as simultaneous competition for CPU, memory, etc.) occur frequently, and frequent conflicts lead to reduced efficiency of resource scheduling.
[0019] In response to the problems existing in the above-mentioned resource scheduling process, an embodiment of the present application provides a resource scheduling method for a container cloud, which determines an alternative host machine for a target scheduling task based on resource configuration information, applies for resources from the alternative host machine in real time and obtains resource application results. It can flexibly respond to changes in resource demand, reduce the frequency of resource conflicts, and thus improve the efficiency of resource scheduling.
[0020] Figure 2A flow chart of a resource scheduling method for a container cloud provided in an embodiment of the present application is shown. The execution subject of the method may be a terminal device or a server, wherein the terminal device may be a device such as a personal computer, an edge computing device, a virtual machine, or a mobile terminal device such as a mobile phone or a tablet computer, and the terminal device may be a terminal device used by a user. The server may be an independent server or a server cluster composed of multiple servers, and the server may be a background server for a certain business or a background server for a certain platform or application (for example, a cloud computing platform, a container orchestration platform, a virtualization platform, a scheduling system, etc.). In the embodiment of the present application, the execution subject is taken as an example of a scheduling system. As shown in the figure, the method 200 may include the following steps: Step 201: Obtain the target scheduling task in the scheduling request queue.
[0021] In a specific implementation, scheduling tasks are received from different services or applications, such as Figure 3 As shown, the identification ID of the scheduling task is put into the scheduling request queue 310, and the scheduling system obtains the target scheduling task from the scheduling request queue according to the identification ID, for example, scheduling task 1 and scheduling task 2, and schedules scheduling task 1 and scheduling task 2 to the appropriate host machine 320 for execution.
[0022] Step 202: Based on the resource configuration information of the host machines in the container cloud resource pool, determine at least one candidate host machine corresponding to the target scheduling task.
[0023] The resource configuration information includes host load, central processing unit (CPU) resources, memory resources, storage resources, etc.
[0024] In a specific implementation, the scheduling system can monitor the resource configuration information of all current host machines, such as CPU, memory, storage, etc., through the container cloud platform, and select at least one alternative host machine suitable for executing the target scheduling task according to the requirements of the target scheduling task.
[0025] Step 203: Apply for resources from the at least one candidate host machine, and determine a target host machine according to the resource application result returned by the at least one candidate host machine.
[0026] In a specific implementation, after applying for resources from at least one candidate host, each candidate host in the container cloud resource pool has a corresponding host executor, and the host executor responds according to the current resource status of the candidate host, such as whether there is enough CPU, memory, queue length, etc. If the resources of one of the at least one candidate host meet the requirements, the candidate host is determined to be the target host.
[0027] Step 204: Execute the target scheduling task through the target host machine.
[0028] In a specific implementation, the scheduling system executes the target scheduling task on the target host, for example, starting a container to run the target scheduling task.
[0029] In this way, the alternative host machine for the target scheduling task is determined according to the resource configuration information, and resources are applied for and the resource application results are obtained from the alternative host machine in real time. This can flexibly respond to changes in resource demand, reduce the frequency of resource conflicts, and thus improve the efficiency of resource scheduling.
[0030] In a possible implementation, in the above step 203, applying for resources from the at least one candidate host machine, and determining the target host machine according to the resource application result returned by the at least one candidate host machine, includes: Applying for resources from a first candidate host machine among the at least one candidate host machine; Obtaining a resource application result returned by the first candidate host machine according to the message queue length; In a case where it is determined according to the resource application result that resource scheduling of the first candidate host machine is successful, determining the first candidate host machine as the target host machine; In the case where it is determined that the scheduling of the first alternative host machine has failed based on the resource application result, a second alternative host machine adjacent to the first alternative host machine is selected according to a preset host machine resource application order, and resources are applied for from the second alternative host machine, and this process is repeated until the resource scheduling is determined to be successful based on the resource application result returned by the second alternative host machine, and the second alternative host machine is determined to be the target host machine.
[0031] In the embodiment of the present application, the scheduling system applies for resources from the first candidate host machine among the at least one candidate host machine determined, and the first candidate host machine can be any one of the at least one candidate host machine. If two scheduling tasks simultaneously apply for the same resource on the first candidate host machine based on the shared resource status, the first candidate host machine corresponding to the host machine executor will inform the order of the messages in the message queue to process the resources on a first-come-first-served basis, and the resource scheduling is successful at this time; when the length of the message queue exceeds the upper limit, the host machine executor will actively inform the scheduling task that the queue is full, and the resource scheduling fails at this time.
[0032] When resource scheduling is successful, the first candidate host machine is determined as the target host machine; when resource scheduling fails, the second candidate host machine adjacent to the first candidate host machine is selected according to the preset host machine resource application order, and resources are applied for from the second candidate host machine, and this process is repeated until the resource scheduling is determined to be successful according to the resource application result returned by the second candidate host machine, and the second candidate host machine is determined to be the target host machine.
[0033] After determining that the second candidate host machine is the target host machine, the method further includes: When it is determined that any one of the at least one candidate host machine fails to be scheduled, resource configuration information of the host machine in the container cloud resource pool is re-acquired, and the candidate host machine corresponding to the target scheduling task is determined based on the re-acquired resource configuration information.
[0034] In a possible implementation, in the above step 202, based on the resource configuration information of the host machine in the container cloud resource pool, determining at least one candidate host machine corresponding to the target scheduling task includes: Obtain resource configuration information of a host machine in a container cloud resource pool; adjust the resource configuration information according to instance running status information on the host machine to obtain adjusted resource configuration information; and determine at least one candidate host machine corresponding to the target scheduling task based on the adjusted resource configuration information.
[0035] In this way, in a mixed distribution situation, the scheduling system makes an estimate based on the instance running status information on the host machine, adjusts the instance resource configuration information in real time, and obtains the adjusted resource configuration information; based on the adjusted resource configuration information, at least one alternative host machine corresponding to the target scheduling task is determined, which can ensure that the scheduling system can flexibly respond to changes in resource demand and improve the stability of the scheduling system.
[0036] Among them, the target scheduling tasks include online tasks, offline tasks and batch tasks; The above-mentioned adjusting the resource configuration information according to the instance running status information on the host machine to obtain the adjusted resource configuration information includes: By monitoring the instance running on the host machine, the running status information of the instance is obtained; when it is determined according to the running status information that the online task is at a traffic peak, the resource quota of the batch processing task or the offline processing task on the host machine is adjusted to obtain the adjusted resource configuration information.
[0037] In an exemplary embodiment, if Figure 4As shown in the figure, the target scheduling tasks include online tasks, offline tasks and batch tasks; the host executor monitors the fluctuation of host resources. When the online task encounters a traffic peak or the host memory or CPU is in urgent need, the scheduling system adjusts the memory or CPU quota of the batch task or offline task on the host to ensure the stability of the online service.
[0038] In a possible implementation, in the above step 202, based on the resource configuration information of the host machine in the container cloud resource pool, determining at least one candidate host machine corresponding to the target scheduling task includes: According to a preset pre-screening strategy, the host machines in the container cloud resource pool are filtered to obtain a third candidate host machine; according to the host load and host performance indicators of the third candidate host machine, at least one candidate host machine corresponding to the target scheduling task is determined.
[0039] In an embodiment of the present application, the host machines in the container cloud resource pool can be filtered according to pre-screening strategies such as overselling strategy and dispersed deployment strategy to obtain a third candidate host machine; when the host load and host performance indicators of the third candidate host machine meet preset conditions, it is determined as the candidate host machine.
[0040] The above-mentioned filtering process of the host machines in the container cloud resource pool according to the preset pre-screening strategy to obtain the third candidate host machine includes: Overselling switches and overselling coefficients are set for various types of resources on the host machine; a host list of the container cloud resource pool is determined according to the resource requirements, overselling coefficients and distributed deployment strategies of the target scheduling tasks; and a host that meets preset conditions is selected from the host list as a third candidate host machine.
[0041] In the embodiment of the present application, an overselling mechanism can be used to ensure the stability of the system business by setting an overselling switch and an overselling coefficient. In production, the resource requirements of most applications can be divided into two types of resources, dynamic resources (CPU and IO, etc.) and static resources (memory and disk, etc.). Different overselling coefficients are set for different businesses, and a higher weight coefficient is set for the core system.
[0042] At the same time, in order to ensure the high availability of the business, the use of a decentralized deployment method ensures that the application is deployed across computer rooms, racks, and hosts, which can effectively improve the high availability of the application business. As the scale of the physical cluster increases, the frequency of host failures will also increase accordingly. If all instances of an online service are deployed on the same host, the same rack, etc., it is very likely that the entire service will be unavailable after the host goes down. When deploying applications, limit the number of instances under the same switch or rack to avoid service unavailability caused by network problems.
[0043] The host list is determined from the containers in the container cloud resource pool through the above-mentioned pre-screening strategy. If the host load and host performance indicators of the third candidate host in the host list meet the preset conditions, it is added to the deployable list to obtain at least one candidate host.
[0044] In an exemplary embodiment, if Figure 5 As shown, the above-mentioned pre-screening method comprises the following steps: Step 501: Select a scheduling strategy, which includes an overselling strategy and a dispersed deployment strategy; Step 502: Determine a host list from the containers in the container cloud resource pool; Step 503: Determine whether the host load and host performance index of the third candidate host in the host list meet the preset conditions. If the conditions are met, proceed to step 504; otherwise, proceed to step 505; Step 504: Add the third candidate host to the deployable list; Step 505: Determine whether the host list has been traversed. If it is determined that the host list has been traversed, end the process, otherwise return to step 502.
[0045] The above-mentioned determining at least one candidate host machine corresponding to the target scheduling task according to the host load and host performance index of the third candidate host machine includes: When the host load of the third candidate host machine is less than a preset load threshold, determining the third candidate host machine as a candidate host machine; When the host load of the third alternative host machine is greater than or equal to the preset load threshold, a performance evaluation is performed on the third alternative host machine according to the host performance indicator of the third alternative host machine to obtain a performance evaluation value; based on the performance evaluation value, at least one alternative host machine corresponding to the target scheduling task is determined, and the performance evaluation value is used to indicate the resource processing capability of the third alternative host machine.
[0046] In a specific implementation, when determining an alternative host machine, if the host load of the third alternative host machine is less than a preset load threshold, the third alternative host machine is determined as an alternative host machine, wherein the preset load threshold can be set according to actual needs. If the host load of the third alternative host machine is greater than or equal to the preset load threshold, the third alternative host machine is subjected to a performance evaluation based on the host performance indicators of the third alternative host machine, such as the CPU, memory, input and output IO, to obtain a performance evaluation value, for example, a weighted sum of multiple host performance indicators is performed to obtain a performance evaluation value; and then at least one alternative host machine is determined based on the performance evaluation value, for example, the third alternative host machine whose performance evaluation value exceeds the preset threshold is determined as an alternative host machine.
[0047] Among them, the host performance indicators include CPU performance indicators, memory performance indicators and input and output performance indicators; The above-mentioned performing performance evaluation on the fourth candidate host machine according to the host performance index of the fourth candidate host machine to obtain a performance evaluation value includes: The target weights corresponding to the CPU performance index, memory performance index and input / output performance index are determined through a geometric weight strategy; the CPU performance index, memory performance index, input / output performance index and their corresponding target weights are weighted and summed to obtain a performance evaluation value.
[0048] In an exemplary embodiment, multiple host performance indicators are comprehensively considered, such as host load, CPU, memory and other factors. The scheduling system obtains the system monitoring data of the host machine, including CPU, Memory, IO and other indicators. Hosts with lower loads will be given priority, and if the load is low, they will be directly added to the alternative list. Some hosts with higher loads have reduced performance and weaker processing capabilities, and the continuity of the service cannot be guaranteed. Secondly, the CPU, Memory, and IO factors are comprehensively considered. When calculating the score value, a proportional weight strategy is adopted.
[0049] ; in, Merics i Indicates the host performance indicators i Percentage of current time.
[0050] The step of determining at least one candidate host machine corresponding to the target scheduling task according to the performance evaluation value includes: The performance evaluation value is compared with a preset evaluation value threshold, and at least one candidate host machine corresponding to the target scheduling task is determined according to the comparison result.
[0051] In an exemplary embodiment, if Figure 6 As shown, the above method for determining an alternative host machine may include the following steps: Step 601: Get a deployable list; Step 602: Obtain the host load of each third candidate host in the deployable list; Step 603: Determine whether the host load is lower than a preset load threshold, if yes, proceed to step 604; otherwise, proceed to step 604; Step 604: Obtain the host CPU, host memory, and host IO of the third candidate host machine; Step 605: Perform performance evaluation on the third candidate host machine according to the host CPU, host memory, and host IO of the third candidate host machine to obtain a performance evaluation value; Step 606: Determine whether the performance evaluation value exceeds the threshold, if yes, proceed to step 607, otherwise proceed to step 608; Step 607: Determine whether the deployable list has been traversed. If yes, end the process; otherwise, return to step 601; Step 608: Add the third candidate host machine to the candidate list.
[0052] Figure 7 The framework hierarchy diagram of the scheduling calculation provided by the embodiment of the present application is shown. As shown in the figure, the above scheduling calculation method includes three aspects: online real-time scheduling, pre-screening and sorting. The bottom layer is a host cluster shared in the scheduling resource pool, supporting pool-level hard isolation, such as online services and database / cache instances deployed in different physical machine clusters; supporting resource soft isolation, such as mixed deployment of online services and offline tasks, isolation and weight setting through mechanisms such as cgroups. Among them: 1. Online real-time scheduling: In the case of mixed deployment, the scheduling system will make an estimate based on the running status information of the instance on the host and adjust the resource configuration information of the instance in real time. For example, when the online service encounters a traffic peak or the host memory or CPU is in urgent need, the real-time scheduling mechanism will adjust the memory or CPU quota of the batch or offline tasks on the host to ensure the stability of the online service.
[0053] 2. Pre-screening: The concept of pre-screening is to filter out some machines that do not meet the requirements in advance through overselling and dispersion restriction strategies. This can reduce the complexity of resource scheduling calculations and speed up scheduling.
[0054] 3. Sorting (Rank): Sorting is another screening for the previous pre-screening process. Through the host load and host performance indicators and their corresponding weights, a performance evaluation value is finally calculated. The candidate hosts are finally obtained by sorting according to the performance evaluation value.
[0055] Figure 8 The schematic diagram of the structure of the resource scheduling device of the container cloud provided in the embodiment of the present application is shown. The resource scheduling device of the container cloud can be implemented as follows: Figure 2 In the embodiment shown, all or part of the content, the resource scheduling device 800 includes: The task acquisition module 810 is used to acquire the target scheduling task in the scheduling request queue; A host determination module 820 is used to determine at least one candidate host corresponding to the target scheduling task based on resource configuration information of the host in the container cloud resource pool; A resource application module 830 is used to apply for resources from the at least one candidate host machine, and determine a target host machine according to the resource application result returned by the at least one candidate host machine; The task execution module 840 is used to execute the target scheduling task through the target host machine.
[0056] In a possible implementation, the resource application module 830, when used to apply for resources from the at least one candidate host machine and determine the target host machine according to the resource application result returned by the at least one candidate host machine, is specifically used to: Applying for resources from a first candidate host machine among the at least one candidate host machine; Obtaining a resource application result returned by the first candidate host machine according to the message queue length; In a case where it is determined according to the resource application result that resource scheduling of the first candidate host machine is successful, determining the first candidate host machine as the target host machine; In the case where it is determined that the scheduling of the first alternative host machine has failed based on the resource application result, a second alternative host machine adjacent to the first alternative host machine is selected according to a preset host machine resource application order, and resources are applied for from the second alternative host machine, and this process is repeated until the resource scheduling is determined to be successful based on the resource application result returned by the second alternative host machine, and the second alternative host machine is determined to be the target host machine.
[0057] In a possible implementation, the resource application module 830 is further configured to: When it is determined that any one of the at least one candidate host machine fails to be scheduled, resource configuration information of the host machine in the container cloud resource pool is re-acquired, and the candidate host machine corresponding to the target scheduling task is determined based on the re-acquired resource configuration information.
[0058] In a possible implementation, the host determination module 820, when used to determine at least one candidate host corresponding to the target scheduling task based on the resource configuration information of the host in the container cloud resource pool, is specifically used to: Get the resource configuration information of the host in the container cloud resource pool; According to the instance running status information on the host machine, the resource configuration information is adjusted to obtain adjusted resource configuration information; Based on the adjusted resource configuration information, at least one candidate host machine corresponding to the target scheduling task is determined.
[0059] In a possible implementation, the target scheduling tasks include online tasks, offline tasks, and batch tasks; The host determination module 820, when used to adjust the resource configuration information according to the instance running state information on the host machine to obtain the adjusted resource configuration information, is specifically used to: Obtaining running status information of the instance by monitoring the instance running on the host machine; When it is determined according to the running status information that the online task is at a traffic peak, the resource quota of the batch processing task or the offline processing task on the host machine is adjusted to obtain adjusted resource configuration information.
[0060] In a possible implementation, the host determination module 820, when used to determine at least one candidate host corresponding to the target scheduling task based on the resource configuration information of the host in the container cloud resource pool, is specifically used to: According to the preset pre-screening strategy, the host machines in the container cloud resource pool are filtered to obtain a third candidate host machine; At least one candidate host machine corresponding to the target scheduling task is determined according to the host load and the host performance index of the third candidate host machine.
[0061] In a possible implementation, the host determination module 820, when filtering the host machines in the container cloud resource pool according to a preset pre-screening strategy to obtain the third candidate host machine, is specifically configured to: Set overselling switches and overselling coefficients for various types of resources on the host; Determine a host list of the container cloud resource pool according to the resource requirements, overselling coefficient and decentralized deployment strategy of the target scheduling task; A host satisfying a preset condition is selected from the host list as the third candidate host machine.
[0062] In a possible implementation, the host determination module 820, when used to determine at least one candidate host machine corresponding to the target scheduling task according to the host load and the host performance index of the third candidate host machine, is specifically used to: When the host load of the third candidate host machine is less than a preset load threshold, determining the third candidate host machine as a candidate host machine; When the host load of the third alternative host machine is greater than or equal to the preset load threshold, a performance evaluation is performed on the third alternative host machine according to the host performance indicator of the third alternative host machine to obtain a performance evaluation value; based on the performance evaluation value, at least one alternative host machine corresponding to the target scheduling task is determined, and the performance evaluation value is used to indicate the resource processing capability of the third alternative host machine.
[0063] Among them, the host performance indicators include CPU performance indicators, memory performance indicators and input and output performance indicators; The host determination module 820, when used to perform performance evaluation on the fourth candidate host machine according to the host performance indicator of the fourth candidate host machine to obtain a performance evaluation value, is specifically used to: Determine the target weights corresponding to the CPU performance index, memory performance index and input / output performance index through a geometric weight strategy; The CPU performance index, memory performance index, input / output performance index and their corresponding target weights are weighted and summed to obtain a performance evaluation value.
[0064] In a possible implementation, the host determination module 820, when used to determine at least one candidate host machine corresponding to the target scheduling task according to the performance evaluation value, is specifically used to: The performance evaluation value is compared with a preset evaluation value threshold, and at least one candidate host machine corresponding to the target scheduling task is determined according to the comparison result.
[0065] In an exemplary embodiment, if Fig. 9 As shown, the scheduling system provided by the embodiment of the present application includes an application layer 910, a platform layer 920 and a resource layer 930; the application layer 910 includes a variety of scheduling tasks, such as online application services, offline jobs (big data jobs), scheduled tasks, etc.; the application layer 910 applies for container resources and configures elastic policies to the platform layer 920; the platform layer 920 includes container monitoring 921 and elastic scheduling 922, wherein the container monitoring 921 is used for the resource configuration information of the host machine in the container cloud resource pool; the elastic scheduling 922 is used to execute such as Figure 2 All or part of the content in the illustrated embodiment; the resource layer 930 includes multiple host machines.
[0066] The embodiment of the present application provides a resource scheduling device for a container cloud, including a task acquisition module, a host determination module, a resource application module and a task execution module; the task acquisition module acquires a target scheduling task in a scheduling request queue; the host determination module determines at least one candidate host corresponding to the target scheduling task based on the resource configuration information of the host in the container cloud resource pool; the resource application module applies for resources from the at least one candidate host, and determines the target host according to the resource application result returned by the at least one candidate host; the task execution module executes the target scheduling task through the target host. In this way, the candidate host of the target scheduling task is determined according to the resource configuration information, and resources are applied to the candidate host in real time and the resource application result is obtained, which can flexibly respond to changes in resource demand, reduce the frequency of resource conflicts, and thus improve the efficiency of resource scheduling.
[0067] Fig.10 The hardware structure diagram of the electronic device provided by the embodiment of the present application is shown. Referring to the figure, at the hardware level, the electronic device 1000 includes a processor 1010, and optionally, includes an internal bus 1020, a network interface 1030, and a memory 1040. Among them, the memory 1040 may include a memory 1041, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory 1042 (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device 1000 may also include hardware required for other services.
[0068] The processor 1010, the network interface 1030 and the memory may be connected to each other via an internal bus 1020, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0069] The memory 1040 stores programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions. The memory 1040 may include a memory 1041 and a non-volatile memory 1042 , and provide instructions and data to the processor 1010 .
[0070] The processor 1010 reads the corresponding computer program from the non-volatile memory 1042 into the memory and then runs it, forming a device for locating the target user at the logical level. The processor 1010 executes the program stored in the memory and specifically performs: Figure 2 or Figure 5 or Figure 6 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0071] The above application Figure 2 or Figure 5 or Figure 6The method disclosed in the illustrated embodiment can be applied to the processor 1010, or implemented by the processor 1010. The processor 1010 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1010. The above processor 1010 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0072] The computer device can also execute the methods described in the foregoing method embodiments, and realize the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be repeated here.
[0073] Of course, in addition to software implementation, the electronic device 700 of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0074] The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes Figure 2 or Figure 5 or Figure 6 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0075] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0076] Furthermore, an embodiment of the present application also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the following process is implemented: Figure 2 or Figure 5 or Figure 6 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0077] The embodiments of the present application can be applied to various electronic device collaboration or interconnection scenarios, including: collaboration and interconnection between mobile phones and laptops / tablet computers; collaboration and interconnection between mobile terminals and smart TVs / displays; collaboration and interconnection between mobile phones or tablet computers and in-car entertainment systems; collaboration and interconnection between mobile terminals and smart conference systems, etc., so as to meet the needs of users in various scenarios such as smart homes, smart offices, and smart travel.
[0078] In short, the above is only a preferred embodiment of the present application and does not limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0079] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0080] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0081] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0082] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A resource scheduling method for a container cloud, characterized in that: include: Get the target scheduling task in the scheduling request queue; Determine at least one candidate host machine corresponding to the target scheduling task based on resource configuration information of the host machine in the container cloud resource pool; Applying for resources from the at least one candidate host machine, and determining a target host machine according to a resource application result returned by the at least one candidate host machine; The target scheduling task is executed by the target host machine.
2. The method according to claim 1, characterized in that The applying for resources from the at least one candidate host machine, and determining a target host machine according to a resource application result returned by the at least one candidate host machine, comprises: Applying for resources from a first candidate host machine among the at least one candidate host machine; Obtaining a resource application result returned by the first candidate host machine according to the message queue length; In a case where it is determined according to the resource application result that resource scheduling of the first candidate host machine is successful, determining the first candidate host machine as the target host machine; In the case where it is determined that the scheduling of the first alternative host machine has failed based on the resource application result, a second alternative host machine adjacent to the first alternative host machine is selected according to a preset host machine resource application order, and resources are applied for from the second alternative host machine, and this process is repeated until the resource scheduling is determined to be successful based on the resource application result returned by the second alternative host machine, and the second alternative host machine is determined to be the target host machine.
3. The method according to claim 2, characterized in that After determining that the second candidate host machine is the target host machine, the method further includes: When it is determined that any one of the at least one candidate host machine fails to be scheduled, resource configuration information of the host machine in the container cloud resource pool is re-acquired, and the candidate host machine corresponding to the target scheduling task is determined based on the re-acquired resource configuration information.
4. The method according to claim 1, characterized in that: The determining, based on the resource configuration information of the host machine in the container cloud resource pool, at least one candidate host machine corresponding to the target scheduling task includes: Get the resource configuration information of the host in the container cloud resource pool; According to the instance running status information on the host machine, the resource configuration information is adjusted to obtain adjusted resource configuration information; Based on the adjusted resource configuration information, at least one candidate host machine corresponding to the target scheduling task is determined.
5. The method according to claim 4, characterized in that The target scheduling tasks include online tasks, offline tasks and batch tasks; The step of adjusting the resource configuration information according to the instance running status information on the host machine to obtain the adjusted resource configuration information includes: Obtaining running status information of the instance by monitoring the instance running on the host machine; When it is determined according to the running status information that the online task is at a traffic peak, the resource quota of the batch processing task or the offline processing task on the host machine is adjusted to obtain adjusted resource configuration information.
6. The method according to claim 1, characterized in that The determining, based on the resource configuration information of the host machine in the container cloud resource pool, at least one candidate host machine corresponding to the target scheduling task includes: According to the preset pre-screening strategy, the host machines in the container cloud resource pool are filtered to obtain a third candidate host machine; At least one candidate host machine corresponding to the target scheduling task is determined according to the host load and the host performance index of the third candidate host machine.
7. The method according to claim 6, characterized in that The filtering process of the host machines in the container cloud resource pool according to the preset pre-screening strategy to obtain the third candidate host machine includes: Set overselling switches and overselling coefficients for various types of resources on the host; Determine a host list of the container cloud resource pool according to the resource requirements, overselling coefficient and decentralized deployment strategy of the target scheduling task; A host satisfying a preset condition is selected from the host list as the third candidate host machine.
8. The method according to claim 6, characterized in that The determining, according to the host load and host performance index of the third candidate host machine, at least one candidate host machine corresponding to the target scheduling task comprises: When the host load of the third candidate host machine is less than a preset load threshold, determining the third candidate host machine as a candidate host machine; When the host load of the third alternative host machine is greater than or equal to the preset load threshold, a performance evaluation is performed on the third alternative host machine according to the host performance indicator of the third alternative host machine to obtain a performance evaluation value; based on the performance evaluation value, at least one alternative host machine corresponding to the target scheduling task is determined, and the performance evaluation value is used to indicate the resource processing capability of the third alternative host machine.
9. The method according to claim 8, characterized in that The host performance indicators include CPU performance indicators, memory performance indicators and input and output performance indicators; The step of performing performance evaluation on the fourth candidate host machine according to the host performance index of the fourth candidate host machine to obtain a performance evaluation value includes: Determine the target weights corresponding to the CPU performance index, memory performance index and input / output performance index through a geometric weight strategy; The CPU performance index, memory performance index, input / output performance index and their corresponding target weights are weighted and summed to obtain a performance evaluation value.
10. The method according to claim 8, characterized in that The step of determining at least one candidate host machine corresponding to the target scheduling task according to the performance evaluation value includes: The performance evaluation value is compared with a preset evaluation value threshold, and at least one candidate host machine corresponding to the target scheduling task is determined according to the comparison result.