Resource management method and device, electronic equipment and storage medium
By dynamically adjusting the node resource allocation of tasks in the NUMA architecture, the problem of frequent access to high-latency remote memory is solved, and the balance between low-latency memory access and high system throughput is achieved.
Patent Information
- Application Number
- CN202510377403.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-27
AI Technical Summary
In the NUMA architecture, tasks frequently access high-latency remote memory, resulting in performance degradation, and it is difficult for the existing technology to effectively optimize CPU location selection and memory access delay.
By dynamically adjusting the node resource allocation of tasks in a multi-node system, setting the scheduling affinity of node resource allocation based on the task's load information and operating status, and determining whether to adjust the current node resource allocation when the scheduling adjustment is triggered.
It realizes resource management with dynamic perception and hierarchical response under the NUMA architecture, reduces memory access latency and migration costs, and improves system throughput and resource utilization.
Smart Images

Figure CN120216200A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to a resource management method, a resource management device, an electronic device, and a non-transitory computer-readable storage medium. Background Art
[0002] As a multi-processor computer memory design, the NUMA (Non-Uniform Memory Access) architecture improves the system's parallel computing power, scalability, and memory bandwidth by distributing memory across different processor nodes, becoming an important development direction for server chips. However, in the NUMA architecture, the local memory access speed is significantly better than the remote memory access, and there are also differences in the access latency of different remote nodes. Summary of the Invention
[0003] At least one embodiment of the present disclosure provides a resource management method, which includes: during the running of a first task in a multi-node system, obtaining first load information of the first task according to a first period, and based on the first load information, setting node resource allocation for the first task in the multi-node system, where the node resource allocation includes scheduling affinity; and during the running of the first task, in response to a first scheduling adjustment trigger, determining whether to adjust the current first node resource allocation for the first task based on the current running state of the first task.
[0004] For example, in the resource management method provided in an embodiment of the present disclosure, the determining whether to adjust the current first node resource allocation for the first task based on the current running state of the first task in response to a first scheduling adjustment trigger includes: obtaining second load information of the first task, and determining whether to adjust the current first node resource allocation for the first task based on the second load information, where the second load information is the first load information of the first task obtained most recently.
[0005] For example, in the resource management method provided in an embodiment of the present disclosure, the determining whether to adjust the current first node resource allocation for the first task based on the second load information includes: obtaining a second node resource allocation based on the load quantity or task quantity indicated by the second load information, and determining whether to adjust the current first node resource allocation for the first task by comparing the first node resource allocation with the second node resource allocation.
[0006] For example, in the resource management method provided in an embodiment of the present disclosure, determining whether to adjust the first node resource allocation currently used for the first task by comparing the first node resource allocation with the second node resource allocation includes: in response to the first node resource allocation being consistent with the second node resource allocation, increasing the trigger threshold triggered by the first scheduling adjustment by a first step size.
[0007] For example, in the resource management method provided in an embodiment of the present disclosure, determining whether to adjust the first node resource allocation currently used for the first task by comparing the first node resource allocation with the second node resource allocation further includes: in response to the first node resource allocation being inconsistent with the second node resource allocation, and in response to the second node resource allocation being more than the first node resource allocation, adjusting the scheduling affinity of the first node resource allocation to the node resources of the second node resource allocation.
[0008] For example, in the resource management method provided in an embodiment of the present disclosure, determining whether to adjust the first node resource allocation currently used for the first task by comparing the first node resource allocation with the second node resource allocation further includes: in response to the first node resource allocation being inconsistent with the second node resource allocation, and in response to the second node resource allocation being less than the first node resource allocation, in response to the multi-node system being in the first convergence period, stopping adjusting the first node resource allocation currently used for the first task and waiting for a new scheduling adjustment trigger for the first task; or, if the multi-node system is not in the first convergence period, adjusting the first node resource allocation based on the occurrence frequency of the first event, where the first event is the cycle statistic corresponding to the second node resource allocation being less than the first node resource allocation.
[0009] For example, in the resource management method provided in an embodiment of the present disclosure, adjusting the first node resource allocation based on the occurrence frequency of the first event includes: in response to the occurrence frequency of the first event being greater than or equal to a first preset threshold, adjusting the scheduling affinity of the first node resource allocation to the node resources of the second node resource allocation; in response to the occurrence frequency of the first event being less than the first preset threshold, increasing the occurrence frequency of the first event by 1.
[0010] For example, in the resource management method provided in an embodiment of the present disclosure, determining whether to adjust the first node resource allocation currently used for the first task based on the running state of the first task in response to a first scheduling adjustment trigger further includes: in response to a first scheduling adjustment trigger, running the task for scheduling adjustment to determine whether to adjust the first node resource allocation currently used for the first task based on the running state of the first task; clearing the statistical information triggering the scheduling adjustment.
[0011] For example, in the resource management method provided in an embodiment of the present disclosure, running the task for scheduling adjustment in response to the first scheduling adjustment trigger includes: running the task for scheduling adjustment in response to the first scheduling adjustment trigger based on the scheduling trigger information corresponding to the first task, where the scheduling trigger information includes semaphore, message queue, or message signal.
[0012] For example, in the resource management method provided in an embodiment of the present disclosure, setting the node resource allocation for the first task in the multi-node system based on the first load information includes: determining the load utilization rate in the multi-node system based on the first load information; setting the node resource allocation for the first task in the multi-node system based on the load utilization rate.
[0013] For example, in the resource management method provided in an embodiment of the present disclosure, determining the load utilization rate in the multi-node system based on the first load information includes: determining the load utilization rate in the multi-node system based on the first load information and the third load information, where the third load information is the load information in the previous period according to the first load information.
[0014] For example, in the resource management method provided in an embodiment of the present disclosure, setting the node resource allocation for the first task in the multi-node system based on the load utilization rate further includes: expanding the node resource allocation for the first task in response to the load utilization rate being greater than a second preset threshold.
[0015] For example, in the resource management method provided in an embodiment of the present disclosure, expanding the node resource allocation for the first task in response to the load utilization rate being greater than the second preset threshold includes: expanding the node resource allocation for the first task based on the distribution positions of the node resources in the multi-node system.
[0016] For example, in the resource management method provided in an embodiment of the present disclosure, expanding the node resource allocation for the first task in response to the load utilization rate being greater than the second preset threshold further includes: after expanding the node resource allocation for the first task, making the multi-node system enter the first convergence period.
[0017] For example, in the resource management method provided in an embodiment of the present disclosure, the setting of the node resource allocation for the first task in the multi-node system based on the load utilization rate further includes: in response to the load utilization rate being less than or equal to the second preset threshold, setting the node resource allocation for the first task in the multi-node system based on a second event, where the second event includes: the frequency of setting the node resource allocation for the first task in the multi-node system and / or the periodic statistical number of the load utilization rate being less than the second preset threshold.
[0018] For example, in the resource management method provided in an embodiment of the present disclosure, the setting of the node resource allocation for the first task in the multi-node system based on the second event includes: releasing the scheduling affinity setting in the node resource allocation of the first task.
[0019] For example, in the resource management method provided in an embodiment of the present disclosure, the setting of the node resource allocation for the first task in the multi-node system based on the first load information further includes: after setting the node resource allocation for the first task in the multi-node system, recording the first load information and entering a sleep state in the current cycle.
[0020] At least one embodiment of the present disclosure provides a resource management device, which includes a load tracking and adjustment module and a scheduling adjustment module. The load tracking and adjustment module is configured to obtain the first load information of the first task according to a first cycle during the running of the first task in the multi-node system, and set the node resource allocation for the first task in the multi-node system based on the first load information, where the node resource allocation includes scheduling affinity; and the scheduling adjustment module is configured to determine whether to adjust the first node resource allocation currently used for the first task based on the current running state of the first task in response to a first scheduling adjustment trigger during the running of the first task.
[0021] At least one embodiment of the present disclosure provides an electronic device, including the resource management device provided in any embodiment of the present disclosure.
[0022] At least one embodiment of the present disclosure provides an electronic device, including a processor and a memory, where the memory stores at least one computer program, and when the at least one computer program is executed by the processor, the resource management method provided in any embodiment of the present disclosure is implemented.
[0023] At least one embodiment of the present disclosure provides a non-transitory computer-readable storage medium for non-transitorily storing computer-readable instructions, which, when executed by a computer, implement the resource management method provided by any embodiment of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the accompanying drawings of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description only relate to some embodiments of the present disclosure and do not limit the present disclosure.
[0025] Figure 1 Shows a schematic diagram of the application of a NUMA architecture;
[0026] Figure 2 Shows a flowchart of a resource management method provided by at least one embodiment of the present disclosure;
[0027] Figure 3 Shows a schematic application flowchart of a resource management method provided by at least one embodiment of the present disclosure;
[0028] Figure 4 Shows a schematic application flowchart of another resource management method provided by at least one embodiment of the present disclosure;
[0029] Figure 5 Shows a schematic application flowchart of yet another resource management method provided by at least one embodiment of the present disclosure;
[0030] Figure 6 Shows a schematic block diagram of a resource management device provided by at least one embodiment of the present disclosure;
[0031] Figure 7 Shows a schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure;
[0032] Figure 8 Shows a schematic block diagram of another electronic device provided by at least one embodiment of the present disclosure; and
[0033] Figure 9 Shows a schematic diagram of a computer-readable storage medium provided by at least one embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present disclosure. Obviously, the described embodiments are only a part rather than all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.
[0035] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure shall have the ordinary meanings understood by those of ordinary skill in the art to which the present disclosure pertains. The terms "first", "second", and similar terms used in the present disclosure do not denote any order, quantity, or importance, but are only used to distinguish different components. Similarly, terms such as "a", "an", or "the" do not denote a quantity limitation, but mean that there is at least one. The terms "comprising" or "including" and similar terms mean that the elements or items appearing before the term cover the elements or items listed after the term and their equivalents, without excluding other elements or items. The terms "connected" or "coupled" and similar terms are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms "upper", "lower", "left", "right", etc. are only used to indicate relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0036] As a multi-processor computer memory design, the NUMA architecture improves the system's parallel computing power, scalability, and memory bandwidth by distributing memory across different processor nodes, becoming an important development direction for server chips. In the NUMA architecture, each node may include a local processor and memory. The processor can access the memory of a remote node through an interconnection bus, but the local memory access speed is significantly better than that of remote memory access. In addition, there are also differences in the access latencies of different remote nodes. For example, in a dual-socket server, the remote memory latency for cross-node access (such as different CPU sockets (Sockets)) is significantly higher than that for non-cross-node access.
[0037] Figure 1 Shows a schematic diagram of NUMA architecture application.
[0038] As shown in Figure 1The multi-node NUMA architecture example shown includes four independent nodes (node) from node0 to node3. Each node includes one or more processor cores (Core) (such as an 8-core CPU) and local memory (such as DDR), and each core can directly access the local memory DDR (low latency path) through the local memory controller. The nodes can be connected in a mesh topology through a high-speed interconnect bus (such as PCIe or a custom interconnect protocol, etc.), supporting cross-node memory access.
[0039] For example, when the core of node0 accesses the remote memory of node1, it can be transmitted across nodes through the interconnect bus, and its access latency is higher than local memory access. Cross-node access (such as node0 to node3) requires going through an additional bus layer, which further increases the latency. This unevenness of memory access poses a challenge to the task scheduling and memory management of the operating system.
[0040] As a core function of the operating system, task scheduling requires dynamic allocation of CPU resources to achieve efficient execution. For example, in a NUMA architecture, a task may be suspended multiple times and rescheduled to different CPUs due to time slice exhaustion or waiting conditions. If the CPU location selection is not optimized during the scheduling process, the task may frequently access high-latency remote memory, significantly affecting performance.
[0041] The inventors of the present disclosure have noticed that how to select a CPU with the lowest memory access latency for a process through task scheduling has become one of the urgent problems to be solved under the NUMA architecture.
[0042] For example, an operating system for NUMA can try to balance the load between NUMA nodes by managing the CPU affinity and memory distribution of processes in user mode. However, the inventors of the present disclosure have noticed that these solutions have some defects, such as high response delay, long resource adjustment cycle (such as 1 minute), and inability to respond to sudden changes in process load in a timely manner, resulting in continued performance degradation when resources are insufficient; for example, the optimization effect is uncertain, and adjustments are not dynamically triggered for NUMA performance issues, which may fail to guarantee performance improvement due to blind resource migration; for example, the migration overhead is large, and the memory page migration of large memory applications takes too long, which is easy to cause business interruption; for example, the flexibility is insufficient, the resource aggregation strategy does not combine real-time load changes, and the system throughput may be suppressed after limiting resources.
[0043] Embodiments of the present disclosure provide a resource management method. The resource management method includes, during the running of a first task in a multi-node system, obtaining first load information of the first task according to a first period, and based on the first load information, setting node resource allocation for the first task in the multi-node system, where the node resource allocation includes scheduling affinity; and during the running of the first task, in response to a first scheduling adjustment trigger, determining whether to adjust the current first node resource allocation for the first task based on the current running state of the first task.
[0044] Embodiments of the present disclosure further provide a resource management device, an electronic device, and a non-transitory computer-readable storage medium corresponding to the above resource management method.
[0045] When detecting that the NUMA architecture causes performance degradation, the resource management method provided by at least one embodiment of the present disclosure can aggregate schedulable CPU resources based on task load and node distance, and preferentially select nearby nodes to reduce the average memory access latency.
[0046] At least one embodiment of the present disclosure can use the NUMA Balance mechanism to complete memory page migration, avoiding the overhead of active migration. For example, when the performance degrades due to the NUMA architecture, schedulable CPU resources can be aggregated according to the load of the monitored task and the distance between nodes, and the memory page migration is completed by NUMA balance. After the schedulable CPUs are aggregated to a few nearby nodes in terms of distance, the average memory access latency will decrease accordingly.
[0047] In addition, at least one embodiment of the present disclosure can also dynamically expand or contract node resource allocation by real-time monitoring of load changes, for example, increasing resources to improve throughput when the load is too high, and lifting resource restrictions to maintain flexibility when NUMA performance problems are reduced or non-existent.
[0048] The resource management method of at least one embodiment of the present disclosure can achieve a balance between low-latency memory access and high system throughput, while solving problems such as high migration cost and response lag, and can react in a timely manner to changes in task load and the existence of NUMA performance problems.
[0049] Figure 2 The flowchart of a resource management method provided by at least one embodiment of the present disclosure is shown.
[0050] As Figure 2 shown, the resource management method includes steps S100 to S110.
[0051] Step S100: During the running of the first task in the multi-node system, according to the first period, obtain the first load information of the first task, and based on the first load information, set the node resource allocation for the first task in the multi-node system.
[0052] Step S110: During the running of the first task, in response to the first scheduling adjustment trigger, based on the current running state of the first task, determine whether to adjust the current first node resource allocation for the first task.
[0053] For example, a multi-node system (Multi-Node System) may include a computer system based on the NUMA architecture, which may include multiple nodes communicatively connected to each other. For example, each node is an independent processor node (NUMA Node).
[0054] For example, each node may include local processor resources (such as one or more processor cores (CPU Core)) and local memory resources (such as one or more DDR modules), and the local processor core or the external processor core can directly access through the local memory controller.
[0055] For example, the nodes can be connected through a high-speed interconnect bus, supporting cross-node memory access, but the access latency is higher than the local access.
[0056] For example, the node distance can be numerically quantified (such as 1 representing nodes within the same Socket, 2 representing cross-Socket nodes), which is used to reflect the access latency difference.
[0057] For example, here the "first task" is used to refer to any task as the description object. The first task may further include the monitored target process or thread running in the multi-node system, and its resource allocation (CPU, memory) can be set according to the periodic load tracking and can be dynamically optimized according to external factor triggers.
[0058] For example, here the "first period" is used to refer to the period (load tracking period) for periodically performing load tracking in the system. For example, it may include the time interval for periodically collecting the load information of the first task.
[0059] For example, the period length can be configured from 100 milliseconds to 1 second to achieve a fast response to load mutations. The embodiments of the present disclosure do not limit the configuration of the period length.
[0060] For example, operations such as collecting CPU utilization, updating the resource allocation policy, or memory access distribution can be performed within the period.
[0061] For example, the "first load information" here is used to refer to the load information obtained in any load tracking period, and may include a set of performance metrics of the first task running state, which is used to drive node resource allocation decisions. The "first scheduling adjustment trigger" includes tasks or events that trigger scheduling adjustments, etc.
[0062] For example, the first load information may include the number of tasks executed, the number of CPUs, the memory access pattern, the resource saturation (such as the CPU core queuing delay of the allocated nodes, the memory bandwidth occupancy rate), and / or the lock contention metrics (such as the number of spin lock waiting cycles, the critical section execution time), etc. Embodiments of the present disclosure do not limit the specific information content carried by the first load information.
[0063] For example, node resource allocation may include scheduling affinity.
[0064] For example, scheduling affinity is used to refer to only allowing tasks to be executed on a specified set of nodes when scheduling tasks. For example, it may include a policy of restricting tasks to run within a specific set of NUMA nodes, and by binding CPU cores and memory regions, the remote access overhead can be reduced.
[0065] For example, scheduling affinity may further include CPU affinity or memory affinity, etc.
[0066] For example, CPU affinity may include restricting tasks to be schedulable only on the CPU cores of specified nodes.
[0067] For example, memory affinity may include migrating the physical memory pages of tasks to the local memory of the bound nodes.
[0068] For example, for step S100, in a NUMA multi-node system, a first period may be set for the first task and its running state may be scanned to obtain the first load information.
[0069] For example, low-overhead collection can be achieved through operating system kernel event counters (such as perf_event), NUMA-aware performance monitoring interfaces, or custom lightweight probes. Embodiments of the present disclosure do not limit the specific data collection methods.
[0070] For example, for node resource allocation for the first task in a multi-node system, based on the first load information and combined with the NUMA topology (inter-node distance, free resource distribution, etc.), the node resource allocation of the task can be dynamically set.
[0071] For example, scheduling affinity binding can be achieved by restricting tasks within a specific set of NUMA nodes and preferentially selecting neighboring nodes centered around the root node. For example, when the position of the root node is not restricted, the first NUMA node (e.g., node 0) can be used as the root node by default; for example, when the position of the root node is restricted, a NUMA node with memory can be selected as the root node, that is, it is necessary to ensure that there is memory on the restricted NUMA node.
[0072] For example, starting from the root node, nodes can be selected by expanding outward according to the distance between nodes, so that the average memory access latency of the selected set of nodes is minimized (for example, nodes within the same socket can be preferentially selected).
[0073] For step S110, for example, the first scheduling adjustment trigger can include detecting NUMA-related performance issues (for example, detecting a performance degradation in a NUMA multi-node system). Exemplarily, for example, whether the remote memory access ratio in a multi-node system exceeds a corresponding threshold (such as 40%); for another example, in the case of lock contention, whether the critical section occupancy time is extended (such as whether the number of spin lock waiting cycles increases); for another example, whether latency-sensitive metrics deteriorate (such as the task IPC (instructions per cycle) situation, the task completion time fluctuation situation, etc.).
[0074] For example, when a performance issue is detected in the NUMA architecture, a scheduling adjustment operation can be triggered to dynamically adjust the node resource allocation (such as scheduling affinity) of the monitored task (such as the first task) to minimize memory access latency and optimize system throughput.
[0075] For example, the running state of the current first task can be monitored periodically, such as the load situation, the amount of work executed, the task waiting time, etc. corresponding to the current first task, to determine whether to adjust the first node resource allocation currently used for the first task.
[0076] For example, based on the first node resource allocation and the second node resource allocation currently used for the first task, it can be determined whether to adjust the first node resource allocation. The second node resource allocation is the node resource allocation determined based on the first load information of the first task obtained most recently.
[0077] For example, based on the consistency comparison between the first node resource allocation and the second node resource allocation currently used for the first task, it can be determined whether to adjust the first node resource allocation.
[0078] For example, S100 and S110 can perform specific tasks for the first task relatively independently. For example, S100 can be used to perform a load tracking task for the first task, and S110 can be used to perform a scheduling adjustment task for the first task.
[0079] In at least one embodiment of the present disclosure, load tracking and scheduling adjustment can be separated to reduce the complexity of the multi-node system. Through the above steps S100 to S110, a NUMA resource management method with dynamic perception and hierarchical response is jointly realized. Through the cooperation of load tracking and event-driven adjustment, while ensuring low-latency memory access, the optimal balance between resource utilization and system throughput is achieved.
[0080] In some embodiments of the present disclosure, step S110 may include step S111.
[0081] Step S111: Obtain the second load information of the first task, and based on the second load information, determine whether to adjust the allocation of the first node resources currently used for the first task.
[0082] For example, step S111 can achieve efficient and accurate dynamic management of NUMA resources based on the second load information.
[0083] For example, the second load information is the first load information of the first task obtained most recently.
[0084] For example, the second load information is the first load information of the first task collected periodically most recently when the first scheduling adjustment is triggered. That is, the second information is a snapshot of the first load information obtained most recently.
[0085] For example, based on the second load information, the second node resource allocation corresponding to the second load information can be determined, and based on this second node resource allocation, it can be determined whether to adjust the first node resource allocation currently used for the first task.
[0086] For example, based on the consistency comparison between the second node resource allocation and the first node resource allocation corresponding to the current first task, it can be determined whether to adjust the first node resource allocation currently used for the first task.
[0087] In some embodiments of the present disclosure, step S111 may further include step S1111.
[0088] Step S1111: Based on the number of loads or tasks indicated by the second load information, obtain the second node resource allocation, and by comparing the first node resource allocation with the second node resource allocation, determine whether to adjust the first node resource allocation currently used for the first task.
[0089] For example, step S1111 realizes the precise adjustment of task resources under the NUMA architecture through the node resource dynamic adaptation mechanism driven by the load. Based on the changes in node resource allocation reflected by the second load information, the corresponding second node resource allocation can be calculated and compared with the current first node resource allocation to determine whether to trigger resource adjustment.
[0090] For example, it is possible to determine whether to adjust the current first node resource allocation by comparing the number of nodes in the first node resource allocation and the second node resource allocation respectively.
[0091] For example, it is possible to determine whether to adjust the current first node resource allocation for the first task by comparing the topological differences between the first node resource allocation and the second node resource allocation. For example, it is possible to consider comparing the situations of nodes across slots or across NUMA levels included in the first node resource allocation and the second node resource allocation to determine whether to adjust the current first node resource allocation.
[0092] In some embodiments of the present disclosure, step S1111 may further include: in response to the first node resource allocation being consistent with the second node resource allocation, increasing the trigger threshold for the scheduling adjustment trigger (i.e., the first scheduling adjustment trigger) corresponding to the first task by the first step size.
[0093] For example, when it is detected that the current node resource allocation (the first node resource allocation) is consistent with the node resource allocation (the second node resource allocation) determined based on the latest second load information, it indicates that the resource adjustment has not brought performance improvement or the current state is already optimal. At this time, the multi-node system can dynamically increase the condition threshold for triggering the scheduling adjustment to reduce the ineffective adjustments caused by instantaneous fluctuations or environmental noise.
[0094] For example, when it is determined that the first node resource allocation is consistent with the second node resource allocation (such as the same set of bound node resource allocations), the trigger threshold is adjusted.
[0095] For example, the trigger threshold for the scheduling adjustment corresponding to the first task can be increased by the first step size (such as 5%) (for example, increasing the remote memory access ratio threshold from 40% to 45%).
[0096] For example, an upper limit of the maximum trigger threshold (such as 60%) can also be set to prevent the trigger threshold from increasing infinitely and causing performance problems to be ignored for a long time. Exemplarily, if the initial trigger threshold is 40% and it reaches 60% after 4 increments, there will be no further increment.
[0097] For example, an independent trigger threshold variable can also be maintained for each task.
[0098] For example, a reset condition for the trigger threshold can also be set. If subsequent adjustments result in inconsistent resource allocations between the first node and the second node, the trigger threshold can be reset to its initial value.
[0099] For example, a periodic reset of the trigger threshold can also be set. If no adjustments occur for a long time (such as 12 or 24 hours), the trigger threshold can be automatically reset to cope with potential environmental changes.
[0100] In some embodiments of the present disclosure, step S1111 can further include: in response to inconsistent resource allocations between the first node and the second node, and in response to the resource allocation of the second node being more than that of the first node, adjusting the scheduling affinity of the resource allocation of the first node to the node resources of the resource allocation of the second node.
[0101] For example, when it is detected that the resource allocation of the second node is inconsistent with the current resource allocation of the first node (the set of bound nodes) (for example, the number of nodes in the resource allocation of the second node is more than that of the first node), the multi-node system can adjust the scheduling affinity of the task to the resource allocation of the second node to quickly respond to load growth and improve system throughput.
[0102] In at least one of the above embodiments, fast and accurate resource expansion is achieved under the NUMA architecture, improving the dynamic adaptation of resources in the multi-node system during sudden load increases while maintaining low latency and high availability.
[0103] For example, for the updated adjustment of the scheduling affinity, the allowed scheduling range of the task and its threads can be adjusted to the CPU cores of the resource allocation of the second node through an interface provided by the operating system (such as sched_setaffinity or pthread_setaffinity_np, etc.).
[0104] For example, the CPU affinity of a process or thread can be set through sched_setaffinity and bound to the CPU cores of a specified NUMA node. For example, sched_setaffinity(process) or pthread_setaffinity_np(thread) can be called to specify the target CPU core set (such as 8 - 15 corresponding to NUMA Node 1).
[0105] For example, cpuset Cgroups can be used to limit the CPU and memory nodes of a process group through control groups. For example, a cpuset group can be created, and the allowed CPUs (such as echo 8 - 15>cpuset.cpus) and memory nodes (such as echo 1>cpuset.mems) can be set.
[0106] Here, cpuset Cgroups includes, for example, the cpuset subsystem in the Control Groups of the Linux kernel, which can be used to limit the CPU cores and memory nodes available for a process or a process group. Echo includes, for example, a command-line tool in the Linux / Unix system, which can be used to write specified content to the standard output (such as a terminal) or a file. cpuset.cpus includes, for example, a configuration file in the Linux cpuset Control Groups (Cgroups), which can be used to define the list of CPU cores allowed for a process group. echo 8-15>cpuset.cpus includes, for example, writing the string 8-15 to the cpuset.cpus file to indicate that the range of CPU cores allowed for a process is from 8 to 15.
[0107] For example, the target process PID can be written to the tasks file under the group, and the process can be bound to a specified CPU core through the taskset command-line tool. For example, NUMA-aware CPU and memory binding can also be achieved through the numactl tool. For example, the corresponding memory policy can be set (such as using mbind or set_mempolicy to set the memory allocation policy) to preferentially allocate memory from the second node's resources.
[0108] For example, the MPOL_PREFERRED mode can be used for the selection policy to preferentially allocate memory from a specified NUMA node (such as the second node). For example, the target node can be specified through a bitmask (if the second node number is 1, the mask is 1UL<<1). For example, set_mempolicy(MPOL_PREFERRED, the memory address storing the target node mask, the maximum node number in the target node) can be called for global settings. For example, mbind(ptr, size, MPOL_PREFERRED, the memory address storing the target node mask, the maximum node number in the target node, 0) can be called for a specific memory area for local settings. For example, numastat can also be used to check whether memory is preferentially allocated to the target node to verify the result.
[0109] Here, MPOL_PREFERRED can be used, for example, to indicate that memory is preferably allocated from a specified NUMA node. If the resources of this node are insufficient, it will automatically fallback to other nodes. set_mempolicy includes, for example, system calls provided by the Linux kernel and can be used to set the global memory allocation policy of a process. Mbind includes, for example, a system call provided by the Linux kernel and can be used to set the NUMA memory allocation policy for a specific memory region. numastat includes, for example, a command-line tool in the Linux system and can be used to count and display NUMA memory allocation and access performance data.
[0110] For example, after the scheduling affinity is adjusted, a stabilization timer can be started (for example, the stabilization period can be set to 5 - 10 load tracking cycles, and the embodiments of the present disclosure do not limit the specific setting range of the stabilization period). During this stabilization period, requests for shrinking the same type of resources can be masked to prevent reverse adjustment triggered by transient load fluctuations.
[0111] In some embodiments of the present disclosure, step S1111 may further include: in response to the resource allocation of the first node being inconsistent with the resource allocation of the second node, and in response to the resource allocation of the second node being less than the resource allocation of the first node; in response to the multi-node system being in the first convergence period, stop adjusting the resource allocation of the first node currently used for the first task and wait for a new scheduling adjustment trigger for the first task; or, if the multi-node system is not in the first convergence period, adjust the resource allocation of the first node based on the occurrence frequency of the first event.
[0112] For example, the first event may include the cycle count corresponding to the resource allocation of the second node being less than the resource allocation of the first node.
[0113] For example, when it is detected that the resource allocation of the first node is inconsistent with the resource allocation of the second node, the system determines whether to further perform resource shrinking adjustment based on whether it is in the first convergence period (i.e., the stabilization period after node resource expansion) to avoid over-optimization caused by transient load fluctuations. Safe and progressive resource shrinking can be achieved under the NUMA architecture, while ensuring low latency and further reducing performance fluctuations caused by over-optimization.
[0114] For example, the first convergence period may include a silent observation period or a stabilization period (such as 0 - 10 milliseconds, excluding 0) set after a resource expansion operation to mask reverse adjustments caused by short-term load fluctuations.
[0115] For example, the state of the convergence period can be tracked through a kernel timer or a user-space timer.
[0116] For example, when it is detected that the multi-node system is in the first convergence period, the adjustment of the current first-node resource allocation is stopped, the current resource contraction request is ignored, and the current first-node resource allocation is maintained. The load can be continuously monitored. If the corresponding situation still exists after the convergence period ends, a new scheduling adjustment trigger for the first task is re-triggered.
[0117] For example, when it is detected that the multi-node system is not in the first convergence period, how to adjust the first-node resource allocation can be determined based on the event frequency, and the occurrence frequency of the first event (i.e., the periodic statistic of "the second-node resource allocation is less than the first-node resource allocation") can be counted.
[0118] Exemplarily, the frequency threshold can be set. If the number of occurrences of the first event reaches the threshold (e.g., 3 times) within the most recent N periods (such as 5 periods), it can be determined that a contraction adjustment needs to be performed.
[0119] For example, the resource contraction ratio can be dynamically calculated based on this frequency and the load decline trend.
[0120] In some embodiments of the present disclosure, adjusting the first-node resource allocation based on the occurrence frequency of the first event may include: in response to the occurrence frequency of the first event being greater than or equal to the first preset threshold (i.e., the preset threshold corresponding to the first event), adjusting the scheduling affinity of the first-node resource allocation to the node resources of the second-node resource allocation; in response to the occurrence frequency of the first event being less than the first preset threshold, increasing the occurrence frequency of the first event by 1.
[0121] For example, when the second-node resource allocation is less than the first-node resource allocation and the multi-node system is not in the first convergence period, it can be dynamically determined whether to perform a resource contraction adjustment by quantitatively counting the occurrence frequency of the first event. The above at least one embodiment can achieve safe and adaptive resource contraction under the NUMA architecture, so that redundant resources are released only when the load is continuously low, while reducing performance jitter caused by instantaneous fluctuations.
[0122] For example, in at least one embodiment, a corresponding buffer (such as recording the most recent 10 scheduling periods) can be maintained for window counting to count the number of occurrences of the first event within the window.
[0123] For example, in at least one embodiment, different weights can also be assigned according to the time proximity of the occurrence of the first event (such as higher weight for recent events), and the weighted frequency can be calculated.
[0124] For example, when the occurrence frequency of the first event reaches the corresponding preset threshold (the occurrence frequency is greater than or equal to the first preset threshold), the scheduling affinity of the first node resource allocation can be updated to the second node resource allocation. Exemplarily, if the first preset threshold is set to 3 times and the first event is detected 4 times within the most recent 5 cycles, then an adjustment operation for the scheduling affinity is performed.
[0125] For example, when the occurrence frequency of the first event is less than the corresponding preset threshold (the occurrence frequency < the first preset threshold), frequency accumulation can be performed, incrementing the occurrence frequency counter of the first event by 1, and temporarily not adjusting the scheduling affinity, waiting for subsequent cycles to continue monitoring. Exemplarily, if the current frequency is 1 time (the first preset threshold is set to 3 times), then the frequency is updated to 2 times, and if it is triggered again in the next cycle, the threshold is reached and the adjustment operation for the scheduling affinity is performed.
[0126] In some embodiments of the present disclosure, step S110 may further include: in response to a first scheduling adjustment trigger, running a task for scheduling adjustment to determine whether to adjust the first node resource allocation for the current first task based on the running state of the current first task; and clearing the statistical information that triggered the scheduling adjustment.
[0127] For example, when a first scheduling adjustment trigger is detected, a task for scheduling adjustment can be immediately activated, so that it can be dynamically determined whether to adjust the node resource allocation based on the running state of the first task, and the relevant statistical information is cleared after processing to avoid interference in subsequent cycles. A highly responsive and self - consistent resource management loop can be implemented under the NUMA architecture, such that each adjustment can be based on the latest state, while maintaining the purity and reliability of system monitoring through statistical clearing.
[0128] For example, when NUMA - related performance issues reach the corresponding preset thresholds (such as the remote memory access ratio > 40%, a sharp increase in the number of lock - waiting cycles (e.g., exceeding 2 - 3 times the historical average waiting cycle number), etc.), a first scheduling adjustment trigger signal can be generated.
[0129] For example, a high priority can be assigned to the scheduling adjustment task to preempt non - primary tasks to accelerate decision - making execution.
[0130] For example, the statistical information that triggered the scheduling adjustment to be cleared may include performance counters (e.g., cumulative statistical values related to triggers such as the number of remote memory accesses, the number of lock - waiting cycles, etc.), event records (e.g., the event marker for this trigger and the temporarily stored load snapshot), etc., and the embodiments of the present disclosure are not limited thereto.
[0131] For example, the statistical information can be cleared by means of an atomic operation reset, such as zeroing the counter through a memory barrier or an atomic variable, so that there is no concurrent read - write conflict.
[0132] For example, the statistical information can also be cleared by emptying the buffer. If a circular buffer is used to record events, the head and tail pointers can be reset or the overwrite write flag can be set.
[0133] In some embodiments of the present disclosure, running the task for scheduling adjustment in response to a first scheduling adjustment trigger may include: running the task for scheduling adjustment in response to a first scheduling adjustment trigger based on the scheduling trigger information corresponding to the first task. Thus, in at least one embodiment, efficient and reliable event-driven resource adjustment can be achieved under the NUMA architecture, enabling immediate response to performance issues and precise optimization.
[0134] For example, the scheduling trigger information may include semaphores, message queues, or message signals, etc., and the embodiments of the present disclosure are not limited thereto.
[0135] For example, the scheduling trigger information is a communication medium for notifying the start of the scheduling adjustment task.
[0136] For example, the scheduling trigger information may include a semaphore. For example, a semaphore can be used to synchronize tasks through an atomic counter to identify the occurrence of a trigger event. For example, when a NUMA performance issue (such as a remote memory access exceeding the threshold) occurs, the kernel or monitoring module performs a V operation (releases the signal) on the semaphore to wake up the scheduling adjustment task blocked on the semaphore.
[0137] For example, the scheduling trigger information may include a message queue. For example, a message queue can be used to transmit specific context information of the trigger event (such as performance metric values, node topology status, etc.). For example, a message including the trigger reason and load data can be sent to the queue, and the scheduling adjustment task reads and processes the message from the queue.
[0138] For example, the scheduling trigger information may include a message signal. For example, an asynchronous signal (such as a real-time signal in Linux) can be used to notify the task to respond immediately. For example, a custom signal handling function can be set to send a signal (such as SIGRTMIN + 1) to the scheduling adjustment task when the trigger condition is met.
[0139] In some embodiments of the present disclosure, step S100 may further include steps S101 to S102.
[0140] Step S101: Determine the load utilization rate in the multi-node system based on the first load information.
[0141] Step S102: Set the node resource allocation for the first task in the multi-node system based on the load utilization rate.
[0142] For example, for step S101, based on the first load information, the comprehensive load utilization rate of each node in the multi-node system can be calculated to quantify the pressure of the task on resources.
[0143] For example, based on the first load information, information such as CPU utilization rate, memory bandwidth occupancy rate, remote access ratio, or thread parallelism can be determined.
[0144] For example, for load utilization rate calculation, according to a weighted comprehensive model, such as assigning weights according to the influence of different metrics on performance, the overall load utilization rate can be calculated.
[0145] For example, load utilization rate = α × CPU utilization rate + β × memory bandwidth occupancy rate + γ × remote access ratio + δ × thread parallelism.
[0146] For example, as an example of weights, α = 0.4 (CPU weight), β = 0.3 (memory bandwidth weight), γ = 0.2 (remote access weight), δ = 0.1 (parallelism weight). For example, each metric can be normalized to the range of 0 to 100% to make the calculation results comparable.
[0147] For example, node load distribution analysis can also be performed, such as counting the differences in load utilization rates of each node to identify hot nodes (load > 80%) and idle nodes (load < 20%).
[0148] For example, for step S102, the node resource allocation of the first task can be dynamically set according to the load utilization rate to optimize performance and reduce resource contention.
[0149] For example, a load classification strategy can be configured. For example, for low load (utilization rate < 30%), 1 node can be allocated, and idle nodes can be preferentially selected; for medium load (30% ≤ utilization rate ≤ 70%), 2 adjacent nodes (within the same Socket) can be allocated; for high load (utilization rate > 70%), 3 to 4 nodes can be allocated, and low-latency paths can be preferentially selected when crossing Sockets.
[0150] For example, a topology-aware node selection strategy can be configured. For example, based on the principle of proximity priority, for example, with the currently bound node (for example, the root node) as the center, candidate nodes can be expanded from near to far according to the node distance. For example, based on the optimal latency combination, the node combination with the minimum average memory access latency can be selected from the candidate set. Exemplarily, the average latency = (∑(number of local accesses × local latency) + ∑(number of remote accesses × remote latency)) / total number of accesses.
[0151] In at least one embodiment of the present disclosure, load-driven resource elastic allocation can be implemented under the NUMA architecture, so that tasks can obtain better node resource allocation in a dynamic load environment.
[0152] In some embodiments of the present disclosure, step S101 may further include step S1011.
[0153] Step S1011: Determine the load utilization rate in the multi-node system based on the first load information and the third load information.
[0154] For example, step S1011 may use a historical load data fusion mechanism to combine the current load information (the first load information) with the historical load information (the third load information) to achieve dynamic and accurate calculation of the load utilization rate in the multi-node system, thereby enhancing the stability and forward-looking nature of resource allocation decisions. The dynamic optimization evaluation of the load utilization rate can be achieved under the NUMA architecture, providing a more robust and intelligent decision-making basis for resource allocation.
[0155] For example, the third load information may be the load information in the previous period according to the first load information.
[0156] For example, the third load information may be a historical snapshot of the first load information collected in the previous period of the first period (such as the previous period of the first period).
[0157] For example, the third load information may include the same set of metrics as the first load information.
[0158] For example, the load information of the previous period of the first period can be quickly located through a time series index, such as through a timestamp or a cycle number.
[0159] For example, the load utilization rate in the multi-node system can be determined based on the ratio of the number of CPUs carried in the third load information and the first load information. Here, the number of CPUs may include the number of CPUs required to execute the first task.
[0160] In some embodiments of the present disclosure, step S102 may further include step S1022.
[0161] Step S1022: In response to the load utilization rate being greater than the second preset threshold (i.e., the preset threshold corresponding to the load utilization rate), expand the node resource allocation for the first task.
[0162] For example, step S1022 may use a resource expansion mechanism driven by the load utilization rate to achieve dynamic expansion of node resources under the NUMA architecture. When it is detected that the load utilization rate exceeds the second preset threshold, the multi-node system can expand the node resource allocation for the first task to cope with load growth and maintain performance stability. Efficient and secure elastic resource expansion can be achieved under the NUMA architecture, enabling high-load tasks to obtain better node resource allocation. At the same time, the robustness of the multi-node system can be ensured by configuring a stable period and a fallback logic.
[0163] For example, a second preset threshold corresponding to the load utilization rate (which can be obtained through the foregoing steps) can be configured, such as 75% or 80%.
[0164] For example, a threshold classification strategy can be further configured, and the expansion amplitude can be dynamically adjusted according to the degree of overrun (for example, when the utilization rate is 80%, 1 node is expanded, and when it is 90%, 2 nodes are expanded).
[0165] For example, a trend weighting strategy can be further configured. If the load shows a continuous upward trend (such as continuous growth for 3 consecutive periods), expansion is triggered in advance to reserve resources.
[0166] In some embodiments of the present disclosure, in response to the load utilization rate being greater than the second preset threshold, expanding the node resource allocation for the first task may include: expanding the node resource allocation for the first task based on the distribution locations of the resources of each node in the multi-node system.
[0167] For example, for candidate node selection, candidate nodes can be selected based on the principle of proximity priority. For example, with the currently bound node (such as the root node) as the center, candidate nodes are selected in order of increasing node distance.
[0168] For example, candidate nodes can also be selected based on the principle of optimal latency. For example, node combinations with the lowest latency within the same Socket or across Sockets are preferentially selected.
[0169] For example, candidate nodes can also be selected based on the principle of load balancing. For example, it can be configured to avoid nodes with high load (such as utilization rate > 60%) and select idle nodes (utilization rate < 30%).
[0170] For example, a resource expansion stable period can be configured. For a specific description of the stable period, reference can also be made to the relevant descriptions in the foregoing embodiments, which will not be elaborated here.
[0171] In some embodiments of the present disclosure, after step S1022, step S1023 is further included.
[0172] Step S1023: After expanding the node resource allocation for the first task, cause the multi-node system to enter the first convergence period.
[0173] For example, step S1023 can enable the multi-node system to enter the first convergence period (i.e., the stable period) after resource adjustment through a stable period management mechanism for resource expansion, preventing unnecessary reverse adjustments (such as resource contraction) triggered by instantaneous load fluctuations or environmental noise.
[0174] For example, the first convergence period may include a stable period time window (eg, 0 to 10 milliseconds) set after the resource expansion operation is completed, during which the system will temporarily block resource contraction requests or other reverse adjustment operations for the same task.
[0175] For example, for the specific description of the multi-node system entering the first convergence period, reference may be made to the relevant description of the aforementioned embodiment, which will not be repeated here.
[0176] In some embodiments of the present disclosure, step S102 may further include step S1024.
[0177] Step S1024: In response to the load utilization being less than or equal to the second preset threshold, setting node resource allocation for the first task in the multi-node system based on the second event.
[0178] For example, step S1024 can dynamically reduce the node resource allocation of the first task under the NUMA architecture through a low-load driven resource shrinkage mechanism combined with the triggering condition of the second event (such as frequency or cycle statistics) to optimize resource utilization and reduce operating costs. Intelligent recycling of node resources can be achieved under the NUMA architecture, significantly improving system resource utilization and economy while ensuring task performance.
[0179] For example, the second event may include setting a frequency of node resource allocation for the first task in the multi-node system and / or a periodic statistic in which the load utilization is less than a second preset threshold.
[0180] For example, the second event type may include a frequency condition or a periodic statistical number. For example, the frequency condition may include that the number of times the resource shrinkage request is triggered in the last N periods reaches a preset threshold (such as 3 times) corresponding to the number of triggers. For example, the periodic statistical number may include that the load utilization is less than a second preset threshold (such as 5 periods) for M consecutive periods.
[0181] For example, node resource allocation for the first task in the multi-node system may be set based on the composite condition of the second event, that is, combining frequency and period statistics (eg, 3 triggers and at least 2 consecutive periods meeting the criteria).
[0182] For example, setting the node resource allocation for the first task in the multi-node system may refer to the relevant description on the candidate node selection in the aforementioned embodiment, which will not be repeated here.
[0183] In some embodiments of the present disclosure, step S1024 may further include: releasing the scheduling affinity setting in the node resource allocation of the first task.
[0184] For example, when it is detected that the load utilization rate is continuously lower than the second preset threshold and the second event condition is met (such as meeting the standard for multiple consecutive cycles), the scheduling affinity setting of the first task can be lifted, enabling it to be freely scheduled in a multi-node system, so as to improve the global resource utilization rate and reduce the management overhead.
[0185] For example, the CPU binding can be lifted, which can remove the restriction of the task on the CPU cores of specific nodes and allow the operating system to perform global scheduling.
[0186] For example, the memory policy can be relaxed, and the memory allocation policy can be adjusted from binding to nodes to preferring local nodes (not mandatory), to be compatible with flexible scheduling.
[0187] In some embodiments of the present disclosure, after step S100, step S103 may further be included.
[0188] Step S103: After setting the node resource allocation for the first task in the multi-node system, record the first load information and enter the sleep state in the current cycle.
[0189] For example, for step S103, after completing the node resource allocation, load information archiving and task sleep operations can be performed to reduce resource consumption during the idle period.
[0190] For example, the load information recording can write the first load information of the current cycle (such as CPU utilization and memory access distribution) into a log or database for subsequent analysis and historical traceability.
[0191] For example, the task sleep operation can make the load tracking task enter the low-power sleep mode, pause the resource monitoring and adjustment operations until a new trigger wakes it up.
[0192] Figure 3 The application schematic flowchart of a resource management method provided by at least one embodiment of the present disclosure is shown.
[0193] The following combines Figure 3 An exemplary description is given to the resource management method provided by the embodiments of the present disclosure.
[0194] As Figure 3 shown, the resource management method includes steps S200 to S292.
[0195] S200: Create a scheduling adjustment task.
[0196] For example, the scheduling adjustment task can be initialized and started as the core execution task (such as a thread) for NUMA resource management.
[0197] S210: The task blocks on a semaphore.
[0198] For example, when a task enters the blocked state, it can wait for an external trigger event (such as a remote access exceeding the threshold, lock competition deterioration, etc.) to wake it up through a semaphore.
[0199] S220: The semaphore is raised, and the task is scheduled to run.
[0200] For example, when NUMA performance issues (such as a high ratio of remote memory access) are detected, the semaphore is raised, and the scheduling adjustment task is activated to run.
[0201] S230: Clear the statistics that triggered the scheduling adjustment.
[0202] For example, the performance counters that triggered this adjustment (such as the number of remote accesses, the number of lock wait cycles) can be reset to make the data pure in the next cycle.
[0203] S240: Obtain the load of the monitored task at the most recent scan, and then calculate how many node resources are required based on the load, and allocate at least one node.
[0204] For example, obtain the load of the monitored task at the most recent scan (such as CPU utilization, memory access distribution).
[0205] For example, for the calculation of node requirements, the minimum number of nodes (at least 1 node) can be determined according to the load. For example, taking the node root node as the center, candidate nodes can be expanded according to the node distance, and the combination with the minimum average memory access latency can be selected.
[0206] S250: Determine whether the node resources allocated this time are consistent with the currently bound node resources?
[0207] If yes, go to step S280; if not, go to step S260.
[0208] For example, if the newly allocated node set = the current bound set, enter S280 (increase the trigger threshold). If they are inconsistent, enter S260 (resource increase or decrease determination).
[0209] S260: Determine whether the node resources allocated this time are less than the currently bound node resources? If yes, go to step S290; if not, go to step S270.
[0210] For example, if the number of new nodes is less than the current number, enter S290 (steady-state check). If the number of new nodes is more than the current number, directly enter S270 (forced resource expansion).
[0211] S270: Set the scheduling affinity of the monitored task to the node resources allocated this time.
[0212] For example, the scheduling affinity of the monitored task (e.g., the first task provided in the foregoing embodiment) can be set to the node resources allocated this time by updating the set of nodes bound to the task.
[0213] S280: Increase the trigger threshold step by step at a specified step size.
[0214] For example, the trigger condition threshold can be increased at a specified step size (such as 5%) (e.g., increasing the remote access threshold from 40% to 45%) to reduce the invalid trigger frequency.
[0215] S290: Determine whether it is still in the stable period? If so, go to step S210; otherwise, go to step S291.
[0216] For example, if it is in the stable period after resource expansion (such as 1 minute), return to S210 (blocking and waiting). Otherwise, go to S291 (shrinkage frequency check).
[0217] S291: Determine whether the number of occurrences of S260 reaches the corresponding preset threshold. If so, perform step S270; otherwise, go to step S292.
[0218] For example, if the number of resource contraction requests ≥ the preset threshold (such as 3 times), execute S270 (update affinity). Otherwise, go to S292 (count accumulation).
[0219] S292: Increment by 1 the variable that counts the number of occurrences of this situation. Then continue with step S210.
[0220] For example, this contraction request can be recorded, and after incrementing the counter, return to S210 (blocking and waiting).
[0221] For example, in the embodiments of the present disclosure, for the relevant content of the operations, functions, or beneficial effects performed in the above steps S200 to S292, reference can be made to the relevant descriptions of the resource management method provided in any embodiment of the present disclosure, which will not be elaborated here.
[0222] Figure 4 The application schematic flowchart of another resource management method provided by at least one embodiment of the present disclosure is shown.
[0223] The following will be combined with Figure 4 to exemplarily describe the resource management method provided by the embodiments of the present disclosure.
[0224] As Figure 4 shown, the resource management method includes steps S300 to S393.
[0225] S300: Create a load tracking task.
[0226] For example, initialize and start the load tracking task, which is responsible for periodically monitoring the task load and providing data support for resource adjustment.
[0227] S310: The task is scheduled to run.
[0228] For example, run a load tracking task.
[0229] S320: Determine whether the current state is still in the stable period after resource expansion. If yes, add 1 to the stable period count variable until it reaches a specified value.
[0230] For example, if it is in the stable period after resource expansion, the stable period count variable is incremented until it reaches the set value (such as 60 seconds), marking the end of the stable period. Otherwise, the count is skipped and load collection is performed.
[0231] S330: The load information of the monitored task (eg, the first task provided in the above embodiment) may be read to obtain the load of the previous cycle.
[0232] For example, the load information of the monitored task in the previous cycle can be obtained from the shared memory area or the kernel interface.
[0233] S340: Calculate the ratio of the load in the previous cycle to the number of currently allocated CPUs to obtain CPU utilization.
[0234] For example, CPU utilization = currently allocated number of CPU cores / last cycle load × 100%.
[0235] S350: Compare the CPU utilization with the overload threshold to determine whether CPU resources need to be expanded. If yes, proceed to step S392; otherwise, proceed to step S360.
[0236] For example, if the CPU utilization rate is greater than the overload threshold (such as 80%), the process proceeds to S391 (expanding resources), otherwise the process proceeds to S360 (cancelling affinity check).
[0237] S360: Determine whether the scheduling affinity setting needs to be released. If yes, proceed to step S393; if no, proceed to step S370.
[0238] For example, the trigger condition is lower than the threshold for multiple consecutive times (such as remote access ratio < 20% for 5 cycles), or the load is continuously low (such as CPU utilization < 30% for 3 cycles). If any of the conditions are met, enter S393 (cancel affinity); otherwise enter S370.
[0239] S370: Record the load read this time for use in scheduling adjustment.
[0240] For example, the current load data can be written to a log or shared memory for subsequent use by the scheduling adjustment tasks (S200 - S292).
[0241] S380: Clear the statistics that trigger scheduling adjustment.
[0242] For example, the performance counters (such as the number of remote accesses and the number of lock contention cycles) can be reset to reduce the interference of historical data on the next - cycle judgment.
[0243] S390: The thread enters the sleep state, and the sleep duration is determined by the load scanning period. Then it enters step S310.
[0244] For example, the task enters the sleep state, and the sleep duration can be controlled by the load scanning period (such as 100 milliseconds). After expiration, it returns to S310 to execute in a loop.
[0245] S391: On the basis of the currently allocated node resources, select a node closest to the root node from the unallocated node resources as the extended resource, and reset the scheduling affinity of the monitored task. Then it enters step S392.
[0246] For example, a node closest to the root node can be selected from the unallocated nodes (such as determining the lowest latency through the ACPI SLIT table). The new node can be added to the current resource set, and the scheduling affinity can be updated through cpuset. Exemplarily, the current binding is {node0}, which is extended to {node0, node1}.
[0247] S392: Start the stabilization period after resource expansion to prevent immediately triggering scheduling adjustment. Then it enters step S380.
[0248] For example, a stabilization - period timer (such as 10 milliseconds) can be started after resource expansion. During this period, shrink requests can be blocked to prevent reverse adjustment triggered by instantaneous fluctuations.
[0249] S393: Remove the scheduling affinity setting of the monitored task. Then it enters step S380.
[0250] For example, the CPU - to - memory binding limit of a task (such as the first task) can be removed to allow global scheduling.
[0251] For example, in the embodiments of the present disclosure, for the relevant content of the operations, functions, or beneficial effects executed in the above steps S300 - S393, reference can be made to the relevant descriptions of the resource management method provided in any embodiment of the present disclosure, which will not be elaborated here.
[0252] Figure 5The figure shows an application schematic flowchart of a method for triggering a scheduling adjustment task provided by at least one embodiment of the present disclosure.
[0253] The following is an exemplary description of the resource management method provided by the embodiments of the present disclosure in conjunction with Figure 5 For example, a MySQL thread attempts to acquire a lock to enter a critical section to perform operations (such as data modification).
[0254] As Figure 5 shown, the method for triggering a scheduling adjustment task includes steps S400 to S470.
[0255] S400: Acquire a lock.
[0256] For example, a MySQL thread attempts to acquire a lock to enter a critical section to perform operations (such as data modification).
[0257] S410: Determine whether the lock is in a released state? If yes, go to step S470; if not, go to step S420.
[0258] For example, if the lock is in a released state, enter S470 (enter the critical section with the lock). If the lock is occupied, enter S420 (spin wait).
[0259] S420: Enter the spin wait state, and the variable spin_count is incremented atomically by 1.
[0260] For example, the thread enters user-mode spin (busy wait), and the spin counter spin_count is incremented atomically. If the remote memory access latency is high, the spin time is significantly extended.
[0261] S430: Confirm whether the user-mode spin wait for the lock release times out. If it times out, go to step S440; if it does not time out, go to step S410.
[0262] For example, if the spin wait exceeds a preset timeout threshold (such as microseconds, milliseconds), enter S440 (record the timeout). If it does not time out, return to S410 (re-check the lock status).
[0263] S440: Exit the spin, the variable timeouted_count is incremented atomically by 1, and it is incremented at most once each time the lock is acquired.
[0264] For example, the timeout counter timeouted_count is incremented atomically (at most once per lock acquisition cycle). The number of timeouts can reflect the intensity of lock contention and the negative impact of NUMA memory latency.
[0265] S450: Calculate the ratio of timeouted_count / spin_count, and then compare it with the trigger threshold. When it exceeds, pull up the semaphore to trigger a scheduling adjustment.
[0266] For example, if the timeout ratio > the trigger threshold (e.g., 20%), a semaphore is raised to notify the scheduler to adjust the task (e.g., execute steps S200 - S292) for NUMA resource optimization.
[0267] S460: Switch tasks. Then enter step S410.
[0268] For example, release CPU resources, trigger the thread scheduler to switch to other tasks, and avoid continuously occupying the CPU. Subsequently, return to S410 (re - attempt to acquire the lock).
[0269] S470: Rewrite the lock status and enter the critical section while holding the lock.
[0270] For example, the lock status can be marked as held. Perform data operations within the critical section (such as updating the index, writing logs). If the scheduling adjustment takes effect (such as binding adjacent nodes), the execution time of the critical section is shortened, and the lock competition pressure is alleviated.
[0271] For example, the above steps S400 - S470 can significantly reduce the performance degradation caused by cross - node memory access through NUMA resource management driven by lock competition events, and improve the lock handling efficiency and system throughput of MySQL in a high - concurrency NUMA environment.
[0272] For example, in the embodiments of the present disclosure, for the relevant content of the operations, functions, or beneficial effects performed by the above steps S400 - S470, reference can be made to the relevant descriptions of the resource management method provided in any embodiment of the present disclosure, which will not be elaborated here.
[0273] Figure 6 The schematic block diagram of a resource management device provided by at least one embodiment of the present disclosure is shown.
[0274] As Figure 6 shown, the resource management device 500 includes a load tracking and adjustment module 510 and a scheduling adjustment module 520.
[0275] For example, the resource management device 500 can be configured to execute the resource management method provided in any embodiment of the present disclosure.
[0276] The load tracking and adjustment module 510 is configured to obtain the first load information of the first task according to the first period during the running of the first task in a multi - node system, and based on the first load information, set the node resource allocation for the first task in the multi - node system, where the node resource allocation includes scheduling affinity.
[0277] For example, the load tracking and adjustment module 510 can also be configured to execute step S100 provided in the foregoing embodiments.
[0278] The scheduling adjustment module 520 is configured to, during the running of the first task, in response to a first scheduling adjustment trigger, determine whether to adjust the current first node resource allocation for the first task based on the running state of the current first task.
[0279] For example, the scheduling adjustment module 520 may also be configured to execute step S110 provided in the foregoing embodiment.
[0280] In some embodiments of the present disclosure, the scheduling adjustment module 520 may also be configured to obtain second load information of the first task, and determine whether to adjust the current first node resource allocation for the first task based on the second load information, where the second load information is the first load information of the first task obtained most recently.
[0281] In some embodiments of the present disclosure, the scheduling adjustment module 520 may also be configured to obtain a second node resource allocation based on the number of loads or tasks indicated by the second load information, and determine whether to adjust the current first node resource allocation for the first task by comparing the first node resource allocation with the second node resource allocation.
[0282] In some embodiments of the present disclosure, the scheduling adjustment module 520 may also be configured to, in response to the first node resource allocation being consistent with the second node resource allocation, increase the trigger threshold of the first scheduling adjustment trigger (i.e., the scheduling adjustment trigger corresponding to the first task) by a first step length.
[0283] In some embodiments of the present disclosure, the scheduling adjustment module 520 may also be configured to, in response to the first node resource allocation being inconsistent with the second node resource allocation, and in response to the second node resource allocation being more than the first node resource allocation, adjust the scheduling affinity of the first node resource allocation to the node resources of the second node resource allocation.
[0284] In some embodiments of the present disclosure, the scheduling adjustment module 520 may also be configured to, in response to the first node resource allocation being inconsistent with the second node resource allocation, and in response to the second node resource allocation being less than the first node resource allocation; in response to the multi-node system being in the first convergence period, stop adjusting the current first node resource allocation for the first task and wait for a new scheduling adjustment trigger for the first task; or, if the multi-node system is not in the first convergence period, adjust the first node resource allocation based on the occurrence frequency of the first event, where the first event is the cycle statistic corresponding to the second node resource allocation being less than the first node resource allocation.
[0285] In some embodiments of the present disclosure, the scheduling adjustment module 520 may further be configured to adjust the scheduling affinity of the first node resource allocation to the node resources of the second node resource in response to the occurrence frequency of the first event being greater than or equal to a first preset threshold; and increase the occurrence frequency of the first event by 1 in response to the occurrence frequency of the first event being less than the first preset threshold.
[0286] In some embodiments of the present disclosure, the scheduling adjustment module 520 may further be configured to, in response to a first scheduling adjustment trigger, run a task for scheduling adjustment to determine whether to adjust the first node resource allocation for the current first task based on the running state of the current first task; and clear the statistical information triggering the scheduling adjustment.
[0287] In some embodiments of the present disclosure, the scheduling adjustment module 520 may further be configured to, in response to a first scheduling adjustment trigger, run a task for scheduling adjustment based on the scheduling trigger information corresponding to the first task, where the scheduling trigger information includes a semaphore, a message queue, or a message signal.
[0288] In some embodiments of the present disclosure, the load tracking adjustment module 510 may further be configured to determine the load utilization rate in the multi-node system based on the first load information; and set the node resource allocation for the first task in the multi-node system based on the load utilization rate.
[0289] In some embodiments of the present disclosure, the load tracking adjustment module 510 may further be configured to determine the load utilization rate in the multi-node system based on the first load information and the third load information, where the third load information is the load information in the previous period according to the first load information.
[0290] In some embodiments of the present disclosure, the load tracking adjustment module 510 may further be configured to expand the node resource allocation for the first task in response to the load utilization rate being greater than a second preset threshold.
[0291] In some embodiments of the present disclosure, the load tracking adjustment module 510 may further be configured to expand the node resource allocation for the first task based on the distribution locations of the node resources in the multi-node system.
[0292] In some embodiments of the present disclosure, the load tracking adjustment module 510 may further be configured to cause the multi-node system to enter a first convergence period after expanding the node resource allocation for the first task.
[0293] In some embodiments of the present disclosure, the load tracking adjustment module 510 can also be configured to set the node resource allocation for the first task in the multi-node system based on a second event in response to the load utilization being less than or equal to a second preset threshold, wherein the second event includes: setting the frequency of node resource allocation for the first task in the multi-node system and / or the periodic statistics of the load utilization being less than the second preset threshold.
[0294] In some embodiments of the present disclosure, the load tracking adjustment module 510 may also be configured to release the scheduling affinity setting in the node resource allocation of the first task.
[0295] In some embodiments of the present disclosure, the load tracking and adjustment module 510 may also be configured to record first load information and enter a sleep state in a current cycle after setting node resource allocation for a first task in a multi-node system.
[0296] For example, in the embodiments of the present disclosure, the load tracking adjustment module 510 and the scheduling adjustment module 520 can be hardware, software, firmware, or any feasible combination thereof. For example, the load tracking adjustment module 510 and the scheduling adjustment module 520 can be dedicated or general circuits, chips, or devices, or can be a combination of a processor and a memory. The embodiments of the present disclosure do not limit the specific implementation forms of the above modules.
[0297] It should be noted that, in the embodiments of the present disclosure, each module of the resource management device 500 may correspond to each step of the resource management method provided in any embodiment of the present disclosure. Figure 6 The components and structures of the resource management device 500 shown are merely exemplary and non-limiting. The resource management device 500 may further include other components and structures as required.
[0298] In the embodiments of the present disclosure, the operations, functions or beneficial effects performed by the above modules of the resource management device 500 may be described in detail in the description of the resource management method provided in any embodiment of the present disclosure, and will not be repeated here.
[0299] Figure 7 A schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure is shown.
[0300] At least some embodiments of the present disclosure also provide an electronic device, such as Figure 7 As shown, the electronic device 600 can be used to implement a multi-node system, including a resource management device provided by any embodiment of the present disclosure. For example, the resource management device can be implemented as a sender and / or receiver of instructions / data, such as a processor, memory or external memory.
[0301] For example, the processor 601 may be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units with data processing capabilities and / or program execution capabilities; for example, the central processing unit (CPU) may be of RISC, X86, or ARM architecture, etc.
[0302] The electronic device 600 in the embodiments of the present disclosure may include mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as in-vehicle navigation terminals), etc., and any devices such as digital TVs, desktop computers, servers, etc., and may also be any data processing device and combination of hardware, and the embodiments of the present disclosure do not limit this.
[0303] Figure 7 The illustrated electronic device 600 is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.
[0304] For example, as Figure 7 shown, in some examples, the processor 601 may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage device 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer system are also stored. The processor 601, ROM 602, and RAM 603 are connected to each other through the communication channel 604. The input / output (I / O) interface 605 is also connected to the communication channel 604. For example, the storage controller of the RAM 603 for memory includes the above-mentioned resource management device.
[0305] For example, the following components may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, such as, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc., and for example, the storage controller of the storage device 608 includes the above-mentioned resource management device; for example, a communication device 609 including, such as, a network interface card such as a LAN card, a modem, etc. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or wiredly to exchange data and perform communication processing via a network such as the Internet. The drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that the computer program read from it can be installed into the storage device 608 as needed.
[0306] Although Figure 7 an electronic device 600 including various devices is shown, it should be understood that it is not required to implement or include all the shown devices. In different implementation examples, more or fewer devices may alternatively be implemented or included.
[0307] For example, the electronic device 600 may further include a peripheral interface (not shown in the figure), etc. The peripheral interface may be various types of interfaces, such as a USB interface, a Lightning interface, etc. The communication device 609 may communicate with the network and other devices through wireless communication. The network may be, for example, the Internet, an intranet, and / or a wireless network such as a cellular phone network, a wireless local area network (LAN), and / or a metropolitan area network (MAN). The wireless communication may use any one of a variety of communication standards, protocols, and technologies, including but not limited to Global System for Mobile Communications (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Bluetooth, Wi-Fi (e.g., based on IEEE 802.11a, IEEE 802.11b, IEEE 802.11g, and / or IEEE 802.11n standards), Voice over Internet Protocol (VoIP), WiMAX, protocols for email, instant messaging, and / or Short Message Service (SMS), or any other suitable communication protocol.
[0308] It should be noted that in the embodiments of the present disclosure, for the specific functions and technical effects of the electronic device 600, reference may be made to the relevant descriptions of the resource management method and device in the embodiments of the present disclosure, which will not be elaborated here.
[0309] Figure 8 A schematic block diagram of another electronic device provided by at least one embodiment of the present disclosure is shown.
[0310] At least one embodiment of the present disclosure also provides an electronic device, as Figure 8 shown, the electronic device 700 includes at least one processor 710 and at least one memory 720.
[0311] For example, the memory 720 may be used to non-temporarily store computer-readable instructions (e.g., one or more computer program modules). The processor 710 may be used to run the computer-readable instructions. When the computer-readable instructions are run by the processor 710, one or more steps in the resource management method described above may be executed. The memory 720 and the processor 710 may be interconnected through a bus or a link, in a wired, wireless, and / or other forms of communication media, etc., and the embodiments of the present disclosure do not limit this.
[0312] For example, the processor 710 may be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units with data processing capabilities and / or program execution capabilities. For example, the central processing unit (CPU) may be of the RISC, X86, or ARM architecture, etc. The processor 710 may be a general-purpose processor or a dedicated processor, and may control other components in the electronic device 700 to perform desired functions.
[0313] For example, the memory 720 may include any combination of one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules may be stored on the computer-readable storage media, and the processor 710 may run one or more computer program modules to implement various functions of the electronic device 700. Various application programs and various data, as well as various data used and / or generated by the application programs, etc., may also be stored in the computer-readable storage media.
[0314] At least one embodiment of the present disclosure also provides a non-transitory computer-readable storage medium for non-temporarily storing computer-readable instructions, which can implement the above resource management method when executed by a computer.
[0315] Figure 9 Schematic diagram of a computer-readable storage medium provided for some embodiments of the present disclosure.
[0316] As Figure 9 shown, the computer-readable storage medium 800 is used to store computer-readable instructions 810. For example, when the computer-readable instructions 810 are executed by a computer, one or more steps of the resource management method described above may be performed.
[0317] For example, the computer-readable storage medium 800 may be applied to the above-mentioned electronic device 600 or electronic device 700. For example, the relevant description of the non-volatile computer-readable storage medium 800 may also refer to the corresponding description of the memory 720 in the electronic device 700 shown in Figure 8 which will not be elaborated here.
[0318] It should be noted that in the embodiments of the present disclosure, for the specific functions and technical effects of the computer-readable storage medium 800, reference may be made to the relevant descriptions of the resource management method and apparatus above, and details are not described herein again.
[0319] The following points need to be explained:
[0320] (1) The accompanying drawings of the embodiments of the present disclosure only relate to the structures involved in the embodiments of the present disclosure, and other structures may refer to the general design.
[0321] (2) Without conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other to obtain new embodiments.
[0322] As described above, the above are only the specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. The protection scope of the present disclosure shall be subject to the protection scope of the claims.
Claims
1. A resource management method, comprising: During the running of a first task in the multi-node system, first load information of the first task is obtained according to a first period, and node resource allocation for the first task in the multi-node system is set based on the first load information, wherein the node resource allocation includes scheduling affinity; and During the running of the first task, in response to a first scheduling adjustment trigger, it is determined whether to adjust the first node resource allocation currently used for the first task based on the current running state of the first task.
2. The resource management method according to claim 1, wherein: The determining, in response to the first scheduling adjustment trigger, whether to adjust the first node resource allocation currently used for the first task based on the current running state of the first task, includes: Obtain second load information of the first task, and determine whether to adjust the first node resource allocation currently used for the first task based on the second load information, wherein the second load information is the first load information of the first task that was most recently obtained.
3. The resource management method according to claim 2, wherein: Determining whether to adjust the first node resource allocation currently used for the first task based on the second load information includes: Based on the load quantity or task quantity indicated by the second load information, a second node resource allocation is obtained, and by comparing the first node resource allocation with the second node resource allocation, it is determined whether to adjust the first node resource allocation currently used for the first task.
4. The resource management method according to claim 3, wherein: The determining whether to adjust the first node resource allocation currently used for the first task by comparing the first node resource allocation with the second node resource allocation includes: In response to the first node resource allocation being consistent with the second node resource allocation, increasing a triggering threshold of the first scheduling adjustment trigger by a first step.
5. The resource management method according to claim 3, wherein: The determining whether to adjust the first node resource allocation currently used for the first task by comparing the first node resource allocation with the second node resource allocation further includes: In response to the first node resource allocation being inconsistent with the second node resource allocation, and in response to the second node resource allocation being more than the first node resource allocation, adjusting the scheduling affinity of the first node resource allocation to the node resource of the second node resource allocation.
6. The resource management method according to claim 3, wherein: The determining whether to adjust the first node resource allocation currently used for the first task by comparing the first node resource allocation with the second node resource allocation further includes: In response to the first node resource allocation being inconsistent with the second node resource allocation, and in response to the second node resource allocation being less than the first node resource allocation, In response to the multi-node system being in a first convergence period, stop adjusting the first node resource allocation currently used for the first task, and wait for a new scheduling adjustment trigger for the first task; or If the multi-node system is not within the first convergence period, adjusting the first node resource allocation based on the occurrence frequency of the first event, The first event is a periodic statistical number in which the second node resource allocation is less than the first node resource allocation.
7. The resource management method according to claim 6, wherein: The adjusting the first node resource allocation based on the occurrence frequency of the first event includes: In response to the occurrence frequency of the first event being greater than or equal to a first preset threshold, adjusting the scheduling affinity of the first node resource allocation to the node resource of the second node resource allocation; In response to the occurrence frequency of the first event being less than the first preset threshold, the occurrence frequency of the first event is increased by 1.
8. The resource management method according to claim 2, wherein: The determining, in response to the first scheduling adjustment trigger, whether to adjust the first node resource allocation currently used for the first task based on the current running state of the first task, further includes: In response to a first scheduling adjustment trigger, running a task for scheduling adjustment to determine whether to adjust a first node resource allocation currently used for the first task based on a current running state of the first task; Clears the statistics that trigger the schedule adjustment.
9. The resource management method according to claim 8, wherein: The step of running a task for scheduling adjustment in response to the first scheduling adjustment trigger includes: In response to the first scheduling adjustment trigger, based on the scheduling trigger information corresponding to the first task, the task for scheduling adjustment is run, wherein the scheduling trigger information includes a semaphore, a message queue or a message signal.
10. The resource management method according to any one of claims 1 to 9, wherein: The step of setting node resource allocation for the first task in the multi-node system based on the first load information includes: Determining a load utilization rate in the multi-node system based on the first load information; Based on the load utilization, node resource allocation for the first task in the multi-node system is set.
11. The resource management method according to claim 10, wherein: The determining, based on the first load information, a load utilization rate in the multi-node system includes: The load utilization rate in the multi-node system is determined based on the first load information and the third load information, wherein the third load information is the load information in a preceding cycle according to the first load information.
12. The resource management method according to claim 10, wherein: The step of setting node resource allocation for the first task in the multi-node system based on the load utilization rate further includes: In response to the load utilization being greater than a second preset threshold, the node resource allocation for the first task is expanded.
13. The method of claim 12, wherein: In response to the load utilization being greater than the second preset threshold, extending the node resource allocation for the first task comprises: Based on the distribution position of each node resource in the multi-node system, the node resource allocation for the first task is expanded.
14. The resource management method according to claim 13, wherein: In response to the load utilization being greater than the second preset threshold, extending the node resource allocation for the first task further includes: After extending the node resource allocation for the first task, the multi-node system is caused to enter a first convergence period.
15. The resource management method according to claim 10, wherein: The step of setting node resource allocation for the first task in the multi-node system based on the load utilization rate further includes: In response to the load utilization being less than or equal to a second preset threshold, setting node resource allocation for the first task in the multi-node system based on a second event, The second event includes: setting the frequency of node resource allocation for the first task in the multi-node system and / or the number of periodic statistics in which the load utilization is less than the second preset threshold.
16. The resource management method according to claim 15, wherein: The step of setting node resource allocation for the first task in the multi-node system based on the second event includes: Release the scheduling affinity setting in the node resource allocation of the first task.
17. The resource management method according to claim 10, wherein: The step of setting node resource allocation for the first task in the multi-node system based on the first load information further includes: After setting the node resource allocation for the first task in the multi-node system, the first load information is recorded and a dormant state is entered in the current cycle.
18. A resource management device, comprising: a load tracking and adjustment module configured to, during the running of a first task in the multi-node system, obtain first load information of the first task according to a first period, and set node resource allocation for the first task in the multi-node system based on the first load information, wherein the node resource allocation includes scheduling affinity; and The scheduling adjustment module is configured to determine whether to adjust the first node resource allocation currently used for the first task based on the current running state of the first task in response to a first scheduling adjustment trigger during the running process of the first task.
19. An electronic device comprising the resource management device according to claim 18.
20. An electronic device, comprising: processor; as well as A memory, wherein the memory stores at least one computer program, and when the at least one computer program is executed by the processor, the resource management method according to any one of claims 1 to 17 is implemented.
21. A non-transitory computer-readable storage medium, used for non-temporarily storing computer-readable instructions, which, when executed by a computer, implements the resource management method described in any one of claims 1 to 17.
Citation Information
Cited By
Memory management method and storage device
CN121387194A