Resource scheduling method and device for processor
Patent Information
- Application Number
- CN202412000540.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2044-12-31
AI Technical Summary
[0005]本申请实施例提供了一种处理器的资源调度方法及装置,以至少解决相关技术中处理器资源分配不合理的问题
[0021] This application enables the determination of scheduling priorities for multiple threads based on their business characteristics within a hyperconverged service system. Subsequently, based on these priorities, initialization configuration strategies for the threads are determined, and the threads are initialized. The application then monitors the running status of the processors corresponding to each thread and dynamically adjusts the thread configuration strategies accordingly. This dynamic adjustment of processor resources ensures that the resource allocation strategy can be adaptively adjusted under different load conditions, achieving optimal system performance and resource utilization efficiency. This achieves the technical effect of rationally allocating processor resources, thereby solving the technical problem of unreasonable processor resource allocation.
Smart Images

Figure CN120045316B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for scheduling processor resources. Background Technology
[0002] Currently, hyperconvergence is a basic technology that integrates computing, storage, and networking functions. It provides flexibility, scalability, and simplicity by integrating traditional computing, storage, and networking devices into a unified software-defined platform and through software management and automation.
[0003] In related technologies, when allocating processor resources, a fixed configuration is usually output based on a specific hardware configuration and a simulated fixed load. However, this does not take into account the adaptation to complex stress load changes in actual production conditions, resulting in the technical problem of unreasonable processor resource allocation.
[0004] There is currently no effective solution to the aforementioned technical problem of unreasonable processor resource allocation. Summary of the Invention
[0005] This application provides a processor resource scheduling method and apparatus to at least solve the problem of unreasonable processor resource allocation in related technologies.
[0006] According to one embodiment of this application, a processor resource scheduling method is provided, applied to a hyperconverged service system. The method includes: determining scheduling priorities for multiple threads based on business characteristic information of multiple threads in the hyperconverged service system, wherein the business characteristic information is used to at least indicate the resource utilization rate of the multiple threads during task execution; determining initialization configuration strategies for multiple threads based on their respective scheduling priorities, wherein the initialization configuration strategies at least include the binding state between the corresponding threads and the processors in the hyperconverged service system; performing initialization configuration on the multiple threads based on the initialization configuration strategies; monitoring the running status of the processors corresponding to the multiple threads after initialization configuration, wherein the running status is used to at least indicate the running frequency of the corresponding processors; and adjusting the initialization configuration strategies for the multiple threads based on the running status of the processors corresponding to the multiple threads.
[0007] In an exemplary embodiment, the method for determining the scheduling priorities of multiple threads based on their business characteristic information in a hyperconverged service system further includes: configuring the multiple threads into a non-exclusive mode, wherein the non-exclusive mode indicates that the multiple threads have the right to share the same processor resource; establishing a binding state between the multiple threads and multiple processors in the hyperconverged service system in the non-exclusive mode, wherein the binding state indicates the association between the threads and the processors; increasing the load of the hyperconverged service system to determine the resource utilization rate of the processors by the multiple threads; and determining the scheduling priorities of the multiple threads based on their business characteristic information in the hyperconverged service system, including determining the scheduling priorities of the multiple threads based on their resource utilization rate of the processors.
[0008] In one exemplary embodiment, increasing the load on a hyperconverged service system to determine the resource utilization of multiple threads on the processor includes: increasing the load on the hyperconverged service system in ascending order; and monitoring the resource utilization of multiple threads on the processor under different loads of the hyperconverged service system as the load on the hyperconverged service system dynamically increases.
[0009] In one exemplary embodiment, determining the scheduling priority of each thread based on the resource utilization rate of the processor by multiple threads includes: determining the scheduling priority of threads whose resource utilization rate of the processor is within a first threshold range as high priority; determining the scheduling priority of threads whose resource utilization rate of the processor is within a second threshold range as medium priority, wherein the first threshold range is greater than the second threshold range; and determining the scheduling priority of threads whose resource utilization rate of the processor is within a third threshold range as low priority, wherein the second threshold range is greater than the third threshold range.
[0010] In one exemplary embodiment, determining initialization configuration strategies for multiple threads based on their respective scheduling priorities includes: determining the initialization configuration strategy of the thread with a high scheduling priority as a first initialization configuration strategy, wherein the first initialization configuration strategy indicates that the corresponding thread is set to exclusive mode, and exclusive mode indicates that the thread is bound to a single processor; determining the initialization configuration strategy of the thread with a medium scheduling priority as a second initialization configuration strategy, wherein the second initialization configuration strategy indicates that the corresponding thread is set to range binding mode, and range binding mode allows the corresponding thread to be bound to multiple processors within a preset range; and determining the initialization configuration strategy of the thread with a low scheduling priority as a third initialization configuration strategy, wherein the third initialization configuration strategy indicates that the corresponding thread is set to non-exclusive and range binding mode, wherein non-exclusive and range binding mode allows the corresponding thread to be bound to multiple processors without exclusively using any processor.
[0011] In an exemplary embodiment, the resource scheduling method of the processor further includes: high-priority threads are configured with a first priority scheduling parameter, medium-priority threads are configured with a second priority scheduling parameter, and low-priority threads are configured with a third priority scheduling parameter, wherein the first priority scheduling parameter is less than the second priority scheduling parameter, the second priority scheduling parameter is less than the third priority scheduling parameter, and the scheduling priority is inversely proportional to the scheduling priority parameter.
[0012] In one exemplary embodiment, monitoring the running state of the processors corresponding to multiple threads after initial configuration includes: using a processor monitoring tool to monitor the frequency state of the processors corresponding to multiple threads; and determining the running state of the processors corresponding to multiple threads based on the frequency state of the processors corresponding to multiple threads.
[0013] In one exemplary embodiment, determining the running state of the processors corresponding to the multiple threads based on their frequency states includes: determining the running state of the processors corresponding to the multiple threads as a first running state in response to the processors corresponding to the multiple threads being at their highest frequency; determining the running state of the processors corresponding to the multiple threads as a second running state in response to the processors corresponding to the multiple threads decreasing in frequency and the presence of inactive processors in the hyperconverged service system; and determining the running state of the processors corresponding to the multiple threads as a third running state in response to the processors corresponding to the multiple threads being in an active state.
[0014] In one exemplary embodiment, adjusting the initialization configuration strategy for multiple threads based on the running state of the processors corresponding to the multiple threads includes: determining that the initialization configuration strategy for the multiple threads remains unchanged in response to the running state of the processors corresponding to the multiple threads being a first running state; adjusting the initialization configuration strategy for low-priority threads in response to the running state of the processors corresponding to the multiple threads being a second running state; and adjusting the initialization configuration strategy for low-priority threads and the initialization configuration strategy for medium-priority threads in response to the running state of the processors corresponding to the multiple threads being a third running state.
[0015] In one exemplary embodiment, adjusting the initialization configuration strategy for low-priority threads includes: reducing the number of processors bound to low-priority threads; and increasing the priority scheduling parameters corresponding to low-priority threads.
[0016] In one exemplary embodiment, adjusting the initialization configuration strategy of low-priority threads and the initialization configuration strategy of medium-priority threads includes: binding low-priority threads to the processors corresponding to medium-priority threads; and adjusting the priority scheduling parameters corresponding to medium-priority threads.
[0017] According to another embodiment of this application, a processor resource scheduling apparatus is provided, comprising: a first determining unit, configured to determine the scheduling priority of each of the multiple threads based on the business characteristic information of the multiple threads in a hyperconverged service system, wherein the business characteristic information is used to at least indicate the resource utilization rate of the processor by the multiple threads during task execution; a second determining unit, configured to determine the initialization configuration strategy of the multiple threads based on the scheduling priority of each of the multiple threads, wherein the initialization configuration strategy includes at least the binding state between the corresponding thread and the processor in the hyperconverged service system; a configuration unit, configured to perform initialization configuration on the multiple threads based on the initialization configuration strategy; a monitoring unit, configured to monitor the running state of the processors corresponding to the multiple threads after initialization configuration, wherein the running state is used to at least indicate the running frequency of the corresponding processor; and an adjustment unit, configured to adjust the initialization configuration strategy of the multiple threads based on the running state of the processors corresponding to the multiple threads.
[0018] According to yet another embodiment of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0019] According to yet another embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0020] According to yet another embodiment of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0021] This application enables the determination of scheduling priorities for multiple threads based on their business characteristics within a hyperconverged service system. Subsequently, based on these priorities, initialization configuration strategies for the threads are determined, and the threads are initialized. The application then monitors the running status of the processors corresponding to each thread and dynamically adjusts the thread configuration strategies accordingly. This dynamic adjustment of processor resources ensures that the resource allocation strategy can be adaptively adjusted under different load conditions, achieving optimal system performance and resource utilization efficiency. This achieves the technical effect of rationally allocating processor resources, thereby solving the technical problem of unreasonable processor resource allocation. Attached Figure Description
[0022] Figure 1 This is a hardware structure block diagram of a server device for a processor resource scheduling method according to an embodiment of this application; Figure 2 This is a flowchart of a processor resource scheduling method according to an embodiment of this application; Figure 3 This is a schematic diagram of resource usage in a hyperconverged environment according to an embodiment of this application; Figure 4 This is a flowchart of a load-based processor resource scheduling method in a hyperconverged infrastructure scenario according to an embodiment of this application; Figure 5 This is a structural block diagram of a processor scheduling device according to an embodiment of this application. Detailed Implementation
[0023] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0025] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of a server device for a processor resource scheduling method according to an embodiment of this application. Figure 1 As shown, the server device may include one or more ( Figure 1Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0026] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the processor resource scheduling method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to server devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0028] This embodiment provides a processor resource scheduling method. Figure 2 This is a flowchart of a processor resource scheduling method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps: Step S202: Based on the business characteristic information of multiple threads in the hyperconverged service system, determine the scheduling priority of each thread.
[0029] In the technical solution provided in step S202 of this application, the hyperconverged service system is a system that integrates computing, storage, and networking functions. Multiple threads are used to indicate the computing task execution units in the hyperconverged service system, and the business characteristic information of the multiple threads is used to at least indicate the resource utilization of the processor by the multiple threads during task execution. Scheduling priority is used to indicate the priority of threads in processor time allocation; for example, the priority of a thread in the operating system's scheduling of processor resources.
[0030] In this embodiment, the scheduling priority of multiple threads in the hyperconverged service system is divided into three levels: high, medium, and low, based on the business characteristic information of multiple threads. High-priority threads receive more CPU time slices during resource scheduling and are executed first. Medium-priority threads are scheduled according to resource needs, ensuring the normal operation of high-priority threads. Low-priority threads execute when resources are sufficient or do not affect other threads, and their scheduling is significantly influenced by high-priority and medium-priority threads.
[0031] For example, high-priority threads have a sustained high demand for processor (Central Processing Unit, CPU) resources. If one of the threads utilizes nearly or equal to 100% of the processor resources during task execution, that thread's scheduling priority is set to high. If one of the threads utilizes between 20% and 100% of the processor resources during task execution, that thread's scheduling priority is set to medium. If one of the threads utilizes between 0% and 20% of the processor resources during task execution, it indicates that the processor's resource utilization demand is low and unstable; in this case, the thread's scheduling priority can be set to low.
[0032] Step S204: Determine the initialization configuration strategy for multiple threads based on their respective scheduling priorities.
[0033] In the technical solution provided in step S204 of this application, the initialization configuration strategy includes, but is not limited to: the binding state between threads and processors, and other resource configuration parameters.
[0034] In this embodiment, after determining the scheduling priorities of multiple threads, the initialization configuration strategy of multiple threads can be determined based on the scheduling priorities of multiple threads to optimize thread scheduling and processor resource allocation.
[0035] For example, for high-priority threads, the corresponding initialization configuration policy is determined to be the first initialization configuration policy. This policy instructs the high-priority thread to be configured in exclusive mode, meaning that the high-priority thread will exclusively use a specific CPU core during execution, and other threads cannot use the processor's resources. For medium-priority threads, the corresponding initialization configuration policy is determined to be the second initialization configuration policy. This policy instructs the medium-priority thread to be configured in range-bound mode, meaning that the medium-priority thread can be bound to multiple processors within a preset range. In other words, the medium-priority thread can be bound to a group of processors, but does not exclusively use any processor, thus allowing a certain degree of resource sharing while maintaining some resource isolation. For low-priority threads, the corresponding initialization configuration policy is determined to be the third initialization configuration policy. This policy instructs the corresponding thread to be set to non-exclusive and range-bound mode. The non-exclusive and range-bound mode allows the low-priority thread to be bound to multiple processors, but does not exclusively use any processor.
[0036] Optionally, the binding state in the initialization configuration strategy can indicate the association settings between threads and the CPU, including thread exclusive, non-exclusive, and range binding. A reasonable binding strategy can restrict threads to run on specific processor cores, reducing thread scheduling overhead, avoiding excessive resource contention, and improving overall system stability and responsiveness. Furthermore, the initialization configuration strategy may also include settings such as thread priority scheduling parameters (nice values), thread queue management, and interrupt affinity settings to further optimize thread scheduling priority and execution efficiency; specific limitations are not specified here.
[0037] Step S206: Based on the initialization configuration strategy, perform initialization configuration on multiple threads.
[0038] In the technical solution provided by step S206 of this application, after the initialization configuration is completed, multiple threads can be initialized according to the initialization strategy.
[0039] In this embodiment, as described in step S204 above, the initialization configuration strategy corresponding to high-priority threads is the first initialization configuration strategy, the initialization configuration strategy corresponding to medium-priority threads is the second initialization configuration strategy, and the initialization configuration strategy corresponding to low-priority threads is the third initialization configuration strategy. Based on this, the first initialization configuration strategy can be used to configure high-priority threads so that they are not interfered with by other threads during task execution; the second initialization configuration strategy can be used to configure medium-priority threads so that they can share resources with threads of equal or lower priority when resources are sufficient; and the third initialization configuration strategy can be used to configure low-priority threads so that they can make full use of idle processor resources without affecting the execution of high-priority and medium-priority threads.
[0040] Optionally, threads can be initialized at system startup or when they are created to ensure that they receive the best scheduling strategy and resource allocation from the very beginning based on their priority and resource requirements.
[0041] Step S208: Monitor the running status of the processors corresponding to the multiple threads after initialization configuration.
[0042] In the technical solution provided in step S208 of this application, after the initial configuration is completed, the running status of the processors allocated to all threads can be continuously monitored to understand the current utilization and frequency status of the processors. When the clock frequency of the active CPU cores begins to decrease, it indicates that the system is facing resource shortages or high load. When all CPU cores are active, it indicates that the system is under extremely high load pressure, which may require a more refined resource scheduling strategy to cope with.
[0043] In this embodiment, processor monitoring tools can be used to monitor multiple processors in the hyperconverged service system. When all processor cores are at their highest frequency, the running state of the processors corresponding to multiple threads is determined as the first state. When the core frequencies of all processors begin to decrease, but some processor cores are still inactive, the running state of the processors corresponding to multiple threads is determined as the second state. When all processor cores are active, the running state of the processors corresponding to multiple threads is determined as the third state.
[0044] Step S210: Based on the running state of the processors corresponding to the multiple threads, adjust the initialization configuration strategy corresponding to the multiple threads.
[0045] In the technical solution provided by step S210 of this application, after determining the running state of the processors corresponding to multiple threads, the initialization configuration strategy corresponding to the multiple threads can be adjusted according to the running state of the processors. In a hyperconverged service system, the running state of the processor (CPU) directly reflects the pressure level and allocation efficiency of system resources.
[0046] In this embodiment, when the system detects a change in the processor's operating state, it will dynamically adjust the thread configuration strategy based on the current state, including the binding state between the thread and the CPU core, the nice value, etc., without making specific restrictions here.
[0047] For example, if multiple threads are running in the first running state, it means that all active CPU cores are at their highest frequency, which usually indicates that system resources are sufficient. In this case, the initial configuration strategy for multiple threads can be maintained unchanged.
[0048] Optionally, if multiple threads are in a second running state, it indicates that the clock speeds of all active CPU cores are decreasing, and some cores are inactive. This means that some resources are not being fully utilized. In this case, the system adjusts the binding strategy for low-priority threads, binding them to processor cores with reduced frequencies that are not being fully utilized, to avoid resource waste. Simultaneously, the nice value of these threads is reduced. This strategy reduces the CPU resource requirements of low-priority threads, thereby freeing up more resources for high-priority threads.
[0049] Optionally, if multiple threads are in the third running state, it indicates that all CPU cores are active and under high load, which is usually a sign of high system stress, with almost all resources being utilized. In this case, low-priority threads can be bound to the CPU cores used by medium-priority threads. By adjusting the nice value, the resource requirements of each thread can be balanced, reducing excessive competition between threads and ensuring the running efficiency of all threads and the overall system performance. By adjusting the nice value, the system ensures that even when core resources are shared, the CPU utilization of medium-priority threads remains at a reasonable level, without affecting the execution efficiency of critical tasks.
[0050] In this step, by adjusting thread configuration strategies based on processor running status, CPU resources are ensured to be allocated reasonably under different load conditions, reducing resource waste and improving overall system efficiency. By dynamically adjusting the nice value and core binding strategy, unnecessary resource contention between threads is reduced, thread scheduling is optimized, and user experience is improved.
[0051] In steps S202 to S210 above, the scheduling priorities of multiple threads can be determined based on their business characteristics in the hyperconverged service system. Then, the initialization configuration strategy for each thread can be determined based on its scheduling priority. After initialization, the running status of the processors corresponding to the multiple threads can be monitored, and the thread configuration strategy can be dynamically adjusted based on the running status of the processors. This enables dynamic adjustment of processor resources to ensure that the processor resource allocation strategy can be adaptively adjusted under different load conditions to achieve optimal system performance and resource utilization efficiency. This achieves the technical effect of reasonable allocation of processor resources and solves the technical problem of unreasonable processor resource allocation.
[0052] The entities that perform the above steps can be servers, terminals, etc., but are not limited to these.
[0053] The above-mentioned method of this application will be further described below.
[0054] As an optional implementation, step S102, based on the business characteristic information of multiple threads in the hyperconverged service system, determines the scheduling priority corresponding to each of the multiple threads, including: configuring the multiple threads into non-exclusive mode, wherein the non-exclusive mode is used to indicate that the multiple threads have the right to share the same processor resource; in the non-exclusive mode, establishing a binding state between the multiple threads and the multiple processors in the hyperconverged service system, wherein the binding state is used to indicate the association relationship between the threads and the processors; increasing the load of the hyperconverged service system to determine the resource utilization rate of the multiple threads on the processor; and determining the scheduling priority corresponding to each of the multiple threads based on the resource utilization rate of the multiple threads on the processor.
[0055] In this embodiment, all threads in the system are configured to run in non-exclusive mode. Non-exclusive mode means that threads can share processor resources. This mode provides flexibility for subsequent thread hierarchy and dynamic scheduling, enabling the system to utilize the CPU more efficiently when resources are limited, while avoiding performance waste caused by excessive resource isolation.
[0056] Optionally, in non-exclusive mode, the system needs to establish a binding state between threads and processors, that is, determine the processor where each thread will run. It should be noted that this binding state is not a permanent exclusive binding, but a dynamic binding based on resource requirements, designed to ensure that threads can obtain reasonable and stable CPU resources according to their business characteristics. The binding state reflects the relationship between threads and CPU cores and is an important component of resource allocation and scheduling strategies.
[0057] Optionally, after establishing the binding state between multiple threads and multiple processors in the hyperconverged service system, the resource demand under different business scenarios can be simulated by increasing the load of the hyperconverged service system, and the scheduling priority of each thread can be determined according to the resource utilization rate of the processors by multiple threads.
[0058] In this step, the scheduling strategy can be adaptively adjusted based on the business characteristics of the thread and the actual resource requirements, so as to achieve dynamic and reasonable allocation of processor resources and improve the overall performance and resource utilization of the hyperconverged service system.
[0059] As an optional implementation, the load on the hyperconverged service system is increased to determine the resource utilization of the processor by multiple threads, including: increasing the load on the hyperconverged service system in ascending order; and monitoring the resource utilization of the processor by multiple threads under different loads of the hyperconverged service system as the load on the hyperconverged service system dynamically increases.
[0060] In this embodiment, the load on the hyperconverged service system is gradually increased in order from low to high by simulating different business scenarios or using load testing tools. For example, the number of virtual machines, data processing volume, or concurrent requests are gradually increased to simulate the load pressure that the hyperconverged service may encounter in actual use.
[0061] Optionally, as the load increases, the resource utilization of each thread on the processor can be continuously monitored. That is, as the load of the hyperconverged service system dynamically changes, the CPU usage of all threads will be observed and recorded in real time with each additional load unit (such as a virtual machine). This monitoring is not limited to CPU utilization, but also includes the operating status of other processors, such as the operating frequency of each core and cache hit rate, to comprehensively understand the system's resource consumption and performance.
[0062] In this step, by collecting and analyzing the resource utilization of threads under different load levels, we can more accurately assess the business characteristics and resource requirements of each thread.
[0063] As an optional implementation, the scheduling priority of each thread is determined based on the resource utilization rate of the processor by multiple threads, including: determining the scheduling priority of threads whose resource utilization rate of the processor is within a first threshold range as high priority; determining the scheduling priority of threads whose resource utilization rate of the processor is within a second threshold range as medium priority, wherein the first threshold range is greater than the second threshold range; and determining the scheduling priority of threads whose resource utilization rate of the processor is within a third threshold range as low priority, wherein the second threshold range is greater than the third threshold range.
[0064] In this embodiment, after determining the resource utilization of the processor by multiple threads, the scheduling priority of each thread can be further determined based on the resource utilization of the processor by multiple threads.
[0065] Optionally, threads whose processor resource utilization is within a first threshold range can be assigned a high priority; threads whose processor resource utilization is within a second threshold range can be assigned a medium priority, where the first threshold range is greater than the second threshold range; and threads whose processor resource utilization is within a third threshold range can be assigned a low priority, where the second threshold range is greater than the third threshold range. The first threshold range can be approximately 100%, the second threshold range can be 20%-100%, and the third threshold range can be 0-20%. This is merely an example and does not limit the specific data corresponding to the thresholds.
[0066] Optionally, high-priority threads have stable and high processor resource requirements, medium-priority threads have more flexible resource requirements that may fluctuate within a certain range, and low-priority threads have lower processor resource requirements that may be unstable. Setting a threshold for low-priority threads ensures that they do not excessively consume resources, thus affecting the execution efficiency of high-priority and medium-priority threads.
[0067] In this step, the hyperconverged service system can adaptively adjust the thread scheduling priority and resource allocation strategy based on the actual utilization of processor resources by the threads, ensuring that the system can efficiently and rationally utilize CPU resources in dynamically changing business scenarios, thereby improving overall performance and user experience.
[0068] As an optional implementation, step S104, based on the scheduling priorities of the multiple threads, determines the initialization configuration strategy for the multiple threads, including: determining the initialization configuration strategy of the thread with the highest scheduling priority among the multiple threads as the first initialization configuration strategy, wherein the first initialization configuration strategy is used to indicate that the corresponding thread is set to exclusive mode, and exclusive mode indicates that the thread is bound to a single processor; determining the initialization configuration strategy of the thread with the medium scheduling priority among the multiple threads as the second initialization configuration strategy, wherein the second initialization configuration strategy is used to indicate that the corresponding thread is set to range binding mode, and range binding mode allows the corresponding thread to be bound to multiple processors within a preset range; determining the initialization configuration strategy of the thread with the lowest scheduling priority among the multiple threads as the third initialization configuration strategy, wherein the third initialization configuration strategy is used to indicate that the corresponding thread is set to non-exclusive and range binding mode, wherein non-exclusive and range binding mode allows the corresponding thread to be bound to multiple processors without exclusively using any processor.
[0069] In this embodiment, the first initialization configuration strategy is set to exclusive mode, meaning each thread is bound to a single processor to ensure stable CPU resources, unaffected by other threads, thus improving execution efficiency and task response speed. The second initialization configuration strategy is set to range binding mode, allowing threads to bind to multiple processors within a preset range, but without exclusively occupying any processor. The third initialization configuration strategy is set to non-exclusive and range binding mode, meaning threads can bind to multiple processors, but without exclusively occupying any processor. This strategy allows low-priority threads to make reasonable use of remaining processor resources without affecting high-priority and medium-priority threads.
[0070] Optionally, for high-priority threads, since their demand for processor resources is stable and high during task execution, their utilization rate is typically close to 100%. Therefore, a first initialization configuration strategy can be used to set these threads (high-priority threads) to exclusive mode. That is, each high-priority thread will be bound to a single processor to ensure that it has stable CPU resources, is not affected by other threads, and improves execution efficiency and task response speed. Under this configuration strategy, high-priority threads can obtain maximized processing power and minimal scheduling latency, which is the fundamental guarantee for the execution of critical tasks in the system.
[0071] Optionally, for medium-priority threads, whose CPU utilization fluctuates between 20% and 100%, meaning their needs are relatively flexible—requiring some processor resources while also being able to accept a degree of resource sharing—a second initialization configuration strategy can be used to set these threads to range-binding mode. This allows medium-priority threads to bind to multiple processors within a preset range, without exclusively occupying any processor. This configuration strategy enables medium-priority threads to run on multiple CPU cores, flexibly adjusting according to the current system load to achieve efficient resource utilization while ensuring fair scheduling among threads.
[0072] Optionally, for low-priority threads, whose CPU utilization is between 0-20%, their demand for processor resources is low and unstable. A third initialization configuration strategy can be used to set these threads to a non-exclusive, range-bound mode, meaning these threads can be bound to multiple processors but do not exclusively occupy any processor. Optionally, the priority scheduling parameters (nice value) of low-priority threads will also be adjusted according to the system state to further control their allocation of CPU time slices, ensuring that the execution of high-priority tasks is not interfered with.
[0073] In this step, through a priority-based initialization configuration strategy, the hyperconverged service system can intelligently allocate processor resources according to the resource requirements and business characteristics of different threads, achieving fine-grained resource management and efficient utilization. Under high load, the system can prioritize the execution efficiency of critical tasks, while when resources are relatively abundant, it can rationally utilize the remaining processor resources to execute low-priority tasks, improving the overall system responsiveness and user satisfaction. Implementing this strategy requires the system to have the ability to monitor processor operating status in real time and a mechanism for dynamically adjusting thread configurations to ensure the flexibility and adaptability of resource scheduling.
[0074] As an optional implementation, the resource scheduling method of the processor further includes: high-priority threads are configured with a first priority scheduling parameter, medium-priority threads are configured with a second priority scheduling parameter, and low-priority threads are configured with a third priority scheduling parameter, wherein the first priority scheduling parameter is less than the second priority scheduling parameter, the second priority scheduling parameter is less than the third priority scheduling parameter, and the scheduling priority is inversely proportional to the scheduling priority parameter.
[0075] In this embodiment, high-priority threads are configured with a first-priority scheduling parameter, medium-priority threads are configured with a second-priority scheduling parameter, and low-priority threads are configured with a third-priority scheduling parameter. In actual scheduling strategies, these parameters are typically expressed as nice values, representing the thread's priority in processor time slice allocation.
[0076] Optionally, the first priority scheduling parameter is less than the second priority scheduling parameter, and the second priority scheduling parameter is less than the third priority scheduling parameter. This means that the nice value is inversely proportional to the priority; that is, the smaller the nice value, the higher the scheduling priority of the thread, and the more processor time it can obtain; the larger the nice value, the lower the scheduling priority of the thread, and the less processor time it is allocated.
[0077] Optionally, the scheduling priority is inversely proportional to the priority scheduling parameter; that is, the higher the scheduling priority of a thread, the lower the corresponding priority scheduling parameter.
[0078] In this step, the thread priority-based scheduling parameter configuration ensures that CPU resources are allocated reasonably under different loads and pressures, and critical tasks are prioritized. This scheduling mechanism not only maximizes processor utilization but also avoids resource waste and excessive contention, improving the stability and performance of hyperconverged services.
[0079] As an optional implementation, step S106, monitoring the running status of the processors corresponding to the multiple threads after initialization configuration, includes: using a processor monitoring tool to monitor the frequency status of the processors corresponding to the multiple threads; and determining the running status of the processors corresponding to the multiple threads based on the frequency status of the processors corresponding to the multiple threads.
[0080] In this embodiment, the processors corresponding to multiple threads are used to indicate the processors to which the multiple threads are bound, and the frequency status is used to indicate the core frequency of processing, which is an important indicator reflecting the processor activity and load level.
[0081] Optionally, processor monitoring tools, such as CPU performance monitoring software or kernel modules, can be used to monitor the core frequency of the processor to which each thread in the hyperconverged service system is bound. When the processor is at a high frequency, it usually means that the load is light and the processor can run at its maximum performance; while when the processor frequency drops, it indicates that the processor is under a high load, and the system may need to adjust resource allocation to cope.
[0082] Optionally, based on the processor's frequency status, the processor's operating state is divided into three categories: the first operating state, the second operating state, and the third operating state. The first operating state indicates that all active processor cores are at their highest frequency. In this state, the system's current load is relatively low, processor resources are sufficient, and thread execution efficiency is high. The second operating state indicates that the processor core frequency begins to decrease, but some cores remain inactive, indicating that the system is beginning to face resource constraints. The processor begins to adjust its frequency to balance performance and power consumption. At this point, it may be necessary to optimize the configuration of low-priority threads to reduce resource waste. The third operating state indicates that all processor cores are active and under high load. This indicates that the system has reached or is close to full load operation, with almost all resources being utilized. At this point, more detailed adjustments to the configuration of medium-priority and low-priority threads are needed to ensure that the execution efficiency of critical tasks is not affected.
[0083] In this step, by continuously monitoring the processor's operating status and intelligently adjusting the thread configuration strategy according to the status changes, the dynamic optimization allocation of CPU resources in the hyperconverged service system can be achieved, ensuring that the system can maintain high operating efficiency and stable performance under different load pressures.
[0084] As an optional implementation, step S108, based on the frequency state of the processors corresponding to the multiple threads, determines the running state of the processors corresponding to the multiple threads, including: in response to the frequency state of the processors corresponding to the multiple threads being at its highest frequency, determining the running state of the processors corresponding to the multiple threads as a first running state; in response to the frequency of the processors corresponding to the multiple threads decreasing and the existence of inactive processors in the hyperconverged service system, determining the running state of the processors corresponding to the multiple threads as a second running state; and in response to the processors corresponding to the multiple threads being in an active state, determining the running state of the processors corresponding to the multiple threads as a third running state.
[0085] In this embodiment, in response to the processor frequency state corresponding to multiple threads being at its highest frequency (i.e., all active CPU cores are at their highest frequency), the running state of the processors corresponding to multiple threads is determined as the first running state. In response to the processor frequency decreasing and the existence of inactive processors in the hyperconverged service system, the running state of the processors corresponding to multiple threads is determined as the second running state; in response to the processors corresponding to multiple threads being in an active state, the running state of the processors corresponding to multiple threads is determined as the third running state.
[0086] In this step, real-time monitoring of the processor frequency status helps provide data reference for subsequent thread configuration.
[0087] As an optional implementation, the initialization configuration strategy for multiple threads is adjusted based on the running state of the processor corresponding to the multiple threads, including: in response to the running state of the processor corresponding to the multiple threads being a first running state, determining that the initialization configuration strategy for the multiple threads remains unchanged; in response to the running state of the processor corresponding to the multiple threads being a second running state, adjusting the initialization configuration strategy for low-priority threads; and in response to the running state of the processor corresponding to the multiple threads being a third running state, adjusting the initialization configuration strategy for low-priority threads and the initialization configuration strategy for medium-priority threads.
[0088] In this embodiment, when the processors corresponding to multiple threads are all in the first running state, that is, when all active CPU cores are at their highest frequency, it indicates that system resources are sufficient and the current load level is not putting pressure on the processors. In this case, there is no need to adjust the thread initialization configuration strategy; that is, the initialization configuration strategy of multiple threads remains unchanged. Each thread maintains its initial configuration based on priority: high-priority threads exclusively occupy and bind to specific CPU cores, medium-priority threads are range-bound, and low-priority threads are in a non-exclusive and range-bound state. This strategy maintenance mechanism ensures that the system can run with a stable configuration when resources are not scarce, avoiding performance fluctuations caused by unnecessary configuration adjustments.
[0089] Optionally, when multiple threads are running in a second running state (i.e., the CPU core frequencies of all processors begin to decrease, but some CPU cores remain inactive), it indicates that system resources are starting to experience some pressure, but have not yet reached a level of full strain. In this case, the initialization configuration strategy for low-priority threads can be adjusted to free up more CPU resources for medium- and high-priority threads. For example, reducing the number of CPU cores bound to low-priority threads, running low-priority threads on fewer cores, and adjusting the nice value to limit the allocation of CPU time slices for low-priority threads, thus reducing the impact on high-priority tasks. This adjustment can be made in the early stages of resource pressure, preventing further degradation of system performance while ensuring that critical business operations are not affected.
[0090] Optionally, when multiple threads are running in the third running state (i.e., all CPU cores are under high load), indicating extremely high system pressure, not only will the configuration of low-priority threads be adjusted, but the configuration strategy for medium-priority threads will also be further optimized. For example, low-priority threads may be required to further reduce resource consumption, possibly by adjusting their core bindings to share resources with medium-priority threads, and by using stricter nice value settings to ensure that the resource requirements of low-priority threads do not hinder the execution of medium- and high-priority threads. The configuration of medium-priority threads will also be adjusted; for example, by adjusting the nice value, it can be ensured that the resource allocation obtained by medium-priority threads on CPU cores remains stable, maintaining a certain level of execution efficiency even under high load.
[0091] In this step, by continuously monitoring the CPU core's operating status, the thread configuration strategy is intelligently adjusted to adapt to constantly changing business loads, ensuring reasonable resource allocation and efficient utilization. This strategy adjustment mechanism not only improves the overall system performance but also enhances the system's adaptability and flexibility to complex operating environments.
[0092] As an optional implementation, the initialization configuration strategy for low-priority threads can be adjusted, including: reducing the number of processors bound to low-priority threads; and increasing the priority scheduling parameters corresponding to low-priority threads.
[0093] In this embodiment, in the hyperconverged service system, when the processor's running state changes from the first running state (all active CPU cores are at their highest frequency) to the second running state (all active CPU cores start to reduce their clock speed, but some cores are still inactive), the configuration of low-priority threads needs to be adjusted to adapt to the change in load pressure.
[0094] Optionally, when the processor's running state switches from the first running state to the second running state, it indicates that the system is beginning to experience resource pressure. To ensure that the performance of high-priority and medium-priority threads is not affected, the binding strategy for low-priority threads can be adjusted. For example, the number of processors bound to low-priority threads can be reduced, so that these threads no longer consume excessive core resources. Implementing this strategy typically involves reallocating or restricting low-priority threads from the multiple processor cores they were previously bound to, to fewer processor cores. For instance, unbinding low-priority threads from previously bound active cores and rebinding them to inactive or low-frequency processor cores can reduce the resource consumption of low-priority threads, freeing up more processor cores for high-priority and medium-priority threads, thereby ensuring the execution efficiency and response speed of critical business processes.
[0095] Optionally, when the processor switches from a first running state to a second running state, in addition to adjusting the number of processors bound to each thread, the resource allocation of low-priority threads can be further controlled by increasing priority scheduling parameters (e.g., the nice value). In the second running state, increasing the priority scheduling parameter of low-priority threads means that these threads are at a lower priority level in the allocation of processor time slices. This adjustment of the scheduling strategy ensures that even with a limited number of processor cores, high-priority and medium-priority threads can obtain sufficient processor time to maintain their execution efficiency. By increasing the nice value of low-priority threads, the system can effectively limit the processor resource consumption of these threads, preventing them from excessively affecting the execution of critical tasks when resources are scarce.
[0096] In this step, by reducing the number of processors bound to low-priority threads and increasing their priority scheduling parameters, the thread configuration strategy can be dynamically adjusted to adapt to the ever-changing load pressure in the hyperconverged service system. This adjustment mechanism ensures that when the system faces resource pressure, it can prioritize the performance of critical tasks and high-priority services, while making reasonable use of remaining resources, avoiding resource waste, and improving overall system efficiency.
[0097] As an optional implementation, adjusting the initialization configuration strategy of low-priority threads and the initialization configuration strategy of medium-priority threads includes: binding low-priority threads to the processors corresponding to medium-priority threads; and adjusting the priority scheduling parameters corresponding to medium-priority threads.
[0098] In this embodiment, when the processor in the hyperconverged service system switches from the second running state to the third running state, the initialization configuration strategy of low-priority and medium-priority threads can be adjusted to adapt to the current resource pressure and load.
[0099] Optionally, when a processor in a hyperconverged service system transitions from a second to a third running state—meaning the processor frequency decreases but some cores remain inactive—it switches to a state where all cores are active. In this case, the configuration of low-priority threads will be readjusted; for example, low-priority threads may be bound to the processors used by medium-priority threads. By adjusting the nice value, it is ensured that low-priority threads do not affect the execution efficiency of medium-priority threads when sharing resources.
[0100] Optionally, when a processor in the hyperconverged service system switches from the second running state to the third running state, indicating that the processor state change has caused the system to enter a resource-pressure state, the configuration of the medium-priority thread will also be adjusted. For example, the nice value of the medium-priority thread may be appropriately adjusted to reduce its consumption of processor resources. The nice value of the medium-priority thread can be dynamically adjusted according to the current CPU usage to ensure that critical tasks can be executed first when resources are limited, without the execution efficiency of the medium-priority thread being severely affected.
[0101] In this step, the configuration strategies of low-priority and medium-priority threads can be adaptively adjusted when facing different resource pressures, thereby achieving optimized resource allocation and improving overall system performance and resource utilization.
[0102] The technical solutions of the embodiments of the present invention will be illustrated below with reference to preferred embodiments.
[0103] Currently, when allocating CPU resources in hyperconverged infrastructure scenarios, a fixed configuration is usually output based on specific hardware configurations and simulated fixed loads. However, this does not take into account the adaptation to complex stress load changes in actual production conditions, resulting in a technical problem of unreasonable processor resource allocation.
[0104] However, this application provides a load-based processor resource scheduling method in a hyperconverged infrastructure (HCI) scenario. First, threads in the HCI service are prioritized, and through practical testing, they are divided into high, medium, and low priorities. Then, the HCI environment is stress-tested, for example, by gradually increasing the number of virtual machines. By monitoring CPU resource utilization and the overall CPU frequency status, the system state is set into three categories, and the transition between states is used as a trigger condition to adjust thread priorities, core binding strategies, and other configurations. This achieves the goal of dynamically adjusting processor resource usage based on load, realizing reasonable processor resource scheduling, and thus solving the technical problem of unreasonable processor resource scheduling.
[0105] The following section will further describe the process of prioritizing threads in a hyperconverged scenario in this embodiment of the application.
[0106] In this implementation, when prioritizing threads in a hyperconverged infrastructure, threads are configured as non-exclusive, and each thread is mapped one-to-one with a CPU core and bound to a fixed core. Then, load testing is performed on the hyperconverged service using load testing tools. As the load is increased, the CPU usage of each thread changes, and the priority of each thread is determined based on its CPU utilization.
[0107] Optionally, if a thread's CPU utilization is around 100%, the thread's priority is determined to be high priority; if a thread's CPU utilization fluctuates between 20% and 100%, the thread's priority is determined to be medium priority; and if a thread's CPU utilization fluctuates between 0% and 20%, the thread's priority is determined to be low priority.
[0108] Optionally, after prioritizing the threads, a thread configuration strategy can be further initialized based on the priorities.
[0109] The process of initializing thread configuration strategies based on priority will be described next.
[0110] In this embodiment, the initialization configuration strategy for threads is determined based on their priorities. For example, high-priority threads are set to exclusively occupy CPU cores, and the CPU cores they occupy are bound and isolated. Based on the highest total utilization of medium-priority threads, sufficient CPU cores are isolated and threads are bound within a range. The number of CPU cores is denoted as... Bind the CPU to low-priority threads and set them to non-exclusive.
[0111] Optionally, after configuring the thread initialization strategy, the thread configuration strategy can be dynamically adjusted based on the processor's workload during actual business operations. The process of dynamically adjusting the thread configuration strategy will be further described below.
[0112] In this embodiment, a CPU monitoring tool can be used to monitor all CPU cores in the hyperconverged environment and classify the CPU's operating status into three different states.
[0113] For example, when all active CPU cores are at their highest frequency, the CPU is determined to be in the first operating state; when the clock speed of all active CPU cores begins to decrease, but some cores are still inactive, the CPU is determined to be in the second operating state; when all CPU cores are active, the CPU is determined to be in the third operating state.
[0114] Optionally, when the CPU is in the first running state, the thread initialization configuration strategy remains unchanged.
[0115] Optionally, when the CPU is in the second running state, the thread initialization configuration strategy is adjusted. For example, when the CPU is in the critical state between state one and state two, the CPU utilization of the hyperconverged service thread is recorded using the following formula.
[0116]
[0117] in, Used to represent the CPU utilization of the i-th process.
[0118] Optionally, after recording CPU utilization, processes with low priority are grouped and bound to fixed cores, and processes on the same core satisfy the following formula.
[0119]
[0120] Optionally, when the CPU is in the third running state, the initialization configuration strategy for threads is adjusted. For example, when the CPU is at the threshold between state two and state three, the CPU utilization rate of each low-priority thread and the CPU core number currently used are recorded; the medium-priority process is bound to the CPU core recorded in the previous step; the medium-priority threads are sorted according to the CPU utilization rate, and different nice values are set for processes on the same core according to different CPU utilization rates; the low-priority threads are bound to the medium-priority threads according to the following rules.
[0121] Optionally, when binding low-priority threads to the CPUs corresponding to medium-priority threads, the low-priority threads can be retrieved first, and their current CPU utilization recorded. These threads are then placed on medium-priority cores where CPU utilization is below 100%, and the nice value of the threads is adjusted from high to low until the CPU utilization of existing threads on that core is unaffected. All low-priority threads are iterated in the same way until all low-priority threads are bound to medium-priority cores. Once the locations of all low-priority processes are determined, the configuration is fixed. When the upper-level CPU utilization decreases, the configuration is rolled back based on the state switch.
[0122] Optionally, Figure 3 This is a schematic diagram of resource usage in a hyperconverged environment according to an embodiment of this application, such as... Figure 3 As shown, this illustrates the CPU resource usage of threads with different priorities.
[0123] Figure 4 This is a flowchart illustrating a load-based processor resource scheduling method in a hyperconverged infrastructure scenario according to an embodiment of this application, as shown below. Figure 4 As shown, the method includes the following steps: Step S401: Bind core to hyperconverged service thread.
[0124] In this embodiment, the threads in the hyperconverged service are set to non-exclusive mode, and all threads are bound to a CPU core.
[0125] Step S402, simulated pressure test.
[0126] In this embodiment, the hyperconverged service is subjected to stress testing using a stress testing tool. During the successive stress increase process, the CPU usage of the threads under different stress levels is observed.
[0127] Step S403, Hyperconverged service thread grading.
[0128] In this embodiment, the hyperconverged service threads are divided into three priorities: high, medium, and low, based on CPU usage.
[0129] Step S404: Initialize thread configuration.
[0130] In this embodiment, based on the grading results in step one, an initial scheduling strategy is set for threads of different priorities.
[0131] Step S405: Run the upper-layer service.
[0132] In this embodiment, after setting the initial scheduling policy for threads of different priorities, the upper-layer business is run to determine the changes in the processor's running state.
[0133] Step S406: Determine if the status is upgraded.
[0134] In this embodiment, if the operating state is upgraded, the operating state of the CPU is further determined. If the CPU is in the first operating state, step S407 is executed. If the CPU's operating state changes from the first operating state to the second operating state, step S408 is executed. If the CPU's operating state changes from the second operating state to the third operating state, step S409 is executed.
[0135] Step S407: Keep the configuration unchanged.
[0136] Step S408, low-priority thread CPU binding reduces the total number of CPUs used.
[0137] Step S409: Bind the low-priority thread to the core where the medium-priority thread resides to further reduce CPU usage.
[0138] Step S410: Determine whether the state should be rolled back.
[0139] In this embodiment, it is determined whether the CPU operating state has rolled back. If yes, step S411 is executed. If no, step S412 is executed.
[0140] Step S411, roll back the configuration.
[0141] In this embodiment, the thread configuration is rolled back.
[0142] Step S412: Determine whether the status needs to be upgraded.
[0143] In this embodiment, it is determined whether the CPU operating status has been upgraded. If yes, step S406 is executed; otherwise, step S413 is executed.
[0144] Step S413: Keep the configuration unchanged.
[0145] In steps S401 to S413 above, CPU resource allocation is finely adjusted according to the business pressure level in the hyperconverged environment, which can achieve efficient and adaptive scheduling, effectively cope with complex and ever-changing business scenarios, and improve the response speed and overall efficiency of hyperconverged services.
[0146] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0147] This embodiment also provides a processor scheduling device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, hardware implementations, or a combination of software and hardware, are also possible and contemplated.
[0148] Figure 5 This is a structural block diagram of a processor scheduling device according to an embodiment of this application, such as... Figure 5 As shown, the scheduling device 500 of the processor includes: a first determining unit 501, a second determining unit 502, a configuration unit 503, a monitoring unit 504, and an adjustment unit 505.
[0149] The first determining unit 501 is used to determine the scheduling priority of each thread based on the business characteristic information of multiple threads in the hyperconverged service system. The business characteristic information is used to at least indicate the resource utilization rate of the processor by multiple threads during task execution.
[0150] The second determining unit 502 is used to determine the initialization configuration strategy of multiple threads based on the scheduling priorities corresponding to the multiple threads respectively, wherein the initialization configuration strategy includes at least the binding state between the corresponding thread and the processor in the hyperconverged service system.
[0151] Configuration unit 503 is used to perform initialization configuration on multiple threads based on an initialization configuration strategy.
[0152] The monitoring unit 504 is used to monitor the running status of the processors corresponding to multiple threads after initialization configuration, wherein the running status is used to at least indicate the running frequency of the corresponding processor.
[0153] Adjustment unit 505 is used to adjust the initialization configuration strategy of multiple threads based on the running status of the processors corresponding to multiple threads.
[0154] Optionally, the device 500 is further configured to: configure multiple threads into non-exclusive mode, wherein the non-exclusive mode indicates that multiple threads have the right to share the same processor resource; in the non-exclusive mode, establish a binding state between multiple threads and multiple processors in the hyperconverged service system, wherein the binding state indicates the association between threads and processors; increase the load of the hyperconverged service system to determine the resource utilization rate of the multiple threads on the processor; the first determining unit 501 is further configured to: determine the scheduling priority corresponding to each of the multiple threads based on the resource utilization rate of the multiple threads on the processor.
[0155] Optionally, the device 500 is also used to: increase the load of the hyperconverged service system in ascending order; and monitor the resource utilization of multiple threads on the processor under different loads of the hyperconverged service system during the dynamic increase of the load of the hyperconverged service system.
[0156] Optionally, the first determining unit 501 is further configured to: determine the scheduling priority of threads whose processor resource utilization rate is within a first threshold range as high priority among multiple threads; determine the scheduling priority of threads whose processor resource utilization rate is within a second threshold range among multiple threads as medium priority, wherein the first threshold range is greater than the second threshold range; and determine the scheduling priority of threads whose processor resource utilization rate is within a third threshold range among multiple threads as low priority, wherein the second threshold range is greater than the third threshold range.
[0157] Optionally, the second determining unit 502 is further configured to: determine the initialization configuration strategy of the thread with a high scheduling priority among the multiple threads as a first initialization configuration strategy, wherein the first initialization configuration strategy is used to indicate that the corresponding thread is set to exclusive mode, and exclusive mode is used to indicate that the thread is bound to a single processor; determine the initialization configuration strategy of the thread with a medium scheduling priority among the multiple threads as a second initialization configuration strategy, wherein the second initialization configuration strategy is used to indicate that the corresponding thread is set to range binding mode, and range binding mode allows the corresponding thread to be bound to multiple processors within a preset range; determine the initialization configuration strategy of the thread with a low scheduling priority among the multiple threads as a third initialization configuration strategy, wherein the third initialization configuration strategy is used to indicate that the corresponding thread is set to non-exclusive and range binding mode, wherein non-exclusive and range binding mode allows the corresponding thread to be bound to multiple processors without exclusively using any processor.
[0158] Optionally, the monitoring unit 504 is also used to: monitor the frequency status of the processors bound to multiple threads using a processor monitoring tool; and determine the running status of the processors corresponding to multiple threads based on the frequency status of the processors corresponding to the multiple threads.
[0159] Optionally, the monitoring unit 504 is further configured to: determine the running state of the processors corresponding to the multiple threads as a first running state in response to the processors' frequency state being at its highest frequency; determine the running state of the processors corresponding to the multiple threads as a second running state in response to the processors' frequency decreasing and the presence of inactive processors in the hyperconverged service system; and determine the running state of the processors corresponding to the multiple threads as a third running state in response to the processors corresponding to the multiple threads being in an active state.
[0160] Optionally, the adjustment unit 505 is further configured to: determine that the initialization configuration strategy of the multiple threads remains unchanged in response to the processor's running state corresponding to the multiple threads being in a first running state; adjust the initialization configuration strategy of the low-priority threads in response to the processor's running state corresponding to the multiple threads being in a second running state; and adjust the initialization configuration strategy of the low-priority threads and the initialization configuration strategy of the medium-priority threads in response to the processor's running state corresponding to the multiple threads being in a third running state.
[0161] Optionally, the adjustment unit 505 is also used to: reduce the number of processors bound to low-priority threads; and increase the priority scheduling parameters corresponding to low-priority threads.
[0162] Optionally, the adjustment unit 505 is also used to: bind low-priority threads to the processors corresponding to medium-priority threads; and adjust the priority scheduling parameters corresponding to medium-priority threads.
[0163] In this device, the scheduling priorities of multiple threads can be determined based on their business characteristics in the hyperconverged service system. Then, based on these priorities, the initialization configuration strategies for the multiple threads can be determined, and the threads can be initialized and configured. Afterward, the running status of the processors corresponding to the multiple threads can be monitored, and the thread configuration strategies can be dynamically adjusted based on the processors' running status. This enables dynamic adjustment of processor resources, ensuring that the processor resource allocation strategy can be adaptively adjusted under different load conditions to achieve optimal system performance and resource utilization efficiency. This achieves the technical effect of rationally allocating processor resources, thereby solving the technical problem of unreasonable processor resource allocation.
[0164] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0165] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0166] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0167] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0168] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0169] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0170] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0171] The embodiments described herein also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0172] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0173] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0174] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method of resource scheduling for a processor, the method comprising: Applied to hyperconverged service systems The method includes: Based on the business characteristic information of multiple threads in the hyperconverged service system, the scheduling priority of each of the multiple threads is determined, wherein the business characteristic information is used to at least indicate the resource utilization of the processor by the multiple threads during task execution. Based on the scheduling priorities corresponding to the multiple threads, an initialization configuration strategy for the multiple threads is determined, wherein the initialization configuration strategy includes at least the binding state between the corresponding thread and the processor in the hyperconverged service system; Based on the initialization configuration strategy, the multiple threads are initialized and configured. Monitor the running status of the processors corresponding to the multiple threads after initial configuration, wherein the running status is used to at least indicate the running frequency of the corresponding processor; Based on the running state of the processors corresponding to the multiple threads, adjust the initialization configuration strategy corresponding to the multiple threads; The step of adjusting the initialization configuration strategy corresponding to the multiple threads based on the running state of the processors corresponding to the multiple threads includes: In response to the fact that the running state of the processors corresponding to the plurality of threads is a first running state, it is determined that the initialization configuration strategy of the plurality of threads remains unchanged, wherein the running state of the processors corresponding to the plurality of threads is the first running state when the frequency state of the processors corresponding to the plurality of threads is at the highest frequency state. In response to the processors corresponding to the multiple threads being in the second running state, the initialization configuration strategy of low-priority threads is adjusted. In this case, the processors corresponding to the multiple threads are in the second running state when the frequency of the processors corresponding to the multiple threads is reduced but there are inactive processors in the hyperconverged service system. In response to the processors corresponding to the multiple threads being in a third running state, the initialization configuration strategies for low-priority threads and medium-priority threads are adjusted. The processors corresponding to the multiple threads are in the third running state when all of them are active. The scheduling priority includes high priority, medium priority, and low priority, with high priority being higher than medium priority and medium priority being higher than low priority. The adjustment of the initialization configuration strategy for the low-priority threads includes: Reduce the number of processors to which the low-priority threads are bound; Increase the priority scheduling parameter corresponding to the low-priority thread; The adjustment of the initialization configuration strategy for the low-priority thread and the initialization configuration strategy for the medium-priority thread includes: Bind the low-priority thread to the processor corresponding to the medium-priority thread; Adjust the priority scheduling parameters corresponding to the medium-priority threads; The method further includes, after adjusting the initialization configuration strategies corresponding to the multiple threads: In response to a rollback of the running state of the processors corresponding to the multiple threads, the rollback adjusts the initialization configuration strategy corresponding to the multiple threads.
2. The method according to claim 1, characterized in that, Based on the business characteristic information of multiple threads in the hyperconverged service system, the method further includes determining the scheduling priority of each of the multiple threads. The multiple threads are configured in non-exclusive mode, wherein the non-exclusive mode indicates that the multiple threads have the right to share the same processor resource; In the non-exclusive mode, a binding state is established between the multiple threads and the multiple processors in the hyperconverged service system, wherein the binding state is used to represent the association relationship between the threads and the processors; Increase the load on the hyperconverged service system to determine the resource utilization of the processor by the multiple threads; Based on the resource utilization of the processor by the multiple threads, the scheduling priority of each of the multiple threads is determined.
3. The method according to claim 2, characterized in that, Increase the load on the hyperconverged service system to determine the resource utilization of the processor by the multiple threads, including: Increase the load of the hyperconverged service system in ascending order of load. During the dynamic increase of the load on the hyperconverged service system, the resource utilization of the processor by the multiple threads under different loads on the hyperconverged service system is monitored.
4. The method according to claim 2, characterized in that, Based on the resource utilization of the processor by the multiple threads, the scheduling priority corresponding to each of the multiple threads is determined, including: Among the multiple threads, the thread whose processor resource utilization rate is within the first threshold range is assigned a high priority for scheduling. Among the plurality of threads, the scheduling priority of the threads whose processor resource utilization rate is within the second threshold range is determined as medium priority, wherein the first threshold range is greater than the second threshold range; Among the multiple threads, the threads whose processor resource utilization rate is within the third threshold range are assigned a low priority scheduling priority, wherein the second threshold range is greater than the third threshold range.
5. The method according to claim 4, characterized in that, Based on the scheduling priorities corresponding to the multiple threads, the initialization configuration strategy for the multiple threads is determined, including: The initialization configuration strategy of the thread with the highest scheduling priority among the multiple threads is determined as the first initialization configuration strategy, wherein the first initialization configuration strategy is used to indicate that the corresponding thread is set to exclusive mode, and the exclusive mode is used to indicate that the thread is bound to a single processor. The initialization configuration strategy of the thread with the scheduling priority of medium priority among the multiple threads is determined as the second initialization configuration strategy. The second initialization configuration strategy is used to indicate that the corresponding thread is set to the range binding mode, which allows the corresponding thread to be bound to multiple processors within a preset range. The initialization configuration strategy of the thread with the lowest scheduling priority among the multiple threads is determined as the third initialization configuration strategy. The third initialization configuration strategy is used to indicate that the corresponding thread is set to a non-exclusive and range-bound mode. The non-exclusive and range-bound mode allows the corresponding thread to be bound to multiple processors without exclusively occupying any processor.
6. The method according to claim 5, characterized in that, The method further includes: The high-priority threads are configured with a first priority scheduling parameter, the medium-priority threads are configured with a second priority scheduling parameter, and the low-priority threads are configured with a third priority scheduling parameter. The first priority scheduling parameter is less than the second priority scheduling parameter, the second priority scheduling parameter is less than the third priority scheduling parameter, and the scheduling priority is inversely proportional to the scheduling priority parameter.
7. The method according to claim 1, characterized in that, Monitor the running status of the processors corresponding to the multiple threads after initial configuration, including: Use processor monitoring tools to monitor the frequency status of the processors to which the multiple threads are bound; The running state of the processors corresponding to the multiple threads is determined based on the frequency state of the processors corresponding to the multiple threads.
8. The method according to claim 1, characterized in that, Based on the frequency state of the processors corresponding to the multiple threads, the operating state of the processors corresponding to the multiple threads is determined, including: In response to the processor frequency state corresponding to the plurality of threads being the highest frequency state, the running state of the processor corresponding to the plurality of threads is determined as the first running state; In response to a decrease in the frequency of the processors corresponding to the multiple threads, and the existence of inactive processors in the hyperconverged service system, the running state of the processors corresponding to the multiple threads is determined to be a second running state. In response to the processors corresponding to the multiple threads being in an active state, the running state of the processors corresponding to the multiple threads is determined to be a third running state.
9. A resource scheduling device for a processor, characterized in that, include: The first determining unit is used to determine the scheduling priority of each of the multiple threads based on the business characteristic information of the multiple threads in the hyperconverged service system, wherein the business characteristic information is used to at least indicate the resource utilization rate of the processor by the multiple threads during task execution. The second determining unit is used to determine the initialization configuration strategy of the multiple threads based on the scheduling priorities corresponding to the multiple threads respectively, wherein the initialization configuration strategy includes at least the binding state between the corresponding thread and the processor in the hyperconverged service system; A configuration unit is used to perform initialization configuration on the plurality of threads based on the initialization configuration strategy; A monitoring unit is used to monitor the running status of the processors corresponding to the multiple threads after initial configuration, wherein the running status is used to at least indicate the running frequency of the corresponding processor; An adjustment unit is used to adjust the initialization configuration strategy corresponding to the multiple threads based on the running state of the processors corresponding to the multiple threads; The device is further configured to: in response to the processors corresponding to the plurality of threads being in a first running state, determine that the initialization configuration strategy of the plurality of threads remains unchanged, wherein the running state of the processors corresponding to the plurality of threads is the first running state when the frequency states of the processors corresponding to the plurality of threads are all in the highest frequency state; in response to the processors corresponding to the plurality of threads being in a second running state, adjust the initialization configuration strategy of low-priority threads, wherein the running state of the processors corresponding to the plurality of threads is the second running state when the frequency of the processors corresponding to the plurality of threads is reduced but there are inactive processors in the hyperconverged service system; in response to the processors corresponding to the plurality of threads being in a third running state, adjust the initialization configuration strategy of low-priority threads and the initialization configuration strategy of medium-priority threads, wherein the running state of the processors corresponding to the plurality of threads is the third running state when the processors corresponding to the plurality of threads are all in an active state, wherein the scheduling priority includes high priority, medium priority and low priority, wherein high priority is higher than medium priority and medium priority is higher than low priority; The device is further configured to: reduce the number of processors bound to the low-priority threads; and increase the priority scheduling parameters corresponding to the low-priority threads. The device is further configured to: bind the low-priority thread to the processor corresponding to the medium-priority thread; and adjust the priority scheduling parameters corresponding to the medium-priority thread. The device is further configured to: after adjusting the initialization configuration strategy corresponding to the plurality of threads, in response to a rollback of the running state of the processor corresponding to the plurality of threads, roll back the adjustment made to the initialization configuration strategy corresponding to the plurality of threads.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 8.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Service thread running method and device, storage medium and electronic equipment
CN111597042A
Resource application method and device, electronic equipment and storage medium
CN117453413A