Method for controlling the number of scheduler processes and IaaS cloud platform scheduling system
By calculating the preset indicator information of the IaaS cloud platform and adjusting the number of scheduler processes, it solves the problem of difficulty in determining the steady state of the number of scheduler processes, improves the performance of the scheduling system, dynamically adjusts the number of scheduler processes, and improves resource utilization efficiency. and scheduling efficiency.
Patent Information
- Application Number
- CN202111577772.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-12-22
AI Technical Summary
It is difficult to find the steady state of the number of scheduler processes with existing technology, resulting in limited performance improvement of the IaaS cloud platform scheduling system.
By obtaining the preset indicator information of the IaaS cloud platform, such as the number of hosts, the average scheduler delay and the average rescheduling value, the steady-state value of the scheduler process is calculated, and the number of scheduler processes is adjusted based on the steady-state value to achieve the number of scheduler processes. elastic expansion.
Dynamically adjust the number of scheduler processes to maximize the performance of the scheduling system, ensure resource utilization efficiency, reduce the number of rescheduling, increase throughput and reduce latency.
Smart Images

Figure CN114461356B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of IaaS cloud platform scheduling, and in particular to a method for controlling the number of scheduler processes and an IaaS cloud platform scheduling system. Background Art
[0002] With the continuous development of cloud computing business scenarios and business scale, the scale of cloud computing data centers is getting larger and larger, and the concurrent performance requirements of the scheduling system of IaaS cloud platform are getting higher and higher. Infrastructure as a Service (IaaS) refers to providing IT infrastructure as a service to customers through the network, and the IaaS cloud platform is to unify computing virtualization technology, network virtualization technology and storage virtualization technology, and then provide IT infrastructure to customers in an on-demand and pay-as-you-go manner, such as open source projects such as OpenStack, CloudStack and OpenNebula.
[0003] The scheduling system is one of the core components of the IaaS cloud platform. It is mainly responsible for the scheduling function of the entire cluster resources. When a customer purchases a virtual machine (instance), the instance is scheduled to the optimal host (host) according to specific scheduling algorithms and strategies, so as to make more reasonable and full use of cluster resources. At the same time, the scheduling system also supports a series of scheduling strategies implemented according to business logic to schedule virtual machines to hosts that meet the requirements (such as selecting hosts that use SSD hard drives, GPUs, computing enhancements, and memory optimization during scheduling, etc.).
[0004] There are seven main indicators for evaluating a scheduling system, including the number of scheduler processes (workers), average scheduler latency, scheduler throughput, total scheduler time consumption, concurrent scheduling requests, number of host machines, and number of rescheduling times. Among them, the concurrent scheduling requests, number of scheduler processes, number of rescheduling times, and number of host machines will affect the throughput, average latency, and total time consumption of the scheduling system. For example, if the number of scheduler workers is only one, all scheduling requests are executed serially, and one scheduling request is processed by one worker in 1 second, so 1,000 requests will take 1,000 seconds; if the number of scheduler workers is increased to 1,000, 1,000 workers work in parallel. Although the batch processing capacity is increased, optimistic lock conflicts will occur when writing to the database, resulting in requests that need to be rescheduled repeatedly. Therefore, it is very important to find a steady state of the number of workers to maximize the performance of the scheduling system. Summary of the invention
[0005] Therefore, the technical problem to be solved by the present invention is to overcome the defect in the prior art that it is difficult to find a steady state of the number of workers to maximize the performance of the scheduling system, thereby providing a method for controlling the number of scheduler processes and an IaaS cloud platform scheduling system.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] In a first aspect, an embodiment of the present invention provides a method for controlling the number of scheduler processes, comprising:
[0008] Obtain preset indicator information in the IaaS cloud platform scheduling system;
[0009] Calculate the scheduler process steady-state value according to the preset indicator information;
[0010] The number of scheduler processes is adjusted according to the steady-state value.
[0011] Optionally, the preset indicator information includes: the number of host machines, the average scheduler delay, the rescheduling mean and the total amount of queue task accumulation.
[0012] Optionally, the scheduler process steady-state value is calculated using the following formula:
[0013]
[0014] Optionally, adjusting the number of scheduler processes according to the steady-state value includes:
[0015] When the steady-state value is greater than a first preset threshold and less than a second preset threshold, the number of scheduler processes is reduced by 1;
[0016] When the steady-state value is equal to a second preset threshold, maintaining the number of scheduler processes unchanged;
[0017] When the steady-state value is greater than a second preset threshold, the number of scheduler processes is increased by 1.
[0018] In a second aspect, an embodiment of the present invention provides an IaaS cloud platform scheduling system, including: a worker elastic scaling thread module, wherein the worker elastic scaling thread module is used to execute the method for controlling the number of scheduler processes described in the first aspect of the present invention.
[0019] Optionally, the IaaS cloud platform scheduling system further includes: a scheduling main process module, multiple task queues and multiple schedulers, and the task queues and the schedulers are arranged in a one-to-one correspondence.
[0020] Optionally, the scheduling main process module is used to receive scheduling requests from the front end of the IaaS cloud platform scheduling system, and write the scheduling requests into the task queue corresponding to each scheduler, and at the same time collect the number of host machines, average scheduler delay, rescheduling mean and total task accumulation in the scheduling system of the IaaS cloud platform, and send the number of host machines, average scheduler delay, rescheduling mean and total task accumulation to the worker elastic scaling thread module.
[0021] Optionally, the scheduler operates serially internally to execute a preset process.
[0022] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method for controlling the number of scheduler processes described in the first aspect of the present invention.
[0023] In a fourth aspect, an embodiment of the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for controlling the number of scheduler processes described in the first aspect of the present invention by executing the computer instructions.
[0024] The technical solution of the present invention has the following advantages:
[0025] The present invention provides a method for controlling the number of scheduler processes, comprising: obtaining preset indicator information in an IaaS cloud platform scheduling system; calculating a steady-state value of the scheduler process according to the preset indicator information; and adjusting the number of scheduler processes according to the steady-state value. By calculating the steady-state value of the scheduler process, elastic scaling of the number of scheduler processes is achieved according to the steady-state value, the number of scheduler processes is dynamically increased and decreased, and the optimal amount of scheduler resources is guaranteed to be provided, greatly improving scheduling efficiency.
[0026] The present invention provides an IaaS cloud platform scheduling system, comprising: a worker elastic scaling thread module, wherein the worker elastic scaling thread module is used in the above-mentioned method for controlling the number of scheduler processes. The worker elastic scaling thread module calculates the steady-state value of the scheduler process, realizes elastic scaling of the number of scheduler processes according to the steady-state value, dynamically increases and decreases the number of scheduler processes, ensures the provision of the optimal amount of scheduler resources, and greatly improves the scheduling efficiency of the IaaS cloud platform scheduling system. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 A flowchart of a specific example of a method for controlling the number of scheduler processes in an embodiment of the present invention;
[0029] Figure 2 It is a principle block diagram of a specific example of the IaaS cloud platform scheduling system in an embodiment of the present invention;
[0030] Figure 3 A composition diagram of a specific example of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0033] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, it can also be the internal connection of two components, it can be a wireless connection, or it can be a wired connection. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0034] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0035] The prior art is to optimize the scheduling algorithm in the scenario of a fixed number of cloud platform resource schedulers. Since the number of schedulers is fixed, the optimization of the scheduling algorithm cannot achieve a qualitative improvement in scheduling efficiency. Therefore, an embodiment of the present invention provides a method for controlling the number of scheduler processes to improve scheduling efficiency. Figure 1 As shown, the method for controlling the number of scheduler processes includes the following steps:
[0036] Step S1: Obtain preset indicator information in the IaaS cloud platform scheduling system.
[0037] In a specific embodiment, the preset indicator information includes: the number of host machines, the average delay of the scheduler, the mean rescheduling value, and the total amount of queue task accumulation. Among them, the number of host machines is the scale of computing nodes in a data center. The average delay of the scheduler is the average time from a scheduling request being sent to the scheduling system to the scheduling system returning the scheduling result. The mean rescheduling value is the number of rescheduling caused by optimistic locking of the scheduling system within a period of time. The total amount of queue task accumulation is the number of scheduling requests processed by the scheduling system per unit time.
[0038] Step S2: Calculate the scheduler process steady-state value according to preset indicator information.
[0039] In a specific embodiment, after obtaining the number of host machines, the average delay of the scheduler, the average rescheduling value, and the total amount of queue task accumulation, the scheduler process steady-state value is calculated by the following formula:
[0040]
[0041] Step S3: Adjust the number of scheduler processes according to the steady-state value.
[0042] In a specific embodiment, by collecting four indicators in the scheduling system, namely the number of host machines, average scheduler delay, rescheduling mean and total task backlog, a calculation formula is independently designed based on the four indicators to calculate the steady-state value of the number of workers in the scheduling system, and the elastic scaling of the scheduler woker is achieved through the steady-state value.
[0043] In an embodiment of the present invention, adjusting the number of scheduler processes according to the steady-state value includes the following steps:
[0044] Step S31: when the steady-state value is greater than the first preset threshold and less than the second preset threshold, the number of scheduler processes is reduced by 1.
[0045] Step S32: When the steady-state value is equal to the second preset threshold, the number of scheduler processes is maintained unchanged.
[0046] Step S33: When the steady-state value is greater than the second preset threshold, the number of scheduler processes is increased by 1.
[0047] In an embodiment of the present invention, the number of scheduler processes (workers) is elastically scaled according to the steady-state value. Specifically, when 0<steady-state value<1, the number of workers is -1; when the steady-state value=1, the number of workers remains unchanged; when the steady-state value>1, the number of workers is +1. In an embodiment of the present invention, the first preset threshold is 0, and the second preset threshold is 1.
[0048] The present invention provides a method for controlling the number of scheduler processes, comprising: obtaining preset indicator information in an IaaS cloud platform scheduling system; calculating a steady-state value of the scheduler process according to the preset indicator information; and adjusting the number of scheduler processes according to the steady-state value. By calculating the steady-state value of the scheduler process, elastic scaling of the number of scheduler processes is achieved according to the steady-state value, the number of scheduler processes is dynamically increased and decreased, and the optimal amount of scheduler resources is guaranteed to be provided, greatly improving scheduling efficiency.
[0049] According to the scheduler elastic scaling algorithm, this embodiment can dynamically increase and decrease the number of scheduler processes to achieve the optimal solution, realize parallel operation of multiple scheduling processes, and reduce the waiting time of cloud host scheduling tasks.
[0050] In large-scale cloud computing scenarios, high concurrent tasks can lead to scheduling conflicts, resulting in a large number of rescheduling processes. The elastic scaling algorithm of the present invention takes the number of rescheduling as a factor and calculates the optimal number of scheduler processes, ultimately reducing the number of rescheduling times and improving scheduling efficiency.
[0051] The embodiment of the present invention also provides an IaaS cloud platform scheduling system, such as Figure 2 As shown, it includes: a worker elastic scaling thread module, which is used to execute the above-mentioned method for controlling the number of scheduler processes. For specific contents, please refer to the relevant description of steps S1 to S3 in the above-mentioned embodiment.
[0052] In one embodiment, if Figure 2 As shown, the IaaS cloud platform scheduling system also includes: a scheduling main process module, multiple task queues and multiple schedulers, and the task queues and schedulers are set in a one-to-one correspondence.
[0053] In a specific embodiment, the scheduling main process module is used to receive the scheduling request from the front end of the IaaS cloud platform scheduling system, and write the scheduling request into the task queue corresponding to each scheduler with a balancing strategy, and collect the number of hosts, average scheduler delay, rescheduling mean and total task accumulation in the scheduling system of the IaaS cloud platform, and send the collected information to the worker elastic scaling thread module every 10 seconds. In this embodiment of the present invention, the maximum number of schedulers is set to the sum of the number of CPU cores of all scheduling nodes, and the minimum number of schedulers is 1
[0054] In one embodiment, the task queue is a first-in-first-out queue that accepts the task list written by the main process. Each queue corresponds to a scheduler. After the task execution of the scheduler is completed, the next task will be read from the queue again for execution.
[0055] In one embodiment, the scheduler operates serially internally to execute a preset process.
[0056] In a specific embodiment, the preset process includes the following steps:
[0057] 1. Obtain or update the latest resource view, record it in memory, and improve the efficiency of scheduling data reading and writing;
[0058] 2. Filtering: All configured filters are executed in sequence. Each filter filters all hosts in the current system. Hosts that do not meet the conditions are filtered out and enter the next filter. After all filters are executed, all hosts that pass the set are sent to the scorer.
[0059] 3. Scoring: All hosts that pass the filtering stage will enter the scoring stage. In the scoring stage, all configured effective scorers will score all hosts and sum them according to the weights. The host with the highest score will be returned;
[0060] 4. Read the value n of subset in the configuration, and randomly select one of the top n computing nodes as the target node for scheduling, to reduce optimistic lock conflicts and system rescheduling.
[0061] 5. Write the resource database to occupy the host computing node resources. Once occupied, re-update the resource view.
[0062] In an embodiment of the present invention, if subset is 3, a random node is selected from the top 3 computing nodes as the target node for scheduling. When writing to the resource database occupies the host computing node resources, resource preemption may occur. For example, when multiple schedulers simultaneously occupy the same host computing node resources, the scheduler write time is judged. If it arrives first, the write is successful, and if it arrives later, the write fails. Furthermore, when the scheduler fails to write, feedback is given to the scheduling main process module.
[0063] In the control node of the data cluster, virtual machines are created concurrently through Linux shell scripts, and 1,000, 2,000, 5,000, and 10,000 virtual machine creation requests are always waiting in the scheduling system. At the same time, the number of scheduler workers of the scheduling nodes in the cluster is observed to gradually increase from 1 and finally gradually stabilize. After stabilization, the scheduling performance (throughput and scheduler latency) of the cluster reaches the optimal level.
[0064] The embodiment of the present invention also provides a computer device, such as Figure 3 As shown, the device may include a processor 61 and a memory 62, wherein the processor 61 and the memory 62 may be connected via a bus or other means. Figure 3 Take the example of connecting via a bus.
[0065] The processor 61 may be a central processing unit (CPU). The processor 61 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0066] The memory 62 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the corresponding program instructions / modules in the embodiment of the present invention. The processor 61 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory 62, that is, the method for controlling the number of scheduler processes in the above method embodiment is implemented.
[0067] The memory 62 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created by the processor 61, etc. In addition, the memory 62 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 62 may optionally include a memory remotely arranged relative to the processor 61, and these remote memories may be connected to the processor 61 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, an intranet, a mobile communication network, and combinations thereof.
[0068] One or more modules are stored in the memory 62, and when executed by the processor 61, the method for controlling the number of scheduler processes provided in the embodiment of the present invention is executed.
[0069] For details of the above computer equipment, please refer to Figure 1 The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.
[0070] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0071] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the scope of protection of the invention.
Claims
1. A method for controlling the number of scheduler processes, characterized in that: include: Obtain preset indicator information in the IaaS cloud platform scheduling system; Calculate the scheduler process steady-state value according to the preset indicator information; Adjusting the number of scheduler processes according to the steady-state value; The preset indicator information includes: the number of host machines, the average delay of the scheduler, the mean rescheduling value and the total amount of queue task accumulation, wherein the number of host machines is the scale of computing nodes in a data center, the average delay of the scheduler is the average time from a scheduling request being sent to the scheduling system to the scheduling system returning the scheduling result, the mean rescheduling value is the number of rescheduling times caused by optimistic locking in the scheduling system within a period of time, and the total amount of queue task accumulation is the number of scheduling requests processed by the scheduling system per unit time; The steady-state value of the scheduler process is calculated using the following formula: The adjusting the number of scheduler processes according to the steady-state value comprises: When the steady-state value is greater than a first preset threshold and less than a second preset threshold, the number of scheduler processes is reduced by 1; When the steady-state value is equal to a second preset threshold, maintaining the number of scheduler processes unchanged; When the steady-state value is greater than a second preset threshold, the number of scheduler processes is increased by 1.
2. An IaaS cloud platform scheduling system, characterized in that: include: A worker elastically scalable thread module, wherein the worker elastically scalable thread module is used to execute the method for controlling the number of scheduler processes described in claim 1.
3. The IaaS cloud platform scheduling system according to claim 2, characterized in that: Also includes: A scheduling main process module, multiple task queues and multiple schedulers, wherein the task queues and the schedulers are set in a one-to-one correspondence.
4. The IaaS cloud platform scheduling system according to claim 3, characterized in that: The scheduling main process module is used to receive the scheduling request from the front end of the IaaS cloud platform scheduling system, and write the scheduling request into the task queue corresponding to each scheduler, and at the same time collect the number of host machines, the average scheduler delay, the rescheduling mean and the total task accumulation in the scheduling system of the IaaS cloud platform, and send the number of host machines, the average scheduler delay, the rescheduling mean and the total task accumulation to the worker elastic scaling thread module.
5. The IaaS cloud platform scheduling system according to claim 3, characterized in that: The scheduler operates serially internally to execute a preset process.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method for controlling the number of scheduler processes as claimed in claim 1.
7. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for controlling the number of scheduler processes as claimed in claim 1 by executing the computer instructions.
