Resource scheduling method and device, server and computer readable storage medium
By setting the initial dynamic water level and static water level in enterprise-level models, resource requests that reach the static water level are prioritized, which solves the problem of unreasonable resource allocation in the existing technology and improves resource utilization and cluster performance.
Patent Information
- Application Number
- CN202410882586.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-15
AI Technical Summary
In the existing technology, the NUMA service resource allocation method in enterprise-level models lacks rationality, resulting in low resource utilization and affecting cluster performance.
By setting the initial dynamic water level and static water level in the computing node, resource requests with the remaining available cores reaching the static water level are prioritized to avoid occupying resource nodes with more remaining available cores and provide resources for future needs with larger cores. Request to reserve space.
It improves the rationality of resource scheduling, improves resource utilization, avoids waste of resources, and enhances cluster performance.
Smart Images

Figure CN118779076A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of cloud computing, and in particular to a resource scheduling method, device, server, and computer-readable storage medium. Background Art
[0002] With the continuous development of cloud computing technology, the performance of computing clusters has been gradually optimized. Among them, enterprise-level models have higher performance and use core binding operations, that is, binding services with central processing unit resources to avoid poor performance caused by competition for central processing unit resources between different services.
[0003] In enterprise-level models, a single computing node in the cluster includes two numa cells to support non-uniform memory access (NUMA) services. In this process, it is necessary to reasonably allocate the numa cell resources (number of available cores) of each computing node and each computing node, and they are considered bound after allocation. In the prior art, for new NUMA services, computing nodes with more remaining available cores will be allocated first, provided that the resource requirements of the NUMA services are met, and numa cells with fewer available cores will be allocated first within the computing nodes.
[0004] However, although this resource allocation method satisfies the resource balance allocation to a certain extent, for a certain numa cell, if the NUMA service resource demand allocated to it according to the above allocation rule is small, even if there are still a lot of available resources left in this numa cell, it cannot support NUMA services with large resource requirements (such as NUMA services that need to occupy the entire numa cell), resulting in low resource utilization and seriously affecting the performance of the cluster. Therefore, the resource scheduling method in the prior art lacks rationality. Summary of the invention
[0005] In order to solve the above technical problems, the present disclosure provides a resource scheduling method, device, server and computer-readable storage medium to improve the rationality of resource scheduling.
[0006] In a first aspect, an embodiment of the present disclosure provides a resource scheduling method, including:
[0007] For any computing node in the cluster, determine an initial dynamic water level and a static water level of the computing node, wherein the static water level is lower than the initial dynamic water level, and the computing node includes a first resource node and a second resource node, and the number of remaining available cores of the first resource node is less than the number of remaining available cores of the second resource node;
[0008] Obtaining a single-node resource scheduling request, wherein the single-node resource scheduling request includes a required number of cores required to complete the single-node resource scheduling request;
[0009] If the number of remaining available cores in the first resource node is higher than the static watermark, and the difference between the number of remaining available cores and the static watermark is greater than or equal to the required number of cores, the single-node resource scheduling request is allocated to the first resource node.
[0010] In some embodiments, the method further includes: if the number of remaining available cores in the first resource node is higher than the static watermark, and the difference between the remaining available cores and the static watermark is less than the required number of cores, then allocating the single-node resource scheduling request to the second resource node.
[0011] In some embodiments, before determining the initial dynamic waterline and the static waterline of the current computing node, the method further includes:
[0012] In response to a configuration operation by a user, a maximum number of borrowable cores of the computing node is determined.
[0013] In some embodiments, determining the initial dynamic water level and the static water level of the current computing node includes:
[0014] The static water level is determined to be the initial dynamic water level minus the maximum number of borrowable cores.
[0015] In some embodiments, the method further comprises:
[0016] Obtaining a resource scheduling request, the resource scheduling request including a single-node resource scheduling request or a dual-node resource scheduling request, the dual-node resource scheduling request including the required number of cores required to complete the dual-node resource scheduling request;
[0017] If the remaining available core number of the first resource node and / or the remaining available core number of the second resource node of each computing node in the cluster cannot satisfy the resource scheduling request, calculating the core borrowing cost required for each computing node to complete the resource scheduling request;
[0018] Determine the computing node with the lowest core borrowing cost as the target node;
[0019] The resource scheduling request is allocated to the target node, so that the target node implements the resource scheduling request in a core-borrowing manner.
[0020] In some embodiments, the calculating the core borrowing cost required for each computing node to complete the resource scheduling request includes:
[0021] If the resource scheduling request is a single-node resource scheduling request, the core borrowing cost is determined as the difference between the required number of cores and the maximum number of remaining cores, where the maximum number of remaining cores is the larger of the remaining available cores of the first resource node and the remaining available cores of the second resource node.
[0022] In some embodiments, the calculating the core borrowing cost required for each computing node to complete the resource scheduling request includes:
[0023] If the resource scheduling request is a dual-node resource scheduling request, the core borrowing cost is determined as the difference between half of the required core number and the minimum remaining core number, where the minimum remaining core number is the smaller of the remaining available core number of the first resource node and the remaining available core number of the second resource node.
[0024] In a second aspect, an embodiment of the present disclosure provides a resource scheduling device, including:
[0025] A determination module is used to determine, for any computing node in the cluster, an initial dynamic water level and a static water level of the computing node, wherein the static water level is lower than the initial dynamic water level, and the computing node includes a first resource node and a second resource node, and the number of remaining available cores of the first resource node is less than the number of remaining available cores of the second resource node;
[0026] An acquisition module, configured to acquire a single-node resource scheduling request, wherein the single-node resource scheduling request includes a required number of cores required to complete the single-node resource scheduling request;
[0027] An allocation module is used to allocate the single-node resource scheduling request to the first resource node if the remaining number of available cores in the first resource node is higher than the static watermark and the remaining number of available cores is greater than or equal to the required number of cores.
[0028] In a third aspect, an embodiment of the present disclosure provides a server, including:
[0029] Memory;
[0030] Processor; and
[0031] Computer programs;
[0032] The computer program is stored in the memory and is configured to be executed by the processor to implement the method as described in the first aspect.
[0033] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method described in the first aspect.
[0034] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the resource scheduling method as described above is implemented.
[0035] The resource scheduling method, device, server and computer-readable storage medium provided by the embodiments of the present disclosure, by setting a static water level lower than the initial dynamic water level, when the remaining number of available cores of the resource node reaches the initial dynamic water level but does not reach the static water level, it can still be preferentially allocated with a single-node resource scheduling request that matches the current remaining number of available cores and the static water level, avoiding occupying another resource node with a larger number of remaining available cores, reserving available space for subsequent single-node resource scheduling requests that may require a larger number of cores, and improving the rationality of resource scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0038] Figure 1 A flow chart of a resource scheduling method provided by an embodiment of the present disclosure;
[0039] Figure 2 A schematic diagram of a double water level line provided in an embodiment of the present disclosure;
[0040] Figure 3 It is a schematic diagram of resource scheduling under the principle of resource idle rate priority;
[0041] Figure 4 A schematic diagram of resource scheduling provided in an embodiment of the present disclosure;
[0042] Figure 5 A schematic diagram of the structure of a resource scheduling device provided in an embodiment of the present disclosure;
[0043] Figure 6 A schematic diagram of the structure of a server provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0045] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0046] The present disclosure provides a resource scheduling method, which is described below in conjunction with a specific embodiment.
[0047] Figure 1 A flow chart of a resource scheduling method provided in an embodiment of the present disclosure. The method can be applied to a server that manages an enterprise-class cluster of multiple computing nodes. It is understandable that the resource scheduling method provided in an embodiment of the present disclosure can also be applied in other scenarios.
[0048] Below Figure 1 The resource scheduling method shown in FIG. 1 is introduced, and the specific steps of the method are as follows:
[0049] S101. For any computing node in the cluster, determine an initial dynamic water level and a static water level of the computing node, wherein the static water level is lower than the initial dynamic water level. The computing node includes a first resource node and a second resource node, and the number of remaining available cores of the first resource node is less than the number of remaining available cores of the second resource node.
[0050] The cluster includes multiple computing nodes, each of which includes two resource nodes (numacells), which are called the first resource node and the second resource node. The multiple central processing units (CPUs) available in each resource node are called "cores" (numanode).
[0051] In order to achieve resource scheduling balance within the computing node, a "double watermark" is set for the computing node, including a dynamic watermark and a static watermark. The initial dynamic watermark is the initial state of the dynamic watermark. Since the number of cores required for resource scheduling requests is usually a multiple of the specified number of cores (such as 16), the maximum multiple of the specified number of cores among the remaining available cores in the computing node is set as the dynamic watermark. The initial dynamic watermark is the state of the dynamic watermark when the computing node has not been used.
[0052] For example, when the remaining number of available cores of the first resource node is 70 and the remaining number of available cores of the second resource node is 78, the dynamic water level of the current computing node is 64; after a period of time, the remaining number of available cores of the first resource node decreases to 19 and the remaining number of available cores of the second resource node decreases to 21, then the dynamic water level of the current computing node is 16.
[0053] The static water level is lower than the initial dynamic water level, but in the resource allocation process, the static water level has a higher priority than the dynamic water level.
[0054] Preferably, before determining the initial dynamic watermark and static watermark of the current computing node, the method further comprises: determining the maximum number of cores that can be borrowed of the computing node in response to a configuration operation of a user. The determining the initial dynamic watermark and static watermark of the current computing node comprises: determining the static watermark to be the initial dynamic watermark minus the maximum number of cores that can be borrowed.
[0055] The maximum number of cores that can be borrowed is the maximum number of cores that can be "borrowed" by the user if a core borrowing situation occurs. Since "borrowing cores" has a certain impact on the performance of computing nodes, the more cores borrowed, the more serious the impact on the performance of computing nodes. Therefore, the maximum number of cores that can be borrowed needs to be set to prevent "borrowing cores" from having too serious an impact on the performance of computing nodes.
[0056] For example, the user can configure a series of borrowable core numbers. For example, if the borrowable core numbers are set to 2 and 4, the maximum borrowable core number is determined to be 4.
[0057] Furthermore, the static water level is determined as the initial dynamic water level minus the maximum number of borrowable cores, which can more obviously achieve the scheduling effect for single-node resource scheduling requests with a small required number of cores (for example, the required number of cores is less than or equal to the difference between the remaining number of available cores and the static water level).
[0058] Figure 2 A schematic diagram of a double water level line provided in an embodiment of the present disclosure, such as Figure 2 As shown, the static water level is set to 70, the initial dynamic water level is set to 96, and the dynamic water level gradually decreases to 64 and 32 as the resources in the computing node are used.
[0059] S102: Obtain a single-node resource scheduling request, where the single-node resource scheduling request includes the required number of cores required to complete the single-node resource scheduling request.
[0060] A single-node resource scheduling request is a resource scheduling request that is normally implemented by a single resource node. To implement the single-node resource scheduling request, it is necessary to determine the required number of cores required to implement the single-node resource scheduling request.
[0061] For example, if the required number of cores for a single-node resource scheduling request is 4, it means that under normal circumstances, implementing this single-node resource scheduling request requires occupying 4 numa nodes in a certain resource node.
[0062] S103. If the number of remaining available cores in the first resource node is higher than the static watermark, and the difference between the remaining available cores and the static watermark is greater than or equal to the required number of cores, the single-node resource scheduling request is allocated to the first resource node.
[0063] In a single computing node, for a single-node resource scheduling request, it is first necessary to ensure that the sum of the remaining available core numbers of the two resource nodes in the computing node is greater than or equal to the required core number, so that the computing node can support the single-node resource scheduling request.
[0064] Furthermore, if the remaining available number of cores of a single resource node (such as the first resource node or the second resource node) is greater than or equal to the required number of cores, the resource node can independently support the single-node resource scheduling request without the need to "borrow cores" between different resource nodes.
[0065] In this case, if both resource nodes can independently support the single-node resource scheduling request, it is necessary to comprehensively determine which resource node satisfies the single-node resource scheduling request by combining the dynamic watermark and the static watermark.
[0066] Specifically, if the remaining number of available cores of the first resource node has reached the initial dynamic water level, and the remaining number of available cores of the first resource node is less than the remaining number of available cores of the second resource node, for the newly acquired single-node resource scheduling request, since the static water level is less than the initial dynamic water level, and the priority of the static water level is higher than the initial dynamic water level, and since the remaining number of available cores of the first resource node has not yet reached below the static water level, when the difference between the remaining number of available cores of the first resource node and the static water level meets the required number of cores, the single-node resource scheduling request will still be allocated to the first resource node with fewer remaining available cores, thereby reserving more remaining available cores for the second resource node, and the single-node resource scheduling request with more required number of cores has been met.
[0067] For example, if the remaining available core number of the first resource node is less than the remaining available core number of the second resource node, if resource allocation is performed based on the principle of resource idle rate priority, the second resource node should complete the single-node resource scheduling request. Figure 3 This is a schematic diagram of resource scheduling under the resource idle rate priority principle. Figure 3As shown, the original number of available cores of the first resource node is 76, and the remaining number of available cores is 64; the original number of available cores of the second resource node is 96, and the remaining number of available cores is 92; the initial dynamic water level is 64. When a new single-node resource scheduling request with a required number of cores of 4 is received, the single-node resource scheduling request is allocated to the second resource node according to the resource idle rate priority principle. At this time, the remaining number of available cores of the second resource node changes from 92 to 88. If a single-node resource scheduling request with a required number of cores of 96 is received again, and the maximum number of borrowable cores set by the user is 4, the second resource node cannot support the single-node resource scheduling request with a required number of cores of 96 alone, and the required number of borrowed cores is 6, which exceeds the maximum number of borrowable cores set by the user of 4. At this time, although there are still a large number of resources remaining in the computing node, it cannot support the single-node resource scheduling request with a required number of cores of 96.
[0068] Figure 4 A resource scheduling schematic diagram provided in an embodiment of the present disclosure is shown in FIG. Figure 4 As shown, if the resource scheduling request provided by the embodiment of the present disclosure is adopted, the original number of available cores of the first resource node is 76, and the remaining number of available cores is 64; the original number of available cores of the second resource node is 96, and the remaining number of available cores is 94; the initial dynamic water level is 64, and the static water level is 60. When a new single-node resource scheduling request with a required number of cores of 4 is received, since the remaining number of available cores of the first resource node 64 is still greater than the static water level 60, and the difference between the two is 4, the single-node resource scheduling request with a required number of cores of 4 can be allocated to the first resource node. In this way, if a single-node resource scheduling request with a required number of cores of 96 is received again, the remaining number of available cores of the second resource node is 94, that is, the single-node resource scheduling request with a required number of cores of 96 can be implemented within the allowed core borrowing range.
[0069] The embodiment of the present disclosure determines an initial dynamic water level and a static water level of a computing node for any computing node in a cluster, wherein the static water level is lower than the initial dynamic water level, and the computing node includes a first resource node and a second resource node, and the remaining available core number of the first resource node is less than the remaining available core number of the second resource node; obtains a single-node resource scheduling request, wherein the single-node resource scheduling request includes the required core number required to complete the single-node resource scheduling request; if the remaining available core number in the first resource node is higher than the static water level, and the difference between the remaining available core number and the static water level is greater than or equal to the required core number, the single-node resource scheduling request is allocated to the first resource node, and by setting a static water level lower than the initial dynamic water level, when the remaining available core number of the resource node reaches the initial dynamic water level but does not reach the static water level, the single-node resource scheduling request that matches the current remaining available core number and the static water level can still be preferentially allocated, thereby avoiding occupying another resource node with a large number of remaining available cores, reserving available space for a single-node resource scheduling request with a large number of required cores that may be required later, thereby improving the rationality of resource scheduling.
[0070] Based on the above embodiment, the method also includes: if the remaining number of available cores in the first resource node is higher than the static water level, and the difference between the remaining number of available cores and the static water level is less than the required number of cores, then the single-node resource scheduling request is allocated to the second resource node.
[0071] When the number of remaining available cores in the first resource node is higher than the static water level, and the difference between the remaining available cores and the static water level is less than the required core number, that is, the difference between the remaining available cores and the static water level can no longer meet the required core number required by the resource scheduling request, if the resource scheduling request is still allocated to the first resource node, the number of remaining available cores in the first resource node will be reduced to below the static water level, and it will be impossible to reserve available space for subsequent single-node resource scheduling requests with a larger required core number, or dual-node resource scheduling requests that need to occupy two resource nodes at the same time. At this time, the single-node resource scheduling request will be allocated to the second resource node.
[0072] The embodiment of the present disclosure allocates the resource scheduling request to the second resource node when the difference between the remaining number of available cores in the first resource node and the static waterline cannot meet the required number of cores required by the resource scheduling request, thereby avoiding a single resource node in the computing node from being occupied first, and reserving available space for dual-node resource scheduling requests. This makes the resource scheduling method provided by the present disclosure more compatible with single-node resource scheduling and dual-node resource scheduling requests, further improving the rationality of the resource scheduling method.
[0073] On the basis of the above embodiment, the method also includes: obtaining a resource scheduling request, the resource scheduling request includes a single-node resource scheduling request or a dual-node resource scheduling request, the dual-node resource scheduling request includes the required number of cores required to complete the dual-node resource scheduling request; if the remaining number of available cores of the first resource node and / or the remaining number of available cores of the second resource node of each computing node in the cluster cannot meet the resource scheduling request, calculating the core borrowing cost required for each computing node to complete the resource scheduling request; determining the computing node with the lowest core borrowing cost as the target node; allocating the resource scheduling request to the target node so that the target node implements the resource scheduling request by borrowing cores.
[0074] A dual-node resource scheduling request is a resource scheduling request implemented by two resource nodes under normal circumstances. Usually, the required number of cores required for the dual-node resource scheduling request is evenly distributed by the two resource nodes. For example, when the required number of cores for a dual-node resource scheduling request is 64, 32 cores of the first resource node need to be occupied, and 32 cores of the second resource node need to be occupied, forming a 32+32 topology structure; if the user has special needs, the dual-node resource scheduling request can also be specified as an uneven distribution, such as a 10+14 topology structure. Similarly, when the required number of cores for a single-node resource scheduling request is 64, a 64+0 topology structure is formed.
[0075] When core borrowing occurs, the topology of the resource scheduling request will change accordingly based on the number of borrowed cores. For example, the 32+32 topology becomes a 30+34 topology, and the number of borrowed cores is 2. At this time, the first resource node with 30 remaining cores and the second resource node with 40 remaining cores can still implement a dual-node resource scheduling request with a required core number of 64.
[0076] Optionally, before calculating the core borrowing cost required for each computing node to complete the resource scheduling request, computing nodes that can implement the resource scheduling request by borrowing cores within the maximum number of cores that can be borrowed may be screened out.
[0077] In some embodiments, if all computing nodes cannot implement the resource scheduling request by borrowing cores within the maximum number of borrowable cores, it means that the current cluster cannot implement the resource scheduling request. At this time, it needs to be reported to the user, who will handle this situation.
[0078] Optionally, the remaining number of available cores of the first resource node and / or the remaining number of available cores of the second resource node of each computing node in the cluster cannot meet the resource scheduling request, including but not limited to: for a single-node resource scheduling request, the remaining number of available cores of each resource node is less than the required number of cores of the single-node resource scheduling request; or, for a dual-node resource scheduling request with an evenly distributed required number of cores, the remaining number of available cores of at least one resource node in the two resource nodes in the same computing node is less than half of the required number of cores; or, for a user-defined dual-node resource scheduling request with an unequally distributed required number of cores, the remaining number of available cores of at least one resource node in the same computing node is less than a smaller portion of the required number of cores.
[0079] As mentioned above, borrowing cores will affect the performance of computing nodes. However, when each computing node in the cluster cannot implement the resource scheduling request without borrowing cores, it is necessary to select the computing node with the lowest borrowing cost as the target node, so that the target node can implement the resource scheduling request by borrowing cores, while minimizing the impact on the performance of the computing node (target node).
[0080] Specifically, if the resource scheduling request is a single-node resource scheduling request, the core borrowing cost is determined to be the difference between the required core number and the maximum remaining core number, and the maximum remaining core number is the larger of the remaining available core number of the first resource node and the remaining available core number of the second resource node. Alternatively, if the resource scheduling request is a dual-node resource scheduling request, the core borrowing cost is determined to be the difference between half of the required core number and the minimum remaining core number, and the minimum remaining core number is the smaller of the remaining available core number of the first resource node and the remaining available core number of the second resource node.
[0081] The above process of selecting the target computing node can be implemented by the following code:
[0082]
[0083]
[0084] In the above code, the part before "if num_of_nodes==1" obtains the remaining situation of computing node resources and related information of resource scheduling requests, the part before "if num_of_nodes==1" to "else" is used to implement the core borrowing cost calculation of single-node resource scheduling requests, and the part after "else" is used to implement the core borrowing cost calculation of dual-node resource scheduling requests. It can be understood that the above code is only a possible implementation method of the logic of calculating the core borrowing cost of resource scheduling requests, and should not be used as a limitation of the embodiments of the present disclosure.
[0085] After obtaining the core borrowing cost corresponding to the resource scheduling request in each computing node, the computing node with the smallest core borrowing cost is selected as the target node to implement the corresponding resource scheduling request.
[0086] The disclosed embodiment provides a method for calculating the cost of borrowing cores and selects a computing node with the smallest borrowing cost to implement a resource scheduling request, thereby minimizing the impact of borrowing cores on computing nodes, ensuring the performance of computing nodes while ensuring that resources can be successfully scheduled, and further improving the rationality of the resource scheduling method.
[0087] Figure 5 The schematic diagram of the structure of the resource scheduling device provided in the embodiment of the present disclosure. The resource scheduling device may be a server as described in the above embodiment, or the resource scheduling device may be a component or assembly in the server. The resource scheduling device provided in the embodiment of the present disclosure may execute the processing flow provided in the resource scheduling method embodiment, such as Figure 5 As shown, the resource scheduling device 50 includes: a determination module 51, an acquisition module 52, and an allocation module 53; the determination module 51 is used to determine the initial dynamic water level and the static water level of any computing node in the cluster, the static water level is lower than the initial dynamic water level, the computing node includes a first resource node and a second resource node, and the remaining number of available cores of the first resource node is less than the remaining number of available cores of the second resource node; the acquisition module 52 is used to obtain a single-node resource scheduling request, and the single-node resource scheduling request includes the required number of cores required to complete the single-node resource scheduling request; the allocation module 53 is used to allocate the single-node resource scheduling request to the first resource node if the remaining number of available cores in the first resource node is higher than the static water level, and the difference between the remaining number of available cores and the static water level is greater than or equal to the required number of cores.
[0088] Optionally, the allocation module 53 is also used to allocate the single-node resource scheduling request to the second resource node if the number of remaining available cores in the first resource node is higher than the static waterline, and the difference between the remaining available cores and the static waterline is less than the required number of cores.
[0089] Optionally, the determination module 51 is further configured to determine the maximum number of borrowable cores of the computing node in response to a configuration operation by a user.
[0090] Optionally, the determination module 51 is further used to determine that the static water level is the initial dynamic water level minus the maximum number of borrowable cores.
[0091] Optionally, the resource scheduling device 50 also includes a computing node selection module 54, the computing node selection module 54 includes a computing unit 541 and a determining unit 542; the acquisition module 52 is used to obtain a resource scheduling request, the resource scheduling request includes a single-node resource scheduling request or a dual-node resource scheduling request, the dual-node resource scheduling request includes the required number of cores required to complete the dual-node resource scheduling request; the computing unit 541 is used to calculate the borrowing core cost required for each computing node to complete the resource scheduling request if the remaining available core number of the first resource node and / or the remaining available core number of the second resource node of each computing node in the cluster cannot meet the resource scheduling request; the determination unit 542 is used to determine the computing node with the lowest borrowing core cost as the target node; the allocation module 53 is used to allocate the resource scheduling request to the target node, so that the target node implements the resource scheduling request by borrowing cores.
[0092] Optionally, the calculation unit 541 is specifically used to determine the core borrowing cost as the difference between the required number of cores and the maximum number of remaining cores if the resource scheduling request is a single-node resource scheduling request, and the maximum number of remaining cores is the larger of the remaining available cores of the first resource node and the remaining available cores of the second resource node.
[0093] Optionally, the calculation unit 541 is specifically used to determine the core borrowing cost as the difference between half of the required number of cores and the minimum number of remaining cores if the resource scheduling request is a dual-node resource scheduling request, and the minimum number of remaining cores is the smaller of the remaining available cores of the first resource node and the remaining available cores of the second resource node.
[0094] Figure 5 The resource scheduling device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned method embodiment. Its implementation principle and technical effect are similar and will not be described in detail here.
[0095] Figure 6 Schematic diagram of the structure of the server provided in the embodiment of the present disclosure. The server may be the server described in the above embodiment. The server provided in the embodiment of the present disclosure may execute the processing flow provided in the resource scheduling method embodiment, such as Figure 6 As shown, the server 60 includes: a memory 61, a processor 62, a computer program and a communication interface 63; wherein the computer program is stored in the memory 61 and is configured so that the processor 62 executes the resource scheduling method as described above.
[0096] In addition, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the resource scheduling method described in the above embodiment.
[0097] In addition, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the resource scheduling method described above is implemented.
[0098] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0099] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A resource scheduling method, characterized in that: The method comprises: For any computing node in the cluster, determine an initial dynamic water level and a static water level of the computing node, wherein the static water level is lower than the initial dynamic water level, and the computing node includes a first resource node and a second resource node, and the number of remaining available cores of the first resource node is less than the number of remaining available cores of the second resource node; Obtaining a single-node resource scheduling request, wherein the single-node resource scheduling request includes a required number of cores required to complete the single-node resource scheduling request; If the number of remaining available cores in the first resource node is higher than the static watermark, and the difference between the number of remaining available cores and the static watermark is greater than or equal to the required number of cores, the single-node resource scheduling request is allocated to the first resource node.
2. The method according to claim 1, characterized in that The method further comprises: If the number of remaining available cores in the first resource node is higher than the static watermark, and the difference between the number of remaining available cores and the static watermark is less than the required number of cores, the single-node resource scheduling request is allocated to the second resource node.
3. The method according to claim 1, characterized in that Before determining the initial dynamic water level and the static water level of the current computing node, the method further includes: In response to a configuration operation by a user, a maximum number of borrowable cores of the computing node is determined.
4. The method according to claim 3, characterized in that The determining of the initial dynamic water level and the static water level of the current computing node includes: The static water level is determined to be the initial dynamic water level minus the maximum number of borrowable cores.
5. The method according to claim 1, characterized in that: The method further comprises: Obtaining a resource scheduling request, the resource scheduling request including a single-node resource scheduling request or a dual-node resource scheduling request, the dual-node resource scheduling request including the required number of cores required to complete the dual-node resource scheduling request; If the remaining available core number of the first resource node and / or the remaining available core number of the second resource node of each computing node in the cluster cannot satisfy the resource scheduling request, calculating the core borrowing cost required for each computing node to complete the resource scheduling request; Determine the computing node with the lowest core borrowing cost as the target node; The resource scheduling request is allocated to the target node, so that the target node implements the resource scheduling request in a core-borrowing manner.
6. The method according to claim 5, characterized in that The calculating the core borrowing cost required for each computing node to complete the resource scheduling request includes: If the resource scheduling request is a single-node resource scheduling request, the core borrowing cost is determined as the difference between the required number of cores and the maximum number of remaining cores, where the maximum number of remaining cores is the larger of the remaining available cores of the first resource node and the remaining available cores of the second resource node.
7. The method according to claim 5, characterized in that The calculating the core borrowing cost required for each computing node to complete the resource scheduling request includes: If the resource scheduling request is a dual-node resource scheduling request, the core borrowing cost is determined as the difference between half of the required core number and the minimum remaining core number, where the minimum remaining core number is the smaller of the remaining available core number of the first resource node and the remaining available core number of the second resource node.
8. A resource scheduling device, characterized in that: include: A determination module is used to determine, for any computing node in the cluster, an initial dynamic water level and a static water level of the computing node, wherein the static water level is lower than the initial dynamic water level, and the computing node includes a first resource node and a second resource node, and the number of remaining available cores of the first resource node is less than the number of remaining available cores of the second resource node; An acquisition module, configured to acquire a single-node resource scheduling request, wherein the single-node resource scheduling request includes a required number of cores required to complete the single-node resource scheduling request; An allocation module is used to allocate the single-node resource scheduling request to the first resource node if the number of remaining available cores in the first resource node is higher than the static watermark, and the difference between the remaining available cores and the static watermark is greater than or equal to the required number of cores.
9. A server, characterized in that: include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
