WO2020108337A1 - Cpu resource scheduling method and electronic equipment - Google Patents

Cpu resource scheduling method and electronic equipment Download PDF

Info

Publication number
WO2020108337A1
WO2020108337A1 PCT/CN2019/119125 CN2019119125W WO2020108337A1 WO 2020108337 A1 WO2020108337 A1 WO 2020108337A1 CN 2019119125 W CN2019119125 W CN 2019119125W WO 2020108337 A1 WO2020108337 A1 WO 2020108337A1
Authority
WO
WIPO (PCT)
Prior art keywords
cpu
exclusive
application
node
shared
Prior art date
Application number
PCT/CN2019/119125
Other languages
French (fr)
Chinese (zh)
Inventor
姚军利
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2020108337A1 publication Critical patent/WO2020108337A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5066Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • Embodiments of the present disclosure relate to the field of network technology, and in particular, to a CPU resource scheduling method and electronic equipment.
  • a distributed streaming data processing system is a system that converts real-time streaming data processing into multiple small jobs and executes them in parallel on multiple processing machines.
  • the distributed stream data processing system based on small batch operations divides the real-time stream data into a series of small batch data at time intervals, and then processes these small batch data. In this way, this type of system can provide low Delayed, high-throughput real-time data processing services.
  • cloud computing technology it has become a trend to deploy such complex applications into cloud environment clusters.
  • each node In a cloud environment cluster, each node often needs to configure exclusive CPU cores and shared CPU cores in advance, and the configuration is more complicated; and the shared CPU cores and exclusive CPU cores need to be scheduled as two resources.
  • the scheduling dimension is high; and because the threshold for exclusive use of CPU cores is high, one type of resources is often insufficient, and another type of resources is idle and wasted, resulting in inefficient utilization of CPU resources; at the same time, exclusive CPU cores are After the node operating system is started, it is determined. If the allocation ratio of shared CPU cores and exclusive CPU cores on the node is modified in order to improve the utilization efficiency of CPU resources, the node operating system must be restarted to take effect. In the cloud environment cluster, the restart of the node operating system means the migration or interruption of the services carried on the node, which cannot be executed at high frequency, which greatly affects the service effect of the node.
  • the purpose of the embodiments of the present disclosure is to provide a CPU resource scheduling method and an electronic device, so that the complexity of configuring nodes is reduced without affecting the service effect of nodes, and the scheduling dimension of CPU resources and the exclusive use of CPU resources are also reduced.
  • the use threshold also realizes flexible scheduling of shared CPU and exclusive CPU resources, and improves the CPU resource utilization efficiency of nodes.
  • the embodiments of the present disclosure provide a CPU resource scheduling method, including: configuring all CPU cores on each node as shared CPU cores, and taking the number of shared CPU cores of each node as the node’s The number of available CPU cores; the number of CPU cores required to receive and parse the application.
  • the number of CPU cores required includes the number of exclusive CPU cores and the number of shared CPU cores.
  • An embodiment of the present disclosure also provides an electronic device including at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are at least one The processor executes to implement the above CPU resource scheduling method.
  • FIG. 1 is a schematic flowchart of a CPU resource scheduling method according to the first embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of a CPU resource scheduling method according to a second embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart of a CPU resource scheduling method according to a third embodiment of the present disclosure.
  • FIG. 4 is a schematic flow chart of dynamic conversion of shared CPU cores and exclusive CPU cores according to the third embodiment of the present disclosure
  • FIG. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present disclosure.
  • the first embodiment of the present disclosure relates to a CPU resource scheduling method.
  • the specific flow diagram is shown in FIG. 1 and specifically includes:
  • Step 101 All CPU cores on each node are configured as shared CPU cores, and the number of shared CPU cores of each node is used as the number of available CPU cores of the node.
  • the existing cluster usually needs to plan exclusive CPU cores in advance, and in the embodiment of the present disclosure, all CPU cores on each node in the cluster are configured as shared CPU cores.
  • all CPU cores on each node are shared CPU cores, and there is only one type of CPU resource in the cluster scheduler, that is, shared CPU resources.
  • each node reports its own number of shared CPU cores to the cluster resource scheduler. In this embodiment, it is not necessary to plan exclusive CPU cores in advance, which reduces the complexity of nodes and lowers the threshold for exclusive CPU resources.
  • Step 102 Receive and analyze the number of CPU core requirements of the application.
  • the cluster scheduler needs to analyze the application's CPU core requirements, determine the application's exclusive CPU core requirements and shared CPU core requirements, so as to subsequently deploy nodes for the application based on the application's exclusive CPU core requirements and shared CPU core requirements.
  • Step 103 Select a node whose available CPU core number is greater than or equal to the required number of CPU cores as a deployment node, and deploy the task of executing the application to the deployment node.
  • each node in the cluster reports the number of its own shared CPU cores to the cluster resource scheduler, and the cluster resource scheduler learns the number of available CPU cores of each node in the cluster, and thus receives the CPU core demand of the application According to the number of CPU core requirements of an application, a node that meets the application requirements can be selected as a deployment node. The task of executing the application is deployed to a deployment node, and the deployment node executes the task of the application.
  • Step 104 Monitor the application startup event and exit event of the deployment node. If the startup event of the application is monitored, step 105 is entered; if the exit event is monitored, step 106 is entered.
  • Step 105 Select shared CPU cores equal to the number of exclusive CPU requirements from the shared CPU cores of the deployment node and convert them into exclusive CPU cores, and allocate the converted exclusive CPU cores to the application for use.
  • Step 106 When the application exit event of the deployment node is monitored, the exclusive CPU core allocated to the application is converted into a shared CPU core.
  • the cluster resource scheduler monitors the startup event and exit event of the application of the deployment node, and if the startup event of the application of the deployment node is monitored, it is selected from the shared CPU cores of the deployment node Shared CPU cores equal to the number of exclusive CPU cores required by the application are converted into exclusive CPU cores, and the converted exclusive CPU cores are allocated to the application for use.
  • the application exit event of the deployed node is monitored, the node's exclusive CPU core no longer needs to execute the application's task. At this time, the exclusive CPU core allocated to the application is converted into a shared CPU core.
  • the method further includes: updating the number of available CPU cores of the deployment node. So that the cluster resource scheduler can obtain the real-time actual number of available CPU cores of each node after the application task is deployed, and it is convenient for the subsequent resource scheduler to deploy the application task for each node.
  • the method further includes: monitoring the task execution status of the deployment node, and updating the available CPU of the deployment node after the task execution of the deployment node is completed or the task execution is abnormally terminated The number of cores. So that the cluster resource scheduler can obtain the real-time actual number of available CPU cores of each node after the task execution of the deployment node is completed or the task execution is abnormally terminated, which is convenient for subsequent resource schedulers to deploy application tasks for each node.
  • the method further includes the step of: updating the available CPU quantity of the deployment node. Specifically, the difference between the number of available CPUs before the deployment node is deployed and the number of CPU requirements is used as the updated number of available CPUs of the deployment node. Specifically, after the application is deployed for the deployment node, the number of available CPU cores of the deployment node is updated in time, so that the cluster resource scheduler can obtain the real-time actual number of available CPU cores of each node, which is convenient for subsequent resource schedulers to deploy for each node application.
  • the method further includes the step of: updating the number of available CPUs of the deployment node. Specifically, the sum of the number of available CPUs and the number of CPU requirements after the deployment node is deployed as the updated number of available CPUs of the deployment node. Specifically, when the application exit event of the deployment node is monitored, the exclusive CPU core of the node does not need to perform the task of the application.
  • the number of available CPU cores of the deployment node is updated again to make the deployment node available after the application is deployed
  • the sum of the number of CPU cores and the number of CPU core requirements is the updated number of available CPU cores of the deployment node, so that after the current task of the deployment node ends, the current number of available CPU cores is updated in time to facilitate subsequent resource schedulers for each Node deployment application.
  • the scheduling process of the cluster application under the static exclusive CPU solution is as follows:
  • MASTER establishes a connection with NODE1 and NODE2; 20 of the 32 CPUs on the NODE1 node are used as shared CPUs, and 12 are reported as exclusive CPUs to the MASTER node. Of the 48 CPUs on the NODE2 node, 30 are shared CPUs and 18 are reported to MASTER as exclusive CPUs. From the perspective of MASTER, there are 50 shared CPUs and 30 exclusive CPUs in the cluster.
  • the initialization state table is shown in Table 2 below:
  • CONTAINER1 and CONTAINER2 have no exclusive CPU requirements, and all the pre-planned exclusive CPU resources in this cluster are idle.
  • CONTAINER3 and CONTAINER4 are ultimately limited by the exclusive CPU resources, resulting in a situation of tight exclusive resources and a large amount of shared resources in the cluster.
  • the scheduling process of the application container in the cluster under the dynamic exclusive CPU solution is as follows:
  • MASTER establishes a connection with NODE1 and NODE2; 32 of the 32 CPUs on the NODE1 node are reported to the MASTER node as shared CPUs, and 48 of the 48 CPUs on the NODE2 node are reported to the MASTER as shared CPUs From a perspective, the cluster has a total of 80 shared CPUs and 0 exclusive CPU cores.
  • the state table in the initial state is shown in Table 7:
  • CONTAINER1 and CONTAINER2 do not have exclusive CPU requirements. All CPU resources in this cluster are used as shared CPUs, and there is no idle scenario.
  • the method of dynamically monopolizing the CPU core does not need to pay attention to whether the container needs to share the CPU or the exclusive CPU at the scheduling level.
  • CPU needs to be scheduled, thereby improving the utilization efficiency of CPU resources in the cluster at the scheduling layer, circumventing the inevitable problem of idle CPU resources in the past, and improving the utilization efficiency of CPU resources.
  • this embodiment provides a CPU resource scheduling method, all CPU cores on each node are configured as shared CPU cores, and the number of shared CPU cores of each node is used as the available CPU core of the node Number, no need to configure exclusive CPU and shared CPU, reducing the complexity of configuring nodes; at the same time, CPU resources are only scheduled in the shared CPU dimension, and there is no need to schedule CPU resources in the shared CPU and exclusive CPU dimension, which reduces the scheduling dimension of CPU resources Then select the node with the number of available CPU cores greater than or equal to the number of application CPU cores as the deployment node, deploy the application to the deployment node to meet the application's CPU core demand, and select and apply from the shared CPU core of the deployment node when the application starts an event The number of shared CPU cores with the same number of exclusive CPU requirements is converted to exclusive CPU cores for use.
  • the exclusive CPU cores allocated to the application are converted to shared CPU cores.
  • the exclusive CPU cores are Dynamic conversion of shared CPU cores, so that at the level of scheduling, it is not necessary to pay attention to whether the container needs shared CPU cores or exclusive CPU cores, but merged as ordinary CPU core requirements for scheduling, avoiding some cases of sharing CPU cores and exclusive CPU cores are scheduled as two kinds of resources, resulting in a situation where "one resource is insufficient, and the other resource is largely idle and wasted", which greatly improves the utilization efficiency of CPU resources and the flexibility of scheduling.
  • the node operating system needs to be restarted, which reduces the threshold for exclusive CPU resources, and avoids the migration or interruption of the bearer service on the node, which does not affect the service effect of the node.
  • the second embodiment of the present disclosure relates to a CPU resource scheduling method.
  • the second embodiment is an improvement on the first embodiment.
  • the main improvement is that: in this embodiment, a specific implementation manner for obtaining the number of CPU core requirements of an application is provided.
  • FIG. 2 The specific flowchart of the CPU resource scheduling method in this embodiment is shown in FIG. 2 and specifically includes:
  • Step 201 All CPU cores on each node are configured as shared CPU cores, and the number of shared CPU cores of each node is used as the number of available CPU cores of the node.
  • step 201 is substantially the same as step 101 in the first embodiment, and will not be repeated here.
  • Step 202 Query the configuration information of the application.
  • Step 203 Determine the number of exclusive CPU requirements according to the configuration information.
  • the resource scheduler in the cluster queries the configuration information of the application before deploying the application, and the configuration information of the application includes the CPU of the application.
  • the cluster resource scheduler can determine the number of exclusive CPU cores and the number of shared CPU cores of the application according to the description in the configuration information, which is convenient for the subsequent dynamic allocation of exclusive CPU cores for the application.
  • Step 204 Select a node whose available CPU core number is greater than or equal to the required number of CPU cores as the deployment node, and deploy the task of executing the application to the deployment node.
  • step 204 is substantially the same as step 103 in the first embodiment, and will not be repeated here.
  • Step 205 Hand over tasks that do not require exclusive CPU cores in the application to the operating system of the deployment node for scheduling.
  • the resource retriever hands over the task that requires exclusive CPU cores in the application to the converted Exclusive CPU cores are used for processing, and tasks that do not require exclusive CPU cores in the application are directly scheduled by the operating system of the deployment node of the application for scheduling, and the operating system of the deployment node selects which shared CPU cores of the deployment node It does not need to monopolize the CPU core in the application, and realizes the flexible call to the shared CPU core in the deployment node.
  • Step 206 Monitor the application startup event and exit event of the deployment node. If the startup event of the application is monitored, step 207 is entered; if the exit event is monitored, step 208 is entered.
  • Step 207 When the application start event of the deployment node is monitored, select the shared CPU cores equal to the exclusive CPU demand from the shared CPU cores of the deployment node and convert to exclusive CPU cores, and assign the converted exclusive CPU cores to Application use.
  • Step 208 When the application exit event of the deployment node is monitored, convert the exclusive CPU core allocated to the application to a shared CPU core.
  • this embodiment provides a CPU resource scheduling method, and proposes a specific implementation method for obtaining the number of application CPU cores, and obtains the number of application CPU cores according to the configuration information of the application. And tasks that do not require exclusive CPU cores in the application are directly dispatched to the operating system of the deployment node of the application for scheduling, and the operating system of the deployment node selects which shared CPU cores of the deployment node to process the application without exclusive CPU cores The task of implementing the flexible call to the shared CPU core in the deployment node.
  • the third embodiment of the present disclosure relates to a CPU resource scheduling method.
  • the third embodiment is an improvement on the first embodiment, and the main improvement lies in: a specific implementation manner for determining and converting an exclusive CPU core is proposed in this embodiment.
  • FIG. 3 A specific process schematic diagram of a CPU resource scheduling method in this embodiment is shown in FIG. 3, and specifically includes:
  • Step 301 All CPU cores on each node are configured as shared CPU cores, and the number of shared CPU cores of each node is used as the number of available CPU cores of the node.
  • Step 302 Receive and analyze the number of CPU core requirements of the application.
  • Step 303 Select a node whose available CPU core number is greater than or equal to the required number of CPU cores as the deployment node, and deploy the task of executing the application to the deployment node.
  • steps 301 to 303 are substantially the same as steps 101 and 103 in the first embodiment, and will not be repeated here.
  • Step 304 Monitor the application startup event and exit event of the deployment node. If the startup event of the application is monitored, step 305 is entered; if the exit event is monitored, step 309 is entered.
  • Step 305 Determine the ID of the CPU core of the deployment node that is equal to the number of exclusive CPU requirements and needs to be converted into the exclusive CPU core.
  • Step 306 According to the number of exclusive CPU requirements, determine the ID of the shared CPU core of the deployed node equal to the number of exclusive CPU requirements as the ID of the CPU core to be converted.
  • Step 307 Convert the shared CPU core corresponding to the CPU core ID to be converted on the deployment node into an exclusive CPU core.
  • Step 308 Assign the converted exclusive CPU core to the application.
  • the processing for the application startup event in the cluster is as follows: (1) Query application configuration information, determine the number of exclusive CPU requirements of the application, and hand over tasks that do not require exclusive CPU to the operating system Perform scheduling; (2) Determine the number of CPU cores in the deployment node that need to be converted to exclusive CPUs, and the ID of the CPU cores of the deployment nodes that need to be converted to exclusive CPU cores; (3) Convert the CPU cores of specific IDs on the deployment nodes to exclusive CPU cores (the number is the number of exclusive CPUs required by the application on the deployment node); (4) Assign the converted exclusive CPU cores to the application.
  • the ID of the shared CPU core with the lightest load on the deployment node may be directly used as the ID of the CPU core to be converted.
  • the shared CPU core with the fewest tasks and the lightest load directly handles the task of monopolizing the CPU core required by the application on the deployment node, providing a selection strategy for CPU conversion goals, which not only improves the speed of scheduling CPU cores, but also speeds up Task processing efficiency.
  • the method further includes: migrating the load on the exclusive CPU core to other shared CPU cores.
  • migrating the load on the exclusive CPU core to other shared CPU cores.
  • the converted exclusive CPU core information is passed to the application, and CONTROL GROUP is used to ensure that only the belonging application can use the converted exclusive CPU core, which specifically includes: binding the application to the application according to the application's exclusive CPU description Convert the exclusive CPU core.
  • the converted exclusive CPU core information is transferred to the application, and the converted exclusive CPU core information may be transferred to the application using the environment variable or configuration file of the exclusive CPU core.
  • Use CONTROLGROUP control group
  • the application is bound to the converted exclusive CPU, and a specific implementation solution that uses CONTROL GROUP to ensure CPU exclusive is provided, and this implementation depends on the binding strategy specified in the application information.
  • Step 309 Convert the exclusive CPU core allocated to the application to a shared CPU core.
  • the system kernel finds the updated exclusive CPU core ID list, sets the CPU core corresponding to the ID in the list as the exclusive CPU core in the system, and can schedule the CPU core list after updating the operating system;
  • CONTAINER2 is deployed on the NODE1 node, and the CPU layout on NODE1 is adjusted to Table 15:
  • CONTAINER3 is deployed on the NODE1 node, then the CPU layout on NODE1 is adjusted to Table 17:
  • CONTAINER4 is deployed on the NODE1 node, then the CPU layout on NODE1 is adjusted to Table 19:
  • the CPU resources on the node are dynamically converted between the shared CPU and the exclusive CPU according to the actual needs of the application.
  • the application ownership of the exclusive CPU core needs to be clearly defined, and through the configuration in the CONTROL GROUP, the exclusive CPU core can only be used by the belonging application.
  • this embodiment provides a specific implementation method for determining and converting an exclusive CPU core.
  • the CPU core ID is used to determine the shared CPU core that needs to be converted to an exclusive CPU core, and the CPU core ID is used to Realize the conversion from shared CPU core to exclusive CPU core and allocate the converted exclusive CPU core to the application.
  • the shared CPU core with the fewest tasks and the lightest load directly handles the task of monopolizing the CPU core required by the application on the deployment node.
  • the task process converted to the exclusive processing on the exclusive CPU core is migrated to other shared CPU cores, and the processing is performed by the other shared CPU cores, making the scheduling of the CPU cores in the node more flexible.
  • the fourth embodiment of the present disclosure relates to an electronic device, as shown in FIG. 5, including: at least one processor 501; and a memory 502 communicatively connected to the at least one processor 501;
  • the instructions executed by the processor 501 are executed by at least one processor 501, so that the at least one processor 501 can execute the medium CPU resource scheduling method in any of the foregoing embodiments.
  • the bus may include any number of interconnected buses and bridges.
  • the bus connects one or more processors 501 and various circuits of the memory 502 together.
  • the bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, etc., which are well known in the art, and therefore, they will not be described further herein.
  • the bus interface provides an interface between the bus and the transceiver.
  • the transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium.
  • the data processed by the processor 501 is transmitted on the wireless medium through the antenna. Further, the antenna also receives the data and transmits the data to the processor 501.
  • the processor 501 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory 502 may be used to store data used by the processor 501 when performing operations.
  • the fifth embodiment of the present disclosure relates to a computer-readable storage medium storing a computer program.
  • the computer program is executed by the processor, the above method embodiments are implemented.
  • a program which is stored in a storage medium and includes several instructions to make a device ( It may be a single chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
  • This embodiment provides a CPU resource scheduling method and electronic device, which reduces the complexity of configuring nodes without affecting the service effect of nodes, and reduces the scheduling dimension of CPU resources and the threshold for using exclusive CPU resources. It also realizes flexible scheduling of shared CPU and exclusive CPU resources, which improves the CPU resource utilization efficiency of nodes.
  • the embodiments of the present disclosure configure all CPU cores on each node as shared CPU cores, and use the number of shared CPU cores of each node as the number of available CPU cores of the node, without the need to configure an exclusive CPU and share CPU, reduces the complexity of configuring nodes; at the same time, only schedules CPU resources in the shared CPU dimension, and does not need to schedule CPU resources in the shared CPU and exclusive CPU dimensions at the same time, reducing the scheduling dimension of CPU resources; and then selects the number of available CPU cores greater than or A node equal to the number of application CPU cores is required as the deployment node, and the application is deployed to the deployment node to meet the application's CPU core requirements.
  • the number of exclusive CPU requirements of the application is selected from the shared CPU cores of the deployment node Share CPU cores and convert them to exclusive CPU cores for use.
  • the exclusive CPU cores assigned to the application to shared CPU cores, and realize the dynamic conversion of exclusive CPU cores and shared CPU cores according to the actual needs of the application. Therefore, at the level of scheduling, it is not necessary to pay attention to whether the container needs to share CPU cores or exclusive CPU cores, but it is combined as ordinary CPU cores for scheduling, which avoids the use of shared CPU cores and exclusive CPU cores as two resources in some cases.
  • Scheduling results in a situation where "one resource is insufficient, while another resource is largely idle and wasted", which greatly improves the utilization efficiency of CPU resources and the flexibility of scheduling. It also does not need to share CPU cores and monopolize the nodes due to modification The distribution of CPU cores requires a restart of the node's operating system, which lowers the threshold for exclusive use of CPU resources. At the same time, it avoids the migration or interruption of bearer services on the node and does not affect the service effect of the node.

Abstract

The embodiment of the present disclosure relates to the technical field of networks. The embodiment of the present disclosure provides a CPU resource scheduling method. The method comprises: configuring all CPU cores on various nodes to be shared CPU cores; selecting nodes satisfying the required quantity of CPU cores for an application as deployment nodes and deploying the application onto the deployment nodes; when an application start event is processed, converting a part of the shared CPU cores with an amount equal to the required quantity of exclusive CPU cores for the application into exclusive CPU cores for use by the application; and when an application exit event is processed, converting the exclusive CPU cores allocated to the application into shared CPU cores.

Description

一种CPU资源调度方法及电子设备CPU resource scheduling method and electronic equipment
本公开要求享有2018年11月29日提交的名称为“一种CPU资源调度方法及电子设备”的中国专利申请CN201811442355.0的优先权,其全部内容通过引用并入本文中。This disclosure claims the priority of the Chinese patent application CN201811442355.0 entitled "A CPU Resource Scheduling Method and Electronic Equipment" filed on November 29, 2018, the entire contents of which are incorporated herein by reference.
技术领域Technical field
本公开实施例涉及网络技术领域,特别涉及一种CPU资源调度方法及电子设备。Embodiments of the present disclosure relate to the field of network technology, and in particular, to a CPU resource scheduling method and electronic equipment.
背景技术Background technique
大数据时代下,社交网络、在线购物、物联网等会产生大量的实时数据流,如何快速分析这些实时数据成为大数据处理技术的一大挑战。分布式流数据处理系统是一类将实时流数据处理过程转换成多个小作业,在多个处理机器上并行执行的系统。基于小批次作业的分布式流数据处理系统将实时流数据按照时间间隔切分成一系列的小批次数据,然后对这些小批次数据进行处理,利用这种方式,该类型系统可以提供低延迟、高吞吐量的实时数据处理服务。随着云计算技术的发展和普及,将这类复杂的应用部署到云环境集群中成为趋势。In the era of big data, social networks, online shopping, and the Internet of Things will generate a large number of real-time data streams. How to quickly analyze these real-time data has become a big challenge for big data processing technology. A distributed streaming data processing system is a system that converts real-time streaming data processing into multiple small jobs and executes them in parallel on multiple processing machines. The distributed stream data processing system based on small batch operations divides the real-time stream data into a series of small batch data at time intervals, and then processes these small batch data. In this way, this type of system can provide low Delayed, high-throughput real-time data processing services. With the development and popularization of cloud computing technology, it has become a trend to deploy such complex applications into cloud environment clusters.
在一些情况中至少存在如下问题:在云环境集群中,各个节点往往需要预先配置独占CPU核和共享CPU核,配置较为复杂;且需将共享CPU核和独占CPU核作为两种资源进行调度,调度维度较高;且由于独占CPU核的使用门槛较高,往往会出现一种资源不足,而另一种资源大量闲置浪费的情况发生,导致CPU资源的利用效率不高;同时独占CPU核在节点操作系统启动以后就确定下来了,如果为了改善CPU资源的利用效率而修改节点上共享CPU核和独占CPU核的分配比例关系,则必须重新启动节点操作系统才可以生效。而在云环境集群中,节点操作系统的重启意味着节点上承载业务的迁移或者中断,不可能高频次执行,对节点的服务效果影响很大。In some cases, there are at least the following problems: In a cloud environment cluster, each node often needs to configure exclusive CPU cores and shared CPU cores in advance, and the configuration is more complicated; and the shared CPU cores and exclusive CPU cores need to be scheduled as two resources. The scheduling dimension is high; and because the threshold for exclusive use of CPU cores is high, one type of resources is often insufficient, and another type of resources is idle and wasted, resulting in inefficient utilization of CPU resources; at the same time, exclusive CPU cores are After the node operating system is started, it is determined. If the allocation ratio of shared CPU cores and exclusive CPU cores on the node is modified in order to improve the utilization efficiency of CPU resources, the node operating system must be restarted to take effect. In the cloud environment cluster, the restart of the node operating system means the migration or interruption of the services carried on the node, which cannot be executed at high frequency, which greatly affects the service effect of the node.
发明内容Summary of the invention
本公开实施方式的目的在于提供一种CPU资源调度方法及电子设备,使得在不影响节点服务效果的同时,降低了配置节点的复杂度,同时降低了CPU资源的调度维度以及对独占CPU资源的使用门槛,也实现了对共享CPU以及独占CPU资源的灵活调度,提高了节点的CPU资源利用效率。The purpose of the embodiments of the present disclosure is to provide a CPU resource scheduling method and an electronic device, so that the complexity of configuring nodes is reduced without affecting the service effect of nodes, and the scheduling dimension of CPU resources and the exclusive use of CPU resources are also reduced. The use threshold also realizes flexible scheduling of shared CPU and exclusive CPU resources, and improves the CPU resource utilization efficiency of nodes.
为解决上述技术问题,本公开的实施方式提供了一种CPU资源调度方法,包括:将各个节点上的全部CPU核均配置为共享CPU核,并将各个节点的共享CPU核数量作为该节点的 可用CPU核数量;接收并解析应用的CPU核需求数量,CPU核需求数量包括独占CPU需求数量和共享CPU核需求数量;选取可用CPU核数量大于或等于CPU核需求数量的节点作为部署节点、将执行所述应用的任务部署到部署节点;监控部署节点的应用启动事件及退出事件,在监控到部署节点的应用启动事件时,从部署节点的共享CPU核中选取与独占CPU需求数量相等的共享CPU核并转换为独占CPU核、将转换的独占CPU核分配给应用使用;在监控到部署节点的应用退出事件时,将分配给应用使用的独占CPU核转换为共享CPU核。To solve the above technical problems, the embodiments of the present disclosure provide a CPU resource scheduling method, including: configuring all CPU cores on each node as shared CPU cores, and taking the number of shared CPU cores of each node as the node’s The number of available CPU cores; the number of CPU cores required to receive and parse the application. The number of CPU cores required includes the number of exclusive CPU cores and the number of shared CPU cores. Deploy the task of the application to the deployment node; monitor the application startup event and exit event of the deployment node, and when the application startup event of the deployment node is monitored, select a share equal to the number of exclusive CPU requirements from the shared CPU core of the deployment node CPU cores are converted into exclusive CPU cores, and the converted exclusive CPU cores are allocated to the application; when monitoring the application exit event of the deployment node, the exclusive CPU cores allocated to the application are converted into shared CPU cores.
本公开的实施方式还提供了一种电子设备,包括至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行以实现上述CPU资源调度方法。An embodiment of the present disclosure also provides an electronic device including at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are at least one The processor executes to implement the above CPU resource scheduling method.
附图说明BRIEF DESCRIPTION
一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplarily illustrated by the pictures in the corresponding drawings. These exemplary descriptions do not constitute a limitation on the embodiments, and elements with the same reference numerals in the drawings represent similar elements. Unless otherwise stated, the figures in the drawings do not constitute a scale limitation.
图1是根据本公开第一实施方式中一种CPU资源调度方法的流程示意图;1 is a schematic flowchart of a CPU resource scheduling method according to the first embodiment of the present disclosure;
图2是根据本公开第二实施方式中一种CPU资源调度方法的流程示意图;2 is a schematic flowchart of a CPU resource scheduling method according to a second embodiment of the present disclosure;
图3是根据本公开第三实施方式中一种CPU资源调度方法的流程示意图;3 is a schematic flowchart of a CPU resource scheduling method according to a third embodiment of the present disclosure;
图4是根据本公开第三实施方式中共享CPU核和独占CPU核动态转换的流程示意图;4 is a schematic flow chart of dynamic conversion of shared CPU cores and exclusive CPU cores according to the third embodiment of the present disclosure;
图5是根据本公开第四实施方式中一种电子设备的结构示意图。5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present disclosure.
具体实施方式detailed description
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合附图对本公开的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本公开各实施方式中,为了使读者更好地理解本公开而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本公开所要求保护的技术方案。To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the embodiments of the present disclosure will be described in detail below in conjunction with the accompanying drawings. However, those of ordinary skill in the art can understand that in various embodiments of the present disclosure, in order to make the reader better understand the present disclosure, many technical details are proposed. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present disclosure can be realized.
本公开的第一实施方式涉及一种CPU资源调度方法,其具体的流程示意图如图1所示,具体包括:The first embodiment of the present disclosure relates to a CPU resource scheduling method. The specific flow diagram is shown in FIG. 1 and specifically includes:
步骤101:将各个节点上的全部CPU核均配置为共享CPU核,并将各个节点的共享CPU核数量作为该节点的可用CPU核数量。Step 101: All CPU cores on each node are configured as shared CPU cores, and the number of shared CPU cores of each node is used as the number of available CPU cores of the node.
在一个实施例中,现有的集群中通常需要预先规划独占CPU核,而本公开实施方式中将集群中各个节点上的全部CPU核均配置为共享CPU核。节点启动时,各个节点上全部CPU核均为共享CPU核,在集群调度器中只存在一种类型的CPU资源即共享CPU资源。初始状 态下,所有节点的可用CPU核数量都等于节点上报的共享CPU核数量,即:节点初始可用CPU核数量=节点上报共享CPU核数量。因此,在初始状态下各个节点的共享CPU核数量即为该节点的可用CPU核数量,在节点启动后,各个节点将自身的共享CPU核数量上报集群资源调度器。本实施方式中无需预先规划独占CPU核,降低了节点的复杂度并且降低了独占CPU资源的使用门槛。In one embodiment, the existing cluster usually needs to plan exclusive CPU cores in advance, and in the embodiment of the present disclosure, all CPU cores on each node in the cluster are configured as shared CPU cores. When a node starts, all CPU cores on each node are shared CPU cores, and there is only one type of CPU resource in the cluster scheduler, that is, shared CPU resources. In the initial state, the number of available CPU cores of all nodes is equal to the number of shared CPU cores reported by the node, that is: the number of initially available CPU cores of the node = the number of shared CPU cores reported by the node. Therefore, in the initial state, the number of shared CPU cores of each node is the number of available CPU cores of the node. After the node is started, each node reports its own number of shared CPU cores to the cluster resource scheduler. In this embodiment, it is not necessary to plan exclusive CPU cores in advance, which reduces the complexity of nodes and lowers the threshold for exclusive CPU resources.
步骤102:接收并解析应用的CPU核需求数量。Step 102: Receive and analyze the number of CPU core requirements of the application.
在一个实施例中,在有待执行的应用任务时,接收并解析应用的CPU核需求数量,应用总计CPU核数量=独占CPU核数量+共享CPU核数量。集群调度器需要解析应用的CPU核需求,确定应用的独占CPU核需求数量以及共享CPU核需求数量,以便后续根据应用的独占CPU核需求数量以及共享CPU核需求数量来为应用部署节点。In one embodiment, when there is an application task to be executed, the number of CPU core requirements of the application is received and analyzed, and the total number of CPU cores of the application = the number of exclusive CPU cores + the number of shared CPU cores. The cluster scheduler needs to analyze the application's CPU core requirements, determine the application's exclusive CPU core requirements and shared CPU core requirements, so as to subsequently deploy nodes for the application based on the application's exclusive CPU core requirements and shared CPU core requirements.
步骤103:选取可用CPU核数量大于或等于CPU核需求数量的节点作为部署节点、将执行所述应用的任务部署到部署节点。Step 103: Select a node whose available CPU core number is greater than or equal to the required number of CPU cores as a deployment node, and deploy the task of executing the application to the deployment node.
在一个实施例中,集群中各个节点将自身的共享CPU核数量上报给集群资源调度器,集群资源调度器得知集群中各个节点的可用CPU核数量,从而在接收到应用的CPU核需求数量时能够根据应用的CPU核需求数量选取满足该应用需求的节点来作为部署节点。将执行所述应用的任务部署到部署节点上,由该部署节点来执行应用的任务。In one embodiment, each node in the cluster reports the number of its own shared CPU cores to the cluster resource scheduler, and the cluster resource scheduler learns the number of available CPU cores of each node in the cluster, and thus receives the CPU core demand of the application According to the number of CPU core requirements of an application, a node that meets the application requirements can be selected as a deployment node. The task of executing the application is deployed to a deployment node, and the deployment node executes the task of the application.
步骤104:监控部署节点的应用启动事件及退出事件。若监控到应用的启动事件时,进入步骤105;若监控到退出事件,则进入步骤106。Step 104: Monitor the application startup event and exit event of the deployment node. If the startup event of the application is monitored, step 105 is entered; if the exit event is monitored, step 106 is entered.
步骤105:从部署节点的共享CPU核中选取与独占CPU需求数量相等的共享CPU核并转换为独占CPU核、将转换的独占CPU核分配给应用使用。Step 105: Select shared CPU cores equal to the number of exclusive CPU requirements from the shared CPU cores of the deployment node and convert them into exclusive CPU cores, and allocate the converted exclusive CPU cores to the application for use.
步骤106:在监控到部署节点的应用退出事件时,将分配给应用使用的独占CPU核转换为共享CPU核。Step 106: When the application exit event of the deployment node is monitored, the exclusive CPU core allocated to the application is converted into a shared CPU core.
针对上述步骤104至步骤106在一个实施例中,集群资源调度器监控部署节点的应用的启动事件和退出事件,若监控到部署节点的应用的启动事件时,从部署节点的共享CPU核中选取与该应用的独占CPU核需求数量相等的共享CPU核并转换为独占CPU核,将转换后的独占CPU核分配给应用使用。当监控到部署节点的应用退出事件时,节点的独占CPU核无需再执行应用的任务,此时,将分配给应用使用的独占CPU核再转换为共享CPU核。动态地将对应数量的共享CPU核转换为独占CPU核,从而在调度的层面上就不需要关注容器需要的是共享CPU核还是独占CPU核,合并作为普通CPU核需求进行调度,避免了一些情况中将共享CPU核和独占CPU核作为两种资源进行调度而导致一种资源不足,而另一种资源大量闲置浪费的情况发生,大大提高了CPU资源的利用效率以及调度的灵活性。同时也不会出现一些情况中预先配置好独占CPU核后,修改节点上共享CPU核和独占CPU核的分配比 例关系而需重启节点操作系统的情况发生,避免了由于修改节点上共享CPU核和独占CPU核的分配比例关系而导致节点上承载业务的迁移或中断,提高了节点的服务效果。With respect to the above steps 104 to 106 in one embodiment, the cluster resource scheduler monitors the startup event and exit event of the application of the deployment node, and if the startup event of the application of the deployment node is monitored, it is selected from the shared CPU cores of the deployment node Shared CPU cores equal to the number of exclusive CPU cores required by the application are converted into exclusive CPU cores, and the converted exclusive CPU cores are allocated to the application for use. When the application exit event of the deployed node is monitored, the node's exclusive CPU core no longer needs to execute the application's task. At this time, the exclusive CPU core allocated to the application is converted into a shared CPU core. Dynamically convert the corresponding number of shared CPU cores to exclusive CPU cores, so that at the level of scheduling, there is no need to pay attention to whether the container needs shared CPU cores or exclusive CPU cores, and merge and schedule as ordinary CPU cores to avoid some situations. In the case of scheduling shared CPU cores and exclusive CPU cores as two types of resources, one type of resources is insufficient, and the other type of resources is idle and wasted, which greatly improves the utilization efficiency of CPU resources and the flexibility of scheduling. At the same time, in some cases, after the exclusive CPU cores are pre-configured, it is necessary to restart the node operating system to modify the distribution relationship between the shared CPU cores and the exclusive CPU cores on the node, avoiding the modification of the shared CPU cores on the node and the The exclusive distribution of the relationship between CPU cores leads to the migration or interruption of the services carried on the node, which improves the service effect of the node.
在一个实施例中,将执行应用的任务部署到部署节点之后,还包括:更新部署节点的可用CPU核数量。以便集群资源调度器能够在将应用的任务部署之后得到实时的各个节点的实际可用CPU核数量,方便后续资源调度器为各个节点部署应用的任务。In one embodiment, after the task of executing the application is deployed to the deployment node, the method further includes: updating the number of available CPU cores of the deployment node. So that the cluster resource scheduler can obtain the real-time actual number of available CPU cores of each node after the application task is deployed, and it is convenient for the subsequent resource scheduler to deploy the application task for each node.
在一个实施例中,在将执行应用的任务部署到部署节点之后,还包括:监控部署节点的任务执行状态,并在部署节点的任务执行完成或任务执行异常终止之后,更新部署节点的可用CPU核数量。以便集群资源调度器能够在将部署节点的任务执行完成或任务执行异常终止之后得到实时的各个节点的实际可用CPU核数量,方便后续资源调度器为各个节点部署应用的任务。In one embodiment, after the task of executing the application is deployed to the deployment node, the method further includes: monitoring the task execution status of the deployment node, and updating the available CPU of the deployment node after the task execution of the deployment node is completed or the task execution is abnormally terminated The number of cores. So that the cluster resource scheduler can obtain the real-time actual number of available CPU cores of each node after the task execution of the deployment node is completed or the task execution is abnormally terminated, which is convenient for subsequent resource schedulers to deploy application tasks for each node.
在选取可用CPU数量大于或等于CPU需求数量的节点作为部署节点、将执行所述应用的任务部署到部署节点之后,还包括步骤:更新部署节点的可用CPU数量。具体包括:将部署节点被部署应用之前的可用CPU数量与CPU需求数量的差值作为更新后的、部署节点的可用CPU数量。具体地说,在为部署节点部署应用之后,及时更新该部署节点的可用CPU核数量,以便集群资源调度器能够得到实时的各个节点的实际可用CPU核数量,方便后续资源调度器为各个节点部署应用。After selecting a node whose available CPU quantity is greater than or equal to the CPU demand quantity as the deployment node, and deploying the task of executing the application to the deployment node, the method further includes the step of: updating the available CPU quantity of the deployment node. Specifically, the difference between the number of available CPUs before the deployment node is deployed and the number of CPU requirements is used as the updated number of available CPUs of the deployment node. Specifically, after the application is deployed for the deployment node, the number of available CPU cores of the deployment node is updated in time, so that the cluster resource scheduler can obtain the real-time actual number of available CPU cores of each node, which is convenient for subsequent resource schedulers to deploy for each node application.
在一个实施例中,在将分配给应用使用的独占CPU转换为共享CPU之后,还包括步骤:更新部署节点的可用CPU数量。具体包括:将部署节点被部署应用之后的可用CPU数量与CPU需求数量的和作为更新后的、部署节点的可用CPU数量。具体地说,当监控到部署节点的应用退出事件时,节点的独占CPU核无需再执行应用的任务,此时,重新更新该部署节点的可用CPU核数量,将部署节点被部署应用之后的可用CPU核数量与CPU核需求数量的和作为更新后的、部署节点的可用CPU核数量,以便在该部署节点的当前任务结束后,及时更新当前可用的CPU核数量,方便后续资源调度器为各个节点部署应用。In one embodiment, after converting the exclusive CPU allocated to the application to the shared CPU, the method further includes the step of: updating the number of available CPUs of the deployment node. Specifically, the sum of the number of available CPUs and the number of CPU requirements after the deployment node is deployed as the updated number of available CPUs of the deployment node. Specifically, when the application exit event of the deployment node is monitored, the exclusive CPU core of the node does not need to perform the task of the application. At this time, the number of available CPU cores of the deployment node is updated again to make the deployment node available after the application is deployed The sum of the number of CPU cores and the number of CPU core requirements is the updated number of available CPU cores of the deployment node, so that after the current task of the deployment node ends, the current number of available CPU cores is updated in time to facilitate subsequent resource schedulers for each Node deployment application.
下面以典型的集群和应用信息为例来说明本实施方式与一些情况的区别:The following uses typical cluster and application information as examples to illustrate the differences between this embodiment and some cases:
典型集群和应用信息如下表1所示:Typical cluster and application information is shown in Table 1 below:
表1Table 1
Figure PCTCN2019119125-appb-000001
Figure PCTCN2019119125-appb-000001
Figure PCTCN2019119125-appb-000002
Figure PCTCN2019119125-appb-000002
下面分别描述在集群应用任务调度时,两种模式的执行流程。The following describes the execution flow of the two modes when scheduling tasks in a cluster application.
一些情况中静态独占CPU方案下集群应用调度流程如下:In some cases, the scheduling process of the cluster application under the static exclusive CPU solution is as follows:
初始化过程;MASTER和NODE1、NODE2建立连接;在NODE1节点上全部32个CPU中20个作为共享CPU,12个作为独占CPU上报给MASTER节点。在NODE2节点上全部48个CPU中30个作为共享CPU,18个作为独占CPU上报给MASTER。从MASTER角度看,集群中总计拥有50个共享CPU、30个独占CPU。初始化状态表如下表2所示:Initialization process; MASTER establishes a connection with NODE1 and NODE2; 20 of the 32 CPUs on the NODE1 node are used as shared CPUs, and 12 are reported as exclusive CPUs to the MASTER node. Of the 48 CPUs on the NODE2 node, 30 are shared CPUs and 18 are reported to MASTER as exclusive CPUs. From the perspective of MASTER, there are 50 shared CPUs and 30 exclusive CPUs in the cluster. The initialization state table is shown in Table 2 below:
表2Table 2
Figure PCTCN2019119125-appb-000003
Figure PCTCN2019119125-appb-000003
(1)普通应用容器的调度过程如下:(1) The scheduling process of common application containers is as follows:
在集群无服务条件下,部署15个CONTAINER1容器,调度器会根据两个节点上可用共享CPU的比例关系在NODE1上部署6个CONTAINER1容器,NODE2上部署9个CONTAINER1容器。更新后的状态表如表3所示:Under the condition of no service in the cluster, deploy 15 CONTAINER1 containers. The scheduler will deploy 6 CONTAINER1 containers on NODE1 and 9 CONTAINER1 containers on NODE2 according to the proportion of shared CPUs available on the two nodes. The updated status table is shown in Table 3:
表3table 3
Figure PCTCN2019119125-appb-000004
Figure PCTCN2019119125-appb-000004
继续部署4个CONTAINER2容器,调度器会在NODE1部署1个CONTAINER2容器在NODE2上各部署2个CONTAINER2容器,还有1个CONTAINER2容器因为资源不足无法部署。更新后的状态表如表4所示:Continue to deploy 4 CONTAINER2 containers, the scheduler will deploy 1 CONTAINER2 container on NODE1, 2 CONTAINER2 containers on NODE2, and 1 CONTAINER2 container cannot be deployed due to insufficient resources. The updated status table is shown in Table 4:
表4Table 4
Figure PCTCN2019119125-appb-000005
Figure PCTCN2019119125-appb-000005
通过以上流程可以看到,CONTAINER1和CONTAINER2没有独占CPU需求,本集群中预规划的独占CPU资源全部闲置。It can be seen from the above process that CONTAINER1 and CONTAINER2 have no exclusive CPU requirements, and all the pre-planned exclusive CPU resources in this cluster are idle.
(2)高性能应用容器的调度过程如下:(2) The scheduling process of high-performance application containers is as follows:
在集群无服务的条件下,部署10个CONTAINER3容器。调度器会根据两个节点上可用共享CPU的比例关系在NODE1部署4个CONTAINER3容器,NODE2上部署6个CONTAINER3容器。更新后的状态表如表5所示:Under the condition of no service in the cluster, deploy 10 CONTAINER3 containers. The scheduler will deploy 4 CONTAINER3 containers on NODE1 and 6 CONTAINER3 containers on NODE2 according to the proportion of shared CPUs available on the two nodes. The updated status table is shown in Table 5:
表5table 5
Figure PCTCN2019119125-appb-000006
Figure PCTCN2019119125-appb-000006
继续部署3个CONTAINER4,调度器会在NODE1部署1个CONTAINER4容器在NODE2上各部署1个CONTAINER4容器,还有1个CONTAINER4容器因为资源不足无法部署。更新后的状态表如表6所示:Continue to deploy 3 CONTAINER4. The scheduler will deploy 1 CONTAINER4 container on NODE1 and 1 CONTAINER4 container on NODE2, and 1 CONTAINER4 container cannot be deployed due to insufficient resources. The updated status table is shown in Table 6:
表6Table 6
Figure PCTCN2019119125-appb-000007
Figure PCTCN2019119125-appb-000007
Figure PCTCN2019119125-appb-000008
Figure PCTCN2019119125-appb-000008
通过以上流程可以看到,CONTAINER3和CONTAINER4的部署数量最终受到独占CPU资源的限制,导致集群中独占资源紧张和共享资源确大量闲置的情况。Through the above process, it can be seen that the number of deployments of CONTAINER3 and CONTAINER4 is ultimately limited by the exclusive CPU resources, resulting in a situation of tight exclusive resources and a large amount of shared resources in the cluster.
通过以上两种普通应用容器和高性能应用容器的部署流程可以得到,由于集群中往往需要将共享CPU核和独占CPU核作为两种资源进行调度,不可避免的在一些场景下会导致一种资源不足,而另一种资源却大量闲置浪费的情况发生。It can be obtained through the above two common application container and high-performance application container deployment processes. Since clusters often need to use shared CPU cores and exclusive CPU cores as two resources for scheduling, it is inevitable that in some scenarios will result in a resource Insufficient, and another kind of resources is a lot of idle waste occurs.
本公开实施方式中动态独占CPU方案下集群中应用容器调度流程如下:In the embodiment of the present disclosure, the scheduling process of the application container in the cluster under the dynamic exclusive CPU solution is as follows:
初始化过程;MASTER和NODE1、NODE2建立连接;在NODE1节点上全部32个CPU中32个作为共享CPU上报给MASTER节点,在NODE2节点上全部48个CPU中48个作为共享CPU上报给MASTER,从MASTER角度看,集群中总计拥有80个共享CPU,0个独占CPU核。初始状态下的状态表如表7所示:Initialization process; MASTER establishes a connection with NODE1 and NODE2; 32 of the 32 CPUs on the NODE1 node are reported to the MASTER node as shared CPUs, and 48 of the 48 CPUs on the NODE2 node are reported to the MASTER as shared CPUs From a perspective, the cluster has a total of 80 shared CPUs and 0 exclusive CPU cores. The state table in the initial state is shown in Table 7:
表7Table 7
Figure PCTCN2019119125-appb-000009
Figure PCTCN2019119125-appb-000009
(1)普通应用容器的调度过程如下:(1) The scheduling process of common application containers is as follows:
在集群无服务条件下,部署15个CONTAINER1容器,调度器会根据两个节点上可用共享CPU的比例关系在NODE1部署6个CONTAINER1容器,NODE2上部署9个CONTAINER1容器。更新状态后的状态表如表8所示:Under the condition of no service in the cluster, deploy 15 CONTAINER1 containers. The scheduler will deploy 6 CONTAINER1 containers on NODE1 and 9 CONTAINER1 containers on NODE2 according to the proportion of shared CPUs available on the two nodes. The state table after updating the state is shown in Table 8:
表8Table 8
Figure PCTCN2019119125-appb-000010
Figure PCTCN2019119125-appb-000010
继续部署4个CONTAINER2容器,调度器会在NODE1部署2个CONTAINER2容器,在NODE2上部署2个CONTAINER2容器,还有足够的资源部署3个CONTAINER2容器。更新状态后的状态表如表9所示:Continue to deploy 4 CONTAINER2 containers, the scheduler will deploy 2 CONTAINER2 containers on NODE1, 2 CONTAINER2 containers on NODE2, and enough resources to deploy 3 CONTAINER2 containers. The state table after updating the state is shown in Table 9:
表9Table 9
Figure PCTCN2019119125-appb-000011
Figure PCTCN2019119125-appb-000011
通过以上流程可以看到,CONTAINER1和CONTAINER2没有独占CPU需求,本集群中全部CPU资源都被作为共享CPU使用,不存在闲置的场景。Through the above process, you can see that CONTAINER1 and CONTAINER2 do not have exclusive CPU requirements. All CPU resources in this cluster are used as shared CPUs, and there is no idle scenario.
(2)高性能应用容器的调度过程如下:(2) The scheduling process of high-performance application containers is as follows:
在集群无服务的条件下,部署10个CONTAINER3容器。调度器会根据两个节点上可用共享CPU的比例关系在NODE1部署4个CONTAINER3容器,NODE2上部署6个CONTAINER3容器。更新状态后的状态表如表10所示:Under the condition of no service in the cluster, deploy 10 CONTAINER3 containers. The scheduler will deploy 4 CONTAINER3 containers on NODE1 and 6 CONTAINER3 containers on NODE2 according to the proportion of shared CPUs available on the two nodes. The state table after updating the state is shown in Table 10:
表10Table 10
Figure PCTCN2019119125-appb-000012
Figure PCTCN2019119125-appb-000012
继续部署3个CONTAINER4,调度器会在NODE1部署1个CONTAINER4容器,在NODE2上部署2个CONTAINER4容器,还有足够资源可以部署3个CONTAINER4。更新 状态后的状态表如表11所示:Continue to deploy 3 CONTAINER4, the scheduler will deploy 1 CONTAINER4 container on NODE1, 2 CONTAINER4 containers on NODE2, and enough resources to deploy 3 CONTAINER4. The updated state table is shown in Table 11:
表11Table 11
Figure PCTCN2019119125-appb-000013
Figure PCTCN2019119125-appb-000013
通过以上流程可以看到,CONTAINER3和CONTAINER4的部署过程中,系统会根据容器实际的独占CPU数量需求,动态将节点上对应数量的共享CPU转换为独占CPU。Through the above process, we can see that during the deployment of CONTAINER3 and CONTAINER4, the system will dynamically convert the corresponding number of shared CPUs on the nodes into exclusive CPUs based on the actual number of exclusive CPUs required by the container.
通过以上两种普通应用容器和高性能应用容器的部署流程可以得到,本实施方式中动态独占CPU核的方法,在调度的层面上不需要关注容器需要的是共享CPU还是独占CPU,合并作为普通CPU需求进行调度,从而在调度层提高了集群中CPU资源的利用效率,规避了以前不可避免的CPU资源闲置问题,提高了CPU资源的利用效率。It can be obtained through the above two common application container and high-performance application container deployment processes. In this embodiment, the method of dynamically monopolizing the CPU core does not need to pay attention to whether the container needs to share the CPU or the exclusive CPU at the scheduling level. CPU needs to be scheduled, thereby improving the utilization efficiency of CPU resources in the cluster at the scheduling layer, circumventing the inevitable problem of idle CPU resources in the past, and improving the utilization efficiency of CPU resources.
与一些情况相比,本实施方式中提供了一种CPU资源调度方法,将各个节点上的全部CPU核均配置为共享CPU核、并将各个节点的共享CPU核数量作为该节点的可用CPU核数量,无需配置独占CPU和共享CPU,降低了配置节点的复杂度;同时仅在共享CPU维度调度CPU资源,无需同时在共享CPU和独占CPU维度上调度CPU资源,降低了CPU资源的调度维度;然后选取可用CPU核数量大于或等于应用CPU核需求数量的节点作为部署节点、将应用部署到部署节点以满足应用的CPU核需求,应用启动事件时,从部署节点的共享CPU核中选取与应用的独占CPU需求数量相等的共享CPU核、并转换为独占CPU核供应用使用,应用退出事件时,将分配给应用使用的独占CPU核转换为共享CPU核,根据应用实际需要实现独占CPU核与共享CPU核的动态转换,从而在调度的层面上不需要关注容器需要的是共享CPU核还是独占CPU核,而是合并作为普通CPU核需求进行调度,避免了一些情况中将共享CPU核和独占CPU核作为两种资源进行调度而导致“一种资源不足,而另一种资源大量闲置浪费”的情况发生,大大提高了CPU资源的利用效率以及调度的灵活性,同时也不需要因修改节点上共享CPU核和独占CPU核的分配比例关系而需重启节点操作系统,降低了独占CPU资源的使用门槛,同时避免了节点上承载业务的迁移或中断,不影响节点的服务效果。Compared with some cases, this embodiment provides a CPU resource scheduling method, all CPU cores on each node are configured as shared CPU cores, and the number of shared CPU cores of each node is used as the available CPU core of the node Number, no need to configure exclusive CPU and shared CPU, reducing the complexity of configuring nodes; at the same time, CPU resources are only scheduled in the shared CPU dimension, and there is no need to schedule CPU resources in the shared CPU and exclusive CPU dimension, which reduces the scheduling dimension of CPU resources Then select the node with the number of available CPU cores greater than or equal to the number of application CPU cores as the deployment node, deploy the application to the deployment node to meet the application's CPU core demand, and select and apply from the shared CPU core of the deployment node when the application starts an event The number of shared CPU cores with the same number of exclusive CPU requirements is converted to exclusive CPU cores for use. When the application exits, the exclusive CPU cores allocated to the application are converted to shared CPU cores. According to the actual needs of the application, the exclusive CPU cores are Dynamic conversion of shared CPU cores, so that at the level of scheduling, it is not necessary to pay attention to whether the container needs shared CPU cores or exclusive CPU cores, but merged as ordinary CPU core requirements for scheduling, avoiding some cases of sharing CPU cores and exclusive CPU cores are scheduled as two kinds of resources, resulting in a situation where "one resource is insufficient, and the other resource is largely idle and wasted", which greatly improves the utilization efficiency of CPU resources and the flexibility of scheduling. On the shared CPU core and exclusive CPU core allocation ratio relationship, the node operating system needs to be restarted, which reduces the threshold for exclusive CPU resources, and avoids the migration or interruption of the bearer service on the node, which does not affect the service effect of the node.
本公开的第二实施方式涉及一种CPU资源调度方法。第二实施方式是对第一实施方式的改进,主要改进之处在于:在本实施方式中,提供了一种获取应用CPU核需求数量的具体实现方式。The second embodiment of the present disclosure relates to a CPU resource scheduling method. The second embodiment is an improvement on the first embodiment. The main improvement is that: in this embodiment, a specific implementation manner for obtaining the number of CPU core requirements of an application is provided.
本实施方式中的CPU资源调度方法的具体流程示意图如图2所示,具体包括:The specific flowchart of the CPU resource scheduling method in this embodiment is shown in FIG. 2 and specifically includes:
步骤201:将各个节点上的全部CPU核均配置为共享CPU核,并将各个节点的共享CPU核数量作为该节点的可用CPU核数量。Step 201: All CPU cores on each node are configured as shared CPU cores, and the number of shared CPU cores of each node is used as the number of available CPU cores of the node.
上述步骤201与第一实施方式中的步骤101大致相同,在此不进行赘述。The above step 201 is substantially the same as step 101 in the first embodiment, and will not be repeated here.
步骤202:查询应用的配置信息。Step 202: Query the configuration information of the application.
步骤203:根据配置信息确定独占CPU需求数量。Step 203: Determine the number of exclusive CPU requirements according to the configuration information.
针对上述步骤202和步骤203在一个实施例中,集群中资源调度器在获取各个节点的可用CPU核数量之后,在部署应用之前,查询应用的配置信息,应用的配置信息中包含该应用对CPU核的需求描述,集群资源调度器便可根据配置信息中的描述来确定该应用的独占CPU核数目和共享CPU核数目,方便后续为该应用动态分配独占CPU核。For the above steps 202 and 203, in one embodiment, after obtaining the number of available CPU cores of each node, the resource scheduler in the cluster queries the configuration information of the application before deploying the application, and the configuration information of the application includes the CPU of the application. According to the description of core requirements, the cluster resource scheduler can determine the number of exclusive CPU cores and the number of shared CPU cores of the application according to the description in the configuration information, which is convenient for the subsequent dynamic allocation of exclusive CPU cores for the application.
步骤204:选取可用CPU核数量大于或等于CPU核需求数量的节点作为部署节点、将执行所述应用的任务部署到部署节点。Step 204: Select a node whose available CPU core number is greater than or equal to the required number of CPU cores as the deployment node, and deploy the task of executing the application to the deployment node.
上述步骤204与第一实施方式中的步骤103大致相同,在此不再进行赘述。The above step 204 is substantially the same as step 103 in the first embodiment, and will not be repeated here.
步骤205:将应用中无需独占CPU核的任务交给部署节点的操作系统进行调度。Step 205: Hand over tasks that do not require exclusive CPU cores in the application to the operating system of the deployment node for scheduling.
在一个实施例中,集群资源调度器在根据应用的所需CPU核数目将执行所述应用的任务部署到部署节点之后,资源调取器将应用中需要独占CPU核的任务交由转换后的独占CPU核来进行处理,而应用中无需独占CPU核的任务则直接交由该应用的部署节点的操作系统来进行调度,让部署节点的操作系统来选择由该部署节点的哪些共享CPU核来处理应用中无需独占CPU核的任务,实现了对该部署节点内共享CPU核的灵活调用。In one embodiment, after the cluster resource scheduler deploys the task that executes the application to the deployment node according to the number of required CPU cores of the application, the resource retriever hands over the task that requires exclusive CPU cores in the application to the converted Exclusive CPU cores are used for processing, and tasks that do not require exclusive CPU cores in the application are directly scheduled by the operating system of the deployment node of the application for scheduling, and the operating system of the deployment node selects which shared CPU cores of the deployment node It does not need to monopolize the CPU core in the application, and realizes the flexible call to the shared CPU core in the deployment node.
步骤206:监控部署节点的应用启动事件及退出事件。若监控到应用的启动事件时,进入步骤207;若监控到退出事件,则进入步骤208。Step 206: Monitor the application startup event and exit event of the deployment node. If the startup event of the application is monitored, step 207 is entered; if the exit event is monitored, step 208 is entered.
步骤207:在监控到所述部署节点的应用启动事件时,从部署节点的共享CPU核中选取与独占CPU需求数量相等的共享CPU核并转换为独占CPU核、将转换的独占CPU核分配给应用使用。Step 207: When the application start event of the deployment node is monitored, select the shared CPU cores equal to the exclusive CPU demand from the shared CPU cores of the deployment node and convert to exclusive CPU cores, and assign the converted exclusive CPU cores to Application use.
步骤208:在监控到部署节点的应用退出事件时,将分配给应用使用的独占CPU核转换为共享CPU核。Step 208: When the application exit event of the deployment node is monitored, convert the exclusive CPU core allocated to the application to a shared CPU core.
上述步骤206至步骤208与第一实施方式中的步骤104至步骤106大致相同,在此不再进行赘述。The above steps 206 to 208 are substantially the same as the steps 104 to 106 in the first embodiment, and will not be repeated here.
与一些情况相比,本实施方式中提供了一种CPU资源调度方法,提出了一种获取应用 CPU核需求数量的具体实现方式,根据应用的配置信息来获取应用CPU核需求数量。且应用中无需独占CPU核的任务则直接交由该应用的部署节点的操作系统来进行调度,让部署节点的操作系统来选择由该部署节点的哪些共享CPU核来处理应用中无需独占CPU核的任务,实现了对该部署节点内共享CPU核的灵活调用。Compared with some cases, this embodiment provides a CPU resource scheduling method, and proposes a specific implementation method for obtaining the number of application CPU cores, and obtains the number of application CPU cores according to the configuration information of the application. And tasks that do not require exclusive CPU cores in the application are directly dispatched to the operating system of the deployment node of the application for scheduling, and the operating system of the deployment node selects which shared CPU cores of the deployment node to process the application without exclusive CPU cores The task of implementing the flexible call to the shared CPU core in the deployment node.
本公开的第三实施方式涉及一种CPU资源调度方法。第三实施方式是对第一实施方式的改进,主要改进之处在于:本实施方式中提出来一种确定以及转换独占CPU核的具体实现方式。The third embodiment of the present disclosure relates to a CPU resource scheduling method. The third embodiment is an improvement on the first embodiment, and the main improvement lies in: a specific implementation manner for determining and converting an exclusive CPU core is proposed in this embodiment.
本实施方式中的一种CPU资源调度方法的具体流程示意图如图3所示,具体包括:A specific process schematic diagram of a CPU resource scheduling method in this embodiment is shown in FIG. 3, and specifically includes:
步骤301:将各个节点上的全部CPU核均配置为共享CPU核,并将各个节点的共享CPU核数量作为该节点的可用CPU核数量。Step 301: All CPU cores on each node are configured as shared CPU cores, and the number of shared CPU cores of each node is used as the number of available CPU cores of the node.
步骤302:接收并解析应用的CPU核需求数量。Step 302: Receive and analyze the number of CPU core requirements of the application.
步骤303:选取可用CPU核数量大于或等于CPU核需求数量的节点作为部署节点、将执行所述应用的任务部署到部署节点。Step 303: Select a node whose available CPU core number is greater than or equal to the required number of CPU cores as the deployment node, and deploy the task of executing the application to the deployment node.
上述步骤301至步骤303与第一实施方式中的步骤101及步骤103大致相同,在此不再进行赘述。The above steps 301 to 303 are substantially the same as steps 101 and 103 in the first embodiment, and will not be repeated here.
步骤304:监控部署节点的应用启动事件及退出事件。若监控到应用的启动事件时,进入步骤305;若监控到退出事件,则进入步骤309。Step 304: Monitor the application startup event and exit event of the deployment node. If the startup event of the application is monitored, step 305 is entered; if the exit event is monitored, step 309 is entered.
步骤305:确定与独占CPU需求数量相等的、需要转换为独占CPU核的部署节点的CPU核的ID。Step 305: Determine the ID of the CPU core of the deployment node that is equal to the number of exclusive CPU requirements and needs to be converted into the exclusive CPU core.
步骤306:根据独占CPU需求数量,确定与独占CPU需求数量相等的、部署节点的共享CPU核的ID作为待转换CPU核的ID。Step 306: According to the number of exclusive CPU requirements, determine the ID of the shared CPU core of the deployed node equal to the number of exclusive CPU requirements as the ID of the CPU core to be converted.
步骤307:将部署节点上、与待转换CPU核ID对应的共享CPU核转换为独占CPU核。Step 307: Convert the shared CPU core corresponding to the CPU core ID to be converted on the deployment node into an exclusive CPU core.
步骤308:将转换的独占CPU核分配给应用使用。Step 308: Assign the converted exclusive CPU core to the application.
针对上述步骤305和步骤308在一个实施例中,针对集群中应用启动事件的处理如下:(1)查询应用配置信息,确定应用的独占CPU需求数量,并将无需独占CPU的任务交给操作系统进行调度;(2)确定部署节点中需要转换为独占CPU的CPU核数量、需要转换为独占CPU核的部署节点的CPU核的ID;(3)将部署节点上特定ID的CPU核转换为独占CPU核(数量为该部署节点上应用所需求的独占CPU数量);(4)将转换的独占CPU核分配给应用使用。With respect to the above steps 305 and 308, in one embodiment, the processing for the application startup event in the cluster is as follows: (1) Query application configuration information, determine the number of exclusive CPU requirements of the application, and hand over tasks that do not require exclusive CPU to the operating system Perform scheduling; (2) Determine the number of CPU cores in the deployment node that need to be converted to exclusive CPUs, and the ID of the CPU cores of the deployment nodes that need to be converted to exclusive CPU cores; (3) Convert the CPU cores of specific IDs on the deployment nodes to exclusive CPU cores (the number is the number of exclusive CPUs required by the application on the deployment node); (4) Assign the converted exclusive CPU cores to the application.
在一个实施例中,在上述第(2)步骤中,可以直接将部署节点上负载最轻的共享CPU核的ID作为待转换CPU核的ID。直接由任务最少,负载最轻的共享CPU核来处理该部署 节点上应用所需要独占CPU核的任务,提供了CPU转换目标的一种选取策略,不仅提高了调度CPU核的速度,同时也加快了任务的处理效率。In one embodiment, in step (2) above, the ID of the shared CPU core with the lightest load on the deployment node may be directly used as the ID of the CPU core to be converted. The shared CPU core with the fewest tasks and the lightest load directly handles the task of monopolizing the CPU core required by the application on the deployment node, providing a selection strategy for CPU conversion goals, which not only improves the speed of scheduling CPU cores, but also speeds up Task processing efficiency.
在一个实施例中,将部署节点上、与待转换CPU核ID对应的共享CPU核转换为独占CPU核之后,还包括:将独占CPU核上的负载迁移到其他共享CPU核上。在上述第(3)步骤后,还可以将转换为独占CPU核上之前处理的任务进程迁移到其他共享CPU核上,由其他共享CPU核来进行处理,迁移原本运行在“转换的独占CPU”上的进程/任务,为应用独占CPU做准备,同时使得节点内CPU核的调度更加具备灵活性。In one embodiment, after the shared CPU core corresponding to the CPU core ID to be converted on the deployment node is converted into an exclusive CPU core, the method further includes: migrating the load on the exclusive CPU core to other shared CPU cores. After step (3) above, you can also migrate the task process that was previously processed on the exclusive CPU core to another shared CPU core, which will be processed by the other shared CPU core. The migration was originally run on the "converted exclusive CPU" The above processes/tasks are prepared for the application to monopolize the CPU, and at the same time make the scheduling of CPU cores in the node more flexible.
在一个实施例中,将转换的独占CPU核信息传递给应用、使用CONTROL GROUP确保只有归属的应用可使用转换的独占CPU核,具体包括:根据应用的独占CPU描述,将应用绑定到所述转换的独占CPU核上。在一个实施例中,将转换的独占CPU核信息传递给应用,可利用独占CPU核的环境变量或配置文件将转换的独占CPU核信息传递给应用。使用CONTROL GROUP(控制组)来确保只有归属的应用可使用转换的独占CPU核。在一个实施例中,将应用绑定到转换的独占CPU上,提供了一种使用CONTROL GROUP确保CPU独占的具体实现方案,该种实现方式依赖于应用信息中指明的绑定策略。In one embodiment, the converted exclusive CPU core information is passed to the application, and CONTROL GROUP is used to ensure that only the belonging application can use the converted exclusive CPU core, which specifically includes: binding the application to the application according to the application's exclusive CPU description Convert the exclusive CPU core. In one embodiment, the converted exclusive CPU core information is transferred to the application, and the converted exclusive CPU core information may be transferred to the application using the environment variable or configuration file of the exclusive CPU core. Use CONTROLGROUP (control group) to ensure that only the belonging application can use the converted exclusive CPU core. In one embodiment, the application is bound to the converted exclusive CPU, and a specific implementation solution that uses CONTROL GROUP to ensure CPU exclusive is provided, and this implementation depends on the binding strategy specified in the application information.
步骤309:将分配给应用使用的独占CPU核转换为共享CPU核。Step 309: Convert the exclusive CPU core allocated to the application to a shared CPU core.
具体地说,集群中应用退出事件的处理如下:(1)将分配给应用容器的独占CPU核转换为共享CPU;(2)集群调度器监控下发给节点的任务执行状态,在下发给节点的任务结束(包括正常完成和异常终止)以后,更新集群上对应节点的可用CPU数量。即:节点的可用CPU核数量=节点当前可用CPU核数量+节点结束任务需求CPU核数量。Specifically, the processing of application exit events in the cluster is as follows: (1) Convert the exclusive CPU core assigned to the application container into a shared CPU; (2) The cluster scheduler monitors the task execution status sent to the node and sends it to the node After the task ends (including normal completion and abnormal termination), update the number of available CPUs of the corresponding nodes on the cluster. That is: the number of available CPU cores of the node = the number of currently available CPU cores of the node + the number of CPU cores required by the node to end the task.
下面将结合说明书附图4较为详细的描述在节点上动态将共享CPU核和独占CPU核相互转换的流程:The process of dynamically converting shared CPU cores and exclusive CPU cores on a node will be described in more detail with reference to FIG. 4 of the specification:
(1)节点启动时,全部CPU核作为共享CPU核进行调度,并监控系统中/PROC目录下特定文件,初始时独占CPU核ID列表为空,获取应用的独占CPU核需求信息;(1) When the node starts, all CPU cores are scheduled as shared CPU cores, and monitor specific files in the /PROC directory in the system. Initially, the exclusive CPU core ID list is empty, and the application's exclusive CPU core demand information is obtained;
(2)节点上业务需要独占CPU核时,在系统/PROC目录下特定文件中描述需要独占CPU核的ID列表。以一个节点为例,具体的说:根据该节点系统/PROC目录下特定文件的需求描述配置PROC参数,转化为CPUMASK(即独占CPU核的ID掩码);之后,判断CPUMASK是否合法,若合法,则判断CPUMASK是否为空,如果为空,则清除排他域(独占CPU核的集合),之后配置新的排他域(独占CPU核的集合),重构调度域(共享CPU核的集合)。若不为空,则配置新的排他域(独占CPU核的集合),重构调度域(共享CPU核的集合);(2) When the business on the node requires exclusive CPU cores, a list of IDs requiring exclusive CPU cores is described in a specific file in the system/PROC directory. Take a node as an example, specifically: configure PROC parameters according to the requirements of specific files in the system/PROC directory of the node, and convert it into CPUMASK (that is, the ID mask of the exclusive CPU core); after that, determine whether CPUMASK is legal, if it is legal , It is determined whether CPUMASK is empty, if it is empty, then clear the exclusive domain (exclusive collection of CPU cores), and then configure a new exclusive domain (exclusive collection of CPU cores), reconstruct the scheduling domain (shared collection of CPU cores). If it is not empty, configure a new exclusive domain (exclusive collection of CPU cores), and reconstruct the scheduling domain (collection of shared CPU cores);
(3)系统内核发现更新的独占CPU核ID列表,将列表中对应ID的CPU核在系统中设置为独占CPU核,更新操作系统后便可调度CPU核列表;(3) The system kernel finds the updated exclusive CPU core ID list, sets the CPU core corresponding to the ID in the list as the exclusive CPU core in the system, and can schedule the CPU core list after updating the operating system;
(4)将负载最低的CPU核列表的CPU核转换为独占CPU核,更新操作系统后可调度 CPU核列表,操作系统将无法继续调度进程到独占CPU核上;(4) Convert the CPU cores of the CPU core list with the lowest load to exclusive CPU cores. After updating the operating system, the CPU core list can be scheduled, and the operating system will not be able to continue scheduling processes to the exclusive CPU cores;
(5)将已经设置为独占CPU核上操作系统调度运行的进程迁移到其他共享CPU核上,以确保独占CPU核空闲,等待应用进程绑定使用;(5) Migrate the processes that have been set to run on the exclusive CPU core by the operating system to other shared CPU cores to ensure that the exclusive CPU cores are idle and wait for the application process to be bound to use
(6)更新在/PROC目录下特定文件中描述已经成功设置为独占CPU核的ID列表信息。(6) Update the ID list information describing that it has been successfully set as the exclusive CPU core in the specific file under the /PROC directory.
下面举例说明在节点上的独占CPU核转换和隔离策略:The following example illustrates the exclusive CPU core conversion and isolation strategy on the node:
假设NODE1节点中包含32个CPU资源,初始阶段全部CPU核配置为共享CPU核。假设应用需要独占CPU核时,优先将共享CPU核ID较大的CPU核转换为独占CPU核。Assuming that NODE1 node contains 32 CPU resources, all CPU cores are initially configured as shared CPU cores. Assuming that the application requires exclusive CPU cores, the CPU core with the larger shared CPU core ID is preferentially converted to the exclusive CPU core.
表12Table 12
Figure PCTCN2019119125-appb-000014
Figure PCTCN2019119125-appb-000014
在初始化节点NODE1上部署CONTAINER1,则NODE1上的CPU布局调整为表13:When CONTAINER1 is deployed on the initialization node NODE1, the CPU layout on NODE1 is adjusted to Table 13:
表13Table 13
Figure PCTCN2019119125-appb-000015
Figure PCTCN2019119125-appb-000015
对应的CONTAINER1在CGROUP上的CPUSET配置如表14:The corresponding CPUSET configuration of CONTAINER1 on CGROUP is shown in Table 14:
表14Table 14
 A 全局共享Global sharing 应用独占Application monopoly
CONTAINER1CONTAINER1 0~~~310~~~31  A
在此基础上在NODE1节点上部署CONTAINER2,则NODE1上的CPU布局调整为表15:On this basis, CONTAINER2 is deployed on the NODE1 node, and the CPU layout on NODE1 is adjusted to Table 15:
表15Table 15
Figure PCTCN2019119125-appb-000016
Figure PCTCN2019119125-appb-000016
对应的在NODE1节点上的应用的CGROUP的CPUSET配置为表16:The corresponding CPUSET configuration of CGROUP on the NODE1 node is shown in Table 16:
表16Table 16
 A 全局共享Global sharing 应用独占Application monopoly
CONTAINER1CONTAINER1 0~~~310~~~31  A
CONTAINER2CONTAINER2 0~~~310~~~31  A
在此基础上在NODE1节点上部署CONTAINER3,则NODE1上的CPU布局调整为表17:On this basis, CONTAINER3 is deployed on the NODE1 node, then the CPU layout on NODE1 is adjusted to Table 17:
表17Table 17
Figure PCTCN2019119125-appb-000017
Figure PCTCN2019119125-appb-000017
对应的在NODE1节点上的应用的CGROUP的CPUSET配置为表18:The corresponding CPUSET configuration of CGROUP on the NODE1 node is shown in Table 18:
表18Table 18
 A 全局共享Global sharing 应用独占Application monopoly
CONTAINER1CONTAINER1 0~~~300~~~30  A
CONTAINER2CONTAINER2 0~~~300~~~30  A
CONTAINER3CONTAINER3 0~~~300~~~30 3131
在此基础上在NODE1节点上部署CONTAINER4,则NODE1上的CPU布局调整为表19:On this basis, CONTAINER4 is deployed on the NODE1 node, then the CPU layout on NODE1 is adjusted to Table 19:
表19Table 19
Figure PCTCN2019119125-appb-000018
Figure PCTCN2019119125-appb-000018
对应的在NODE1节点上的应用的配置如表20:The corresponding application configuration on the NODE1 node is shown in Table 20:
表20Table 20
 A 全局共享Global sharing 应用独占Application monopoly
CONTAINER1CONTAINER1 0~~~220~~~22  A
CONTAINER2CONTAINER2 0~~~220~~~22  A
CONTAINER3CONTAINER3 0~~~220~~~22 3131
CONTAINER4CONTAINER4 0~~~220~~~22 23~~~3023~~~30
从以上的分配流程可以看到,节点上的CPU资源根据应用的实际需求在共享CPU和独占CPU之间动态转换。在CPU核转换为独占CPU核以后,需要明确独占CPU核的应用归属,并且通过在CONTROL GROUP中的配置,确保独占CPU核只能被归属的应用所使用。As can be seen from the above allocation process, the CPU resources on the node are dynamically converted between the shared CPU and the exclusive CPU according to the actual needs of the application. After the CPU core is converted to the exclusive CPU core, the application ownership of the exclusive CPU core needs to be clearly defined, and through the configuration in the CONTROL GROUP, the exclusive CPU core can only be used by the belonging application.
与一些情况相比,本实施方式中提供了一种确定以及转换独占CPU核的具体实现方式,通过CPU核的ID来确定需要转换为独占CPU核的共享CPU核,并利用CPU核的ID来实现共享CPU核到独占CPU核转换以及将转换后的独占CPU核分配给应用使用。同时,直接由任务最少,负载最轻的共享CPU核来处理该部署节点上应用所需要独占CPU核的任务,不仅提高了调度CPU核的速度,同时也加快了任务的处理效率。并且将转换为独占CPU核上之前处理的任务进程迁移到其他共享CPU核上,由其他共享CPU核来进行处理,使得节点内CPU核的调度更加具备灵活性。Compared with some cases, this embodiment provides a specific implementation method for determining and converting an exclusive CPU core. The CPU core ID is used to determine the shared CPU core that needs to be converted to an exclusive CPU core, and the CPU core ID is used to Realize the conversion from shared CPU core to exclusive CPU core and allocate the converted exclusive CPU core to the application. At the same time, the shared CPU core with the fewest tasks and the lightest load directly handles the task of monopolizing the CPU core required by the application on the deployment node. And the task process converted to the exclusive processing on the exclusive CPU core is migrated to other shared CPU cores, and the processing is performed by the other shared CPU cores, making the scheduling of the CPU cores in the node more flexible.
上面各种方法的步骤划分,只是为了描述清楚,实现时可以合并为一个步骤或者对某些步骤进行拆分,分解为多个步骤,只要包括相同的逻辑关系,都在本专利的保护范围内;对算法中或者流程中添加无关紧要的修改或者引入无关紧要的设计,但不改变其算法和流程的核心设计都在该专利的保护范围内。The steps of the above methods are divided only for clarity, and can be combined into one step or split into some steps and decomposed into multiple steps when implemented, as long as they include the same logical relationship, they are all within the scope of protection of this patent ; Adding insignificant modifications to the algorithm or process or introducing insignificant designs, but not changing the core design of its algorithm and process are within the scope of protection of the patent.
本公开第四实施方式涉及一种电子设备,如图5所示,包括:至少一个处理器501;以及,与至少一个处理器501通信连接的存储器502;其中,存储器502存储有可被至少一个处理器501执行的指令,指令被至少一个处理器501执行,以使至少一个处理器501能够执行上述任一实施方式中的中CPU资源调度方法。The fourth embodiment of the present disclosure relates to an electronic device, as shown in FIG. 5, including: at least one processor 501; and a memory 502 communicatively connected to the at least one processor 501; The instructions executed by the processor 501 are executed by at least one processor 501, so that the at least one processor 501 can execute the medium CPU resource scheduling method in any of the foregoing embodiments.
其中,存储器502和处理器501采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器501和存储器502的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器501处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器501。Among them, the memory 502 and the processor 501 are connected by a bus. The bus may include any number of interconnected buses and bridges. The bus connects one or more processors 501 and various circuits of the memory 502 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, etc., which are well known in the art, and therefore, they will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium. The data processed by the processor 501 is transmitted on the wireless medium through the antenna. Further, the antenna also receives the data and transmits the data to the processor 501.
处理器501负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器502可以被用于存储处理器501在执行操作时所使用的数据。The processor 501 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 502 may be used to store data used by the processor 501 when performing operations.
本公开第五实施方式涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。The fifth embodiment of the present disclosure relates to a computer-readable storage medium storing a computer program. When the computer program is executed by the processor, the above method embodiments are implemented.
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。That is, those skilled in the art can understand that all or part of the steps in the method in the above embodiments can be completed by instructing relevant hardware through a program, which is stored in a storage medium and includes several instructions to make a device ( It may be a single chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present disclosure. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
本实施方式提供的一种CPU资源调度方法及电子设备,使得在不影响节点服务效果的同时,降低了配置节点的复杂度,同时降低了CPU资源的调度维度以及对独占CPU资源的使用门槛,也实现了对共享CPU以及独占CPU资源的灵活调度,提高了节点的CPU资源利用效率。This embodiment provides a CPU resource scheduling method and electronic device, which reduces the complexity of configuring nodes without affecting the service effect of nodes, and reduces the scheduling dimension of CPU resources and the threshold for using exclusive CPU resources. It also realizes flexible scheduling of shared CPU and exclusive CPU resources, which improves the CPU resource utilization efficiency of nodes.
本公开实施方式相对于一些情况而言,将各个节点上的全部CPU核均配置为共享CPU核、并将各个节点的共享CPU核数量作为该节点的可用CPU核数量,无需配置独占CPU和共享CPU,降低了配置节点的复杂度;同时仅在共享CPU维度调度CPU资源,无需同时在共享CPU和独占CPU维度上调度CPU资源,降低了CPU资源的调度维度;然后选取可用CPU核数量大于或等于应用CPU核需求数量的节点作为部署节点、将应用部署到部署节点以满足应用的CPU核需求,处理应用启动事件时,从部署节点的共享CPU核中选取与应用的独占CPU需求数量相等的共享CPU核、并转换为独占CPU核供应用使用,处理应用退出事件时,将分配给应用使用的独占CPU核转换为共享CPU核,根据应用实际需要实现独占CPU核与共享CPU核的动态转换,从而在调度的层面上不需要关注容器需要的是共享CPU核还是独占CPU核,而是合并作为普通CPU核需求进行调度,避免了一些情况中将共享CPU核和独占CPU核作为两种资源进行调度而导致“一种资源不足,而另一种资源大量闲置浪费”的情况发生,大大提高了CPU资源的利用效率以及调度的灵活性,同时也不需要因修改节点上共享CPU核和独占CPU核的分配比例关系而需重启节点操作系统,降低了独占CPU资源的使用门槛,同时避免导致节点上承载业务的迁移或中断,不影响节点的服务效果。Compared with some cases, the embodiments of the present disclosure configure all CPU cores on each node as shared CPU cores, and use the number of shared CPU cores of each node as the number of available CPU cores of the node, without the need to configure an exclusive CPU and share CPU, reduces the complexity of configuring nodes; at the same time, only schedules CPU resources in the shared CPU dimension, and does not need to schedule CPU resources in the shared CPU and exclusive CPU dimensions at the same time, reducing the scheduling dimension of CPU resources; and then selects the number of available CPU cores greater than or A node equal to the number of application CPU cores is required as the deployment node, and the application is deployed to the deployment node to meet the application's CPU core requirements. When processing application startup events, the number of exclusive CPU requirements of the application is selected from the shared CPU cores of the deployment node Share CPU cores and convert them to exclusive CPU cores for use. When processing application exit events, convert the exclusive CPU cores assigned to the application to shared CPU cores, and realize the dynamic conversion of exclusive CPU cores and shared CPU cores according to the actual needs of the application. Therefore, at the level of scheduling, it is not necessary to pay attention to whether the container needs to share CPU cores or exclusive CPU cores, but it is combined as ordinary CPU cores for scheduling, which avoids the use of shared CPU cores and exclusive CPU cores as two resources in some cases. Scheduling results in a situation where "one resource is insufficient, while another resource is largely idle and wasted", which greatly improves the utilization efficiency of CPU resources and the flexibility of scheduling. It also does not need to share CPU cores and monopolize the nodes due to modification The distribution of CPU cores requires a restart of the node's operating system, which lowers the threshold for exclusive use of CPU resources. At the same time, it avoids the migration or interruption of bearer services on the node and does not affect the service effect of the node.
本领域的普通技术人员可以理解,上述各实施方式是实现本公开的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本公开的精神和范围。Those of ordinary skill in the art can understand that the above-mentioned embodiments are specific examples for realizing the present disclosure, and in practical applications, various changes can be made in form and detail without departing from the spirit and range.

Claims (10)

  1. 一种CPU资源调度方法,其中,包括:A CPU resource scheduling method, including:
    将各个节点上的全部CPU核均配置为共享CPU核,并将各个节点的共享CPU核数量作为该节点的可用CPU核数量;All CPU cores on each node are configured as shared CPU cores, and the number of shared CPU cores of each node is taken as the number of available CPU cores of the node;
    接收并解析应用的CPU核需求数量,所述CPU核需求数量包括独占CPU需求数量和共享CPU核需求数量;Receiving and analyzing the number of CPU core requirements of the application, the number of CPU core requirements including the number of exclusive CPU requirements and the number of shared CPU core requirements;
    选取可用CPU核数量大于或等于所述CPU核需求数量的节点作为部署节点、将执行所述应用的任务部署到所述部署节点;Selecting a node with a number of available CPU cores greater than or equal to the required number of CPU cores as a deployment node, and deploying tasks that execute the application to the deployment node;
    监控所述部署节点的应用启动事件及退出事件,在监控到所述部署节点的应用启动事件时,从所述部署节点的共享CPU核中选取与所述独占CPU需求数量相等的共享CPU核并转换为独占CPU核、将转换的所述独占CPU核分配给所述应用使用;在监控到所述部署节点的应用退出事件时,将分配给所述应用使用的独占CPU核转换为共享CPU核。Monitoring the application startup event and the exit event of the deployment node, and when the application startup event of the deployment node is monitored, selecting a shared CPU core equal to the number of exclusive CPU requirements from the shared CPU core of the deployment node and Convert to an exclusive CPU core, and assign the converted exclusive CPU core to the application for use; when an application exit event of the deployment node is monitored, convert the exclusive CPU core allocated to the application to a shared CPU core .
  2. 根据权利要求1所述的CPU资源调度方法,其中,所述接收并解析应用的CPU核需求数量,具体包括:The CPU resource scheduling method according to claim 1, wherein the receiving and analyzing the number of CPU core requirements of the application specifically includes:
    查询所述应用的配置信息;Query the configuration information of the application;
    根据所述配置信息确定所述独占CPU需求数量。The number of exclusive CPU requirements is determined according to the configuration information.
  3. 根据权利要求2所述的CPU资源调度方法,其中,所述查询所述应用的配置信息之后,还包括:The CPU resource scheduling method according to claim 2, wherein after querying the configuration information of the application, the method further comprises:
    将所述应用中无需独占CPU核的任务交给所述部署节点的操作系统进行调度。Tasks that do not require exclusive CPU cores in the application are handed over to the operating system of the deployment node for scheduling.
  4. 根据权利要求1所述的CPU资源调度方法,其中,所述从所述部署节点的共享CPU核中选取与所述独占CPU需求数量相等的共享CPU核并转换为独占CPU核、将转换的所述独占CPU核分配给所述应用使用,具体包括:The CPU resource scheduling method according to claim 1, wherein the shared CPU cores equal to the number of exclusive CPU requirements are selected from the shared CPU cores of the deployment node and converted into exclusive CPU cores The exclusive CPU core is allocated for use by the application, and specifically includes:
    确定与所述独占CPU需求数量相等的、需要转换为独占CPU核的所述部署节点的CPU核的ID;Determine the ID of the CPU core of the deployment node that is equal to the number of exclusive CPU requirements and needs to be converted into an exclusive CPU core;
    根据所述独占CPU需求数量,确定与所述独占CPU需求数量相等的、所述部署节点的共享CPU核的ID作为待转换CPU核的ID;According to the number of exclusive CPU requirements, determine the ID of the shared CPU core of the deployment node equal to the number of exclusive CPU requirements as the ID of the CPU core to be converted;
    将所述部署节点上、与所述待转换CPU核ID对应的共享CPU核转换为独占CPU核;Converting the shared CPU core corresponding to the CPU core ID to be converted on the deployment node into an exclusive CPU core;
    将转换的所述独占CPU核分配给所述应用使用。The converted exclusive CPU core is allocated to the application for use.
  5. 根据权利要求4所述的CPU资源调度方法,其中,所述根据所述独占CPU需求数量,确定与所述独占CPU需求数量相等的、所述部署节点的共享CPU核的ID作为待转换CPU核的ID,具体包括:The CPU resource scheduling method according to claim 4, wherein, based on the number of exclusive CPU requirements, the ID of the shared CPU core of the deployment node equal to the number of exclusive CPU requirements is determined as the CPU core to be converted ID, including:
    将所述部署节点上负载最轻的共享CPU核的ID作为所述待转换CPU核的ID。The ID of the shared CPU core with the lightest load on the deployment node is used as the ID of the CPU core to be converted.
  6. 根据权利要求4所述的CPU资源调度方法,其中,所述将所述部署节点上、与所述待转换CPU核ID对应的共享CPU核转换为独占CPU核之后,还包括:The CPU resource scheduling method according to claim 4, wherein after converting the shared CPU core corresponding to the CPU core ID to be converted on the deployment node into an exclusive CPU core, further comprising:
    将独占CPU核上的负载迁移到所述部署节点的其他共享CPU核上。The load on the exclusive CPU core is migrated to other shared CPU cores of the deployment node.
  7. 根据权利要求4所述的CPU资源调度方法,其中,所述将转换的所述独占CPU核分配给所述应用使用,具体包括:The CPU resource scheduling method according to claim 4, wherein the allocating the converted exclusive CPU core to the application for use specifically includes:
    将转换的独占CPU核信息传递给所述应用、使用CONTROL GROUP确保只有归属的所述应用可使用所述转换的独占CPU核,由所述应用自主决定如何使用所述转换的独占CPU核的资源。Pass the converted exclusive CPU core information to the application, use CONTROL GROUP to ensure that only the belonging application can use the converted exclusive CPU core, and the application decides how to use the converted exclusive CPU core resources .
  8. 根据权利要求1所述的CPU资源调度方法,其中,所述将执行所述应用的任务部署到所述部署节点之后,还包括:更新所述部署节点的可用CPU核数量。The CPU resource scheduling method according to claim 1, wherein after the task of executing the application is deployed to the deployment node, further comprising: updating the number of available CPU cores of the deployment node.
  9. 根据权利要求8所述的CPU资源调度方法,其中,所述将执行所述应用的任务部署到所述部署节点之后,还包括:The CPU resource scheduling method according to claim 8, wherein after the task of executing the application is deployed to the deployment node, the method further comprises:
    监控所述部署节点的任务执行状态,并在所述部署节点的任务执行完成或任务执行异常终止之后,更新所述部署节点的可用CPU核数量。Monitor the task execution status of the deployment node, and update the number of available CPU cores of the deployment node after the task execution of the deployment node is completed or the task execution is abnormally terminated.
  10. 一种电子设备,包括至少一个处理器;以及,An electronic device including at least one processor; and,
    与所述至少一个处理器通信连接的存储器;A memory in communication connection with the at least one processor;
    其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行以实现如上述权利要求1至9中任一项所述的CPU资源调度方法。Wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the CPU resource scheduling method according to any one of claims 1 to 9 above .
PCT/CN2019/119125 2018-11-29 2019-11-18 Cpu resource scheduling method and electronic equipment WO2020108337A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811442355.0 2018-11-29
CN201811442355.0A CN111240824B (en) 2018-11-29 2018-11-29 CPU resource scheduling method and electronic equipment

Publications (1)

Publication Number Publication Date
WO2020108337A1 true WO2020108337A1 (en) 2020-06-04

Family

ID=70852452

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/119125 WO2020108337A1 (en) 2018-11-29 2019-11-18 Cpu resource scheduling method and electronic equipment

Country Status (2)

Country Link
CN (1) CN111240824B (en)
WO (1) WO2020108337A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112039963B (en) * 2020-08-21 2023-04-07 广州虎牙科技有限公司 Processor binding method and device, computer equipment and storage medium
CN112231067B (en) * 2020-12-11 2021-03-30 广东睿江云计算股份有限公司 Optimal scheduling method and system for virtual CPU
CN116431357B (en) * 2023-06-13 2023-12-01 阿里巴巴(中国)有限公司 Kernel allocation method, allocation component, working node and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508696A (en) * 2011-10-30 2012-06-20 北京方物软件有限公司 Asymmetrical resource scheduling method and device
CN103019853A (en) * 2012-11-19 2013-04-03 北京亿赞普网络技术有限公司 Method and device for dispatching job task
CN105988872A (en) * 2015-02-03 2016-10-05 阿里巴巴集团控股有限公司 CPU (central processing unit) resource allocation method and device and electronic equipment
CN108153583A (en) * 2016-12-06 2018-06-12 阿里巴巴集团控股有限公司 Method for allocating tasks and device, real-time Computational frame system
EP3376399A1 (en) * 2015-12-31 2018-09-19 Huawei Technologies Co., Ltd. Data processing method, apparatus and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007257257A (en) * 2006-03-23 2007-10-04 Matsushita Electric Ind Co Ltd Task execution environment switching method in multi-task system
JP4705051B2 (en) * 2007-01-29 2011-06-22 株式会社日立製作所 Computer system
US20090158299A1 (en) * 2007-10-31 2009-06-18 Carter Ernst B System for and method of uniform synchronization between multiple kernels running on single computer systems with multiple CPUs installed
US9075609B2 (en) * 2011-12-15 2015-07-07 Advanced Micro Devices, Inc. Power controller, processor and method of power management
US9244738B2 (en) * 2013-10-24 2016-01-26 International Business Machines Corporation Conditional serialization to improve work effort
US10310890B2 (en) * 2014-11-28 2019-06-04 Hitachi, Ltd. Control method for virtual machine system, and virtual machine system
US9830187B1 (en) * 2015-06-05 2017-11-28 Apple Inc. Scheduler and CPU performance controller cooperation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508696A (en) * 2011-10-30 2012-06-20 北京方物软件有限公司 Asymmetrical resource scheduling method and device
CN103019853A (en) * 2012-11-19 2013-04-03 北京亿赞普网络技术有限公司 Method and device for dispatching job task
CN105988872A (en) * 2015-02-03 2016-10-05 阿里巴巴集团控股有限公司 CPU (central processing unit) resource allocation method and device and electronic equipment
EP3376399A1 (en) * 2015-12-31 2018-09-19 Huawei Technologies Co., Ltd. Data processing method, apparatus and system
CN108153583A (en) * 2016-12-06 2018-06-12 阿里巴巴集团控股有限公司 Method for allocating tasks and device, real-time Computational frame system

Also Published As

Publication number Publication date
CN111240824A (en) 2020-06-05
CN111240824B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
US10003500B2 (en) Systems and methods for resource sharing between two resource allocation systems
CN108337109B (en) Resource allocation method and device and resource allocation system
CN109564528B (en) System and method for computing resource allocation in distributed computing
WO2019001092A1 (en) Load balancing engine, client, distributed computing system, and load balancing method
US9563474B2 (en) Methods for managing threads within an application and devices thereof
WO2020108337A1 (en) Cpu resource scheduling method and electronic equipment
CN113064712B (en) Micro-service optimization deployment control method, system and cluster based on cloud edge environment
US20200174844A1 (en) System and method for resource partitioning in distributed computing
CN110221920B (en) Deployment method, device, storage medium and system
WO2021227999A1 (en) Cloud computing service system and method
WO2016095535A1 (en) Resource allocation method and apparatus, and server
CN110166507B (en) Multi-resource scheduling method and device
CN110990154B (en) Big data application optimization method, device and storage medium
WO2022105337A1 (en) Task scheduling method and system
US11438271B2 (en) Method, electronic device and computer program product of load balancing
WO2024021489A1 (en) Task scheduling method and apparatus, and kubernetes scheduler
CN110086726A (en) A method of automatically switching Kubernetes host node
CN109002364A (en) Optimization method, electronic device and the readable storage medium storing program for executing of interprocess communication
Wu et al. Abp scheduler: Speeding up service spread in docker swarm
JP4862056B2 (en) Virtual machine management mechanism and CPU time allocation control method in virtual machine system
EP3994574A1 (en) Harvest virtual machine for utilizing cloud-computing resources
CN116680078A (en) Cloud computing resource scheduling method, device, equipment and computer storage medium
WO2022111466A1 (en) Task scheduling method, control method, electronic device and computer-readable medium
US20170269968A1 (en) Operating system support for game mode
CN110399206B (en) IDC virtualization scheduling energy-saving system based on cloud computing environment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19890610

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 031121)

122 Ep: pct application non-entry in european phase

Ref document number: 19890610

Country of ref document: EP

Kind code of ref document: A1