Resource allocation method and device, electronic equipment and storage medium
By dynamically allocating resources based on the ratio of solid-state drives to the total number of CPU cores in a multi-SSD architecture, the resource imbalance problem caused by the random core binding strategy is resolved, ensuring that high-priority SSDs receive sufficient resources, achieving stable SSD performance and improving overall system efficiency.
Patent Information
- Application Number
- CN202511216753.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-08-28
AI Technical Summary
In a multi-SSD architecture, the random core binding strategy leads to uneven CPU resource allocation, causing some SSDs to obtain excessive resources while others to obtain insufficient resources, resulting in performance fluctuations and resource waste.
By obtaining the total number of solid-state drives (SSDs) and the total number of physical cores in the CPU of the server, the priority is determined, and target SSDs are selected in descending order. The number of physical cores is allocated based on their performance requirements to ensure that high-priority SSDs receive sufficient resources and dynamically adjust the resource allocation of the remaining SSDs.
It achieves optimal resource utilization, ensures the stability and maximization of SSD performance, avoids performance fluctuations and resource waste, and improves the response speed and data processing efficiency of the overall storage system.
Smart Images

Figure CN120704901A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource allocation method, device, electronic device, and storage medium. Background Art
[0002] Current servers extensively utilize solid-state drives (SSDs) for data storage. SSD performance, such as random read / write and sequential read / write speeds, directly impacts storage system efficiency. Multi-SSD architectures are widely adopted in current servers to meet the demands of high-concurrency data access. CPU resource allocation is the process of balancing the allocation of central processing unit (CPU) cores based on the number of SSDs and task requirements to optimize I / O performance. In multi-SSD architectures, a random core allocation strategy is often used for CPU resource allocation. This strategy involves randomly assigning CPU cores to SSDs.
[0003] However, because the I / O throughput of different SSDs varies by as much as 15%-20%, the random core binding strategy can easily lead to uneven CPU resource allocation. Some SSDs may obtain excessive CPU resources while others may not, causing performance fluctuations and resource waste. Summary of the Invention
[0004] The present application provides a resource allocation method, apparatus, electronic device, and storage medium to at least solve the problem of unbalanced resource allocation caused by the random core binding strategy used in resource allocation in the related art.
[0005] The present application provides a resource allocation method, including: obtaining the total number of solid-state drives of a server and the total number of physical cores of a central processing unit of the server; individual solid-state drives in the total number of solid-state drives have different priorities; when a first ratio between the total number of solid-state drives and the total number of physical cores is a non-integer, determining the remainder of the first ratio as the remaining number of cores, and selecting a group of target solid-state drives equal to the remaining number of cores from the server in descending order of priority of the individual solid-state drives; and determining the number of physical cores required to be allocated to target solid-state drives in the group of target solid-state drives; and allocating the number of physical cores to the group of target solid-state drives according to the number of physical cores required to be allocated to the target solid-state drives.
[0006] The present application also provides a resource allocation device, including: an acquisition module, used to obtain the total number of solid-state hard drives of a server and the total number of physical cores of the central processing unit of the server; the individual solid-state hard drives in the total number of solid-state hard drives have different priorities; a policy determination module, used to determine the remainder of the first ratio as the remaining number of cores when the first ratio between the total number of solid-state hard drives and the total number of physical cores is a non-integer, and select a group of target solid-state hard drives equal to the remaining number of cores from the server in order of the priority of the individual solid-state hard drives from high to low; and determine the number of physical cores required to be allocated to the target solid-state hard drives in the group of target solid-state hard drives; an allocation module, according to the number of physical cores required to be allocated to the target solid-state hard drives, allocate the number of physical cores to the group of target solid-state hard drives.
[0007] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned resource allocation methods when executing the computer program.
[0008] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned resource allocation methods are implemented.
[0009] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above resource allocation methods when executed by a processor.
[0010] Through the present application, the total number of solid-state drives and the total number of physical cores are obtained in real time. When faced with a first ratio condition in which a non-integer ratio exists between the total number of solid-state drives and the total number of physical cores, the remainder of the first ratio is determined as the number of remaining cores. A group of target solid-state drives equal to the number of remaining cores are selected from the server in descending order of priority of the individual solid-state drives. By determining a group of target solid-state drives and the optimal number of physical cores allocated to the target solid-state drives, resource priority scheduling is intelligently implemented to ensure that solid-state drives with high priority obtain sufficient physical core resources. This solves the problem of unbalanced resource allocation caused by the random core binding strategy used in resource allocation in related technologies, and ensures the stability and maximization of SSD performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0012] Figure 1This is an application environment diagram of a resource allocation method provided in an embodiment of the present application.
[0013] Figure 2 A flowchart of a resource allocation method provided in an embodiment of the present application.
[0014] Figure 3 An example diagram of physical core allocation provided in an embodiment of the present application.
[0015] Figure 4 This is a flowchart of another resource allocation method provided in an embodiment of the present application.
[0016] Figure 5 This is a structural diagram of a resource allocation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0017] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0018] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0019] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0020] According to one aspect of the embodiment of the present application, a resource allocation method is provided. Optionally, in this embodiment, the resource allocation method can be applied to, but is not limited to, Figure 1The server shown includes a central processing unit (CPU) 102 and a solid-state drive (SSD) 104. The CPU 102 plays a core role in computing resource management and performance optimization, intelligently allocating its core resources to different solid-state drives 104 to maximize performance and improve resource utilization efficiency. As a high-speed storage device, the performance of the solid-state drive 104 directly affects data access speed and system response time. By intelligently binding with the CPU, the SSD can be optimized in terms of reducing latency and improving IOPS and other key indicators, thereby enhancing the data processing capabilities and business processing efficiency of the entire server. The server can be, but is not limited to, a cloud server, a server cluster, or other server types.
[0021] The resource allocation method of the embodiment of the present application can be executed by a server. Figure 2 is a flow chart of an optional resource allocation method according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include the following steps:
[0022] Step S202 , obtaining the total number of solid-state hard disks of the server and the total number of physical cores of the central processing unit of the server.
[0023] Step S204: When the first ratio between the total number of solid-state drives and the total number of physical cores is a non-integer, the remainder of the first ratio is determined as the number of remaining cores, and a group of target solid-state drives equal to the number of remaining cores are selected from the server in descending order of priority of the individual solid-state drives; and the number of physical cores required to be allocated to the target solid-state drives in the group of target solid-state drives is determined.
[0024] Step S206 : Allocate the number of physical cores to a group of target solid-state drives according to the number of physical cores required to be allocated to the target solid-state drives.
[0025] An embodiment of the present application provides a resource allocation method for use in the field of computer technology. A server includes multiple solid-state drives (SSDs) and multiple central processing units (CPUs), each of which includes multiple physical cores. A physical core is the actual execution unit within the CPU, capable of independently executing instruction sets and serving as a fundamental component of computing resources. Each SSD is bound to multiple physical cores. The strategy of binding multiple physical cores to each SSD is designed to more efficiently utilize computing resources. By allocating appropriate physical cores to the SSDs, data access performance can be significantly improved, processing latency can be reduced, and the overall operational efficiency and business processing capabilities of the server can be enhanced.
[0026] In single-SSD scenarios, exclusive CPU resource allocation (e.g., binding all physical cores to a single SSD) maximizes hardware capabilities and achieves the manufacturer's nominal performance (Spec). In multi-SSD architectures, a random core allocation strategy is often used to allocate CPU resources. This strategy randomly assigns CPU cores to SSDs. For example, a server configured with two CPUs (each with 16 cores) and four SSDs uses random core allocation, with the number of cores bound to each SSD randomly determined. However, because the I / O throughput of different SSDs varies by as much as 15%-20%, random core allocation can easily lead to uneven CPU resource allocation. Some SSDs may receive excessive CPU resources while others may receive insufficient resources, causing performance fluctuations and resource waste. For example, binding a 6-core SSD can achieve 600K IOPS, while binding a 2-core SSD can only achieve 400K IOPS. Using random core allocation can prevent the overall storage system from meeting the stringent consistency requirements of real-time databases, resulting in performance fluctuations. For example, if a random core binding strategy is adopted, the utilization rate of low-load cores will be lower than 50% for a long time, while high-load cores will become bottlenecks due to contention, resulting in resource waste.
[0027] In order to solve the above problems, in the embodiment of the present application, CPU resources are allocated according to the ratio between the total number of solid-state drives and the total number of physical cores in the server, and CPU resources are allocated intelligently. The SSD performance data is significantly improved, and the problem of uneven resource allocation caused by the traditional random core binding strategy is effectively solved.
[0028] In this embodiment of the present application, the total number of SSDs refers to the number of SSDs installed in the server. The total number of physical cores refers to the total number of physical cores contained in all CPUs in the server. A single SSD refers to each independent SSD device in the server, and each SSD will be assigned a specific number of physical cores based on the determined core binding policy.
[0029] When the ratio (M / N) of a server's total physical cores (M) to the total number of SSDs (N) is non-integer, it indicates that simply allocating resources equally cannot meet the performance requirements of all SSDs. In this case, an intelligent priority allocation strategy should be implemented to identify and prioritize the core requirements of performance-critical SSDs. Specifically, the number of cores corresponding to the remainder of the M / N ratio is allocated to multiple SSDs with high priority, forming a target group of SSDs. Simultaneously, resource allocation to the remaining SSDs is dynamically adjusted based on real-time performance requirements to achieve optimal resource utilization and maximize system performance.
[0030] A group of target SSDs refers to a set of SSDs that enjoy a high priority in the resource allocation policy. It is understood that a group of target SSDs is a set of SSDs selected from the server in descending order of individual SSD priority, equal to the number of remaining cores. These SSDs have high priority in resource allocation and are prioritized for additional physical core support to improve data read and write performance. In this embodiment, the remainder of the first ratio is determined as the number of remaining cores, and a group of target SSDs equal to the number of remaining cores is selected from the server in descending order of individual SSD priority. Individual SSDs within the total number of SSDs have different priorities. Priority refers to the order in which SSDs are prioritized in resource allocation based on their impact on system performance or the technical characteristics of the link they are connected to (e.g., PCIe 4.0). In this embodiment, the remainder of the first ratio is the number of remaining cores. In this embodiment, the number of remaining cores refers to the number of additional physical cores that remain unallocated after allocating CPU physical cores to SSDs according to the base ratio and can be used to further optimize critical SSD performance. For example, assuming the total number of physical cores is 32 and there are 5 SSDs, the integer part of the first ratio between the total number of SSDs and the total number of physical cores is 6, and the remainder is 2. Then the number of remaining cores is 2, and 2 target SSDs can be selected from the server. In this embodiment, the number of remaining cores can be expressed using the following formula (1):
[0031]
[0032] The number of physical cores required to allocate to a target SSD refers to the minimum number of physical cores required to meet the target SSD's performance requirements or ensure it resides within the same Non-Uniform Memory Access (NUMA) node as a specified CPU. For example, the number of physical cores required for optimal performance can be calculated based on the target SSD's performance requirements, including current metrics such as IOPS, throughput, and latency, as well as expected business growth. Another example is the dynamic adjustment of the target SSD's physical core allocation based on its real-time performance metrics and historical load data.
[0033] Through the embodiments of the present application, the total number of solid-state drives and the total number of physical cores are obtained in real time. When a first ratio condition in which a non-integer ratio exists between the total number of solid-state drives and the total number of physical cores, the remainder of the first ratio is determined as the number of remaining cores. A group of target solid-state drives equal to the number of remaining cores are selected from the server in descending order of priority of the individual solid-state drives. By determining a group of target solid-state drives and the optimal number of physical cores allocated to the target solid-state drives, resource priority scheduling is intelligently implemented to ensure that solid-state drives with high priority obtain sufficient physical core resources. This solves the problem of unbalanced resource allocation caused by the random core binding strategy used in resource allocation in related technologies, thereby ensuring the stability and maximization of SSD performance.
[0034] In an exemplary embodiment, obtaining the total number of solid-state drives of a server and the total number of physical cores of a central processing unit of the server includes:
[0035] Determine the server's topology; the topology includes the physical layout and access relationships between storage devices and different physical cores in the server; based on the topology, determine the total number of solid-state drives in the server and the total number of physical cores in the server's central processing unit.
[0036] In server architectures, SSDs are typically connected to the server motherboard via PCI-E slots. Different slots may connect to different CPUs and NUMA nodes, affecting SSD access performance. NUMA is a memory management method in multi-processor architectures, primarily used in servers and other high-performance computing systems. In a NUMA system, multiple CPUs are tightly coupled with their respective local memory, forming multiple independent NUMA nodes. Each NUMA node contains at least one CPU and local memory resources that the CPU can directly and quickly access. This means that when a CPU accesses memory within its local node, access speeds are fast and latency is low, just like memory access in a single-processor system. However, if a CPU needs to access memory belonging to another node (remote memory), it must access it via an interconnect bus (such as Intel Ultra Path Interconnect (Intel UPI) or AMD Infinity Fabric), which significantly increases access latency and bandwidth consumption. In short, an SSD is associated with a CPU, and a CPU and its local memory form a NUMA node.
[0037] Based on the server architecture described above, server topology refers to the physical layout of the server's internal hardware components (particularly storage devices and physical cores) and the access relationships between them. This topology, which includes the NUMA node location associations between SSDs and CPU physical cores, is crucial for optimizing storage performance and resource allocation.
[0038] Optionally, the server runs the command lspci -vvv to confirm the NUMA node relationship between the SSD and CPU. The command numactl --hardware is used to view the NUMA node distribution and clarify the layout and access relationship between storage devices and physical cores. The server uses query commands to count all internal SSD devices and record the total number of SSDs, N. The server executes the command lscpu to obtain information about the number of physical cores, recording the total number of physical cores M, the number of cores per socket, and the logical core distribution of the server CPU. The server then uses a script to parse / proc / cpuinfo to distinguish between physical cores and hyperthreaded logical cores.
[0039] Through this embodiment, the topology of the server is clarified, including the layout and access relationship between storage devices and physical cores, which can more quickly determine the total number of solid-state drives and the total number of physical cores and more reasonably allocate computing resources.
[0040] In an exemplary embodiment, determining the number of physical cores required to be allocated to a target solid-state drive in a group of target solid-state drives includes:
[0041] The integer part of the first ratio is determined as the first basic core number, and the number of physical cores equal to the first basic core number is determined as the number of physical cores required to be allocated to the target solid-state drives in a group of target solid-state drives; the first basic core number refers to the number of cores required to be allocated to the target solid-state drives in a group of target solid-state drives.
[0042] Among them, the first basic core number refers to the integer part of the first ratio when the first ratio is a non-integer. In this embodiment, when the total number of SSDs cannot be accurately matched with the total number of CPU physical cores, a group of physical cores required by the target solid-state drives are preferentially allocated according to the first basic core number, which can ensure that the target solid-state drives obtain sufficient CPU support, thereby maximizing their data processing performance. For example, assuming that the total number of physical cores is 32 cores, there are 5 SSDs, the first basic core number is 6 cores, and the remaining core number is 2, then according to the order of priority of the single solid-state drives from high to low, 2 SSDs are selected from the server as a group of target solid-state drives, and each target solid-state drive is allocated a number of cores equal to the first basic core number (the value is 6).
[0043] It should be noted that determining the number of target SSDs based on the number of remaining cores is to ensure that critical SSDs receive additional CPU resources to optimize their performance. The reason for this is that the remaining cores represent "extra" computing power allocated to high-priority SSDs. By precisely allocating them to a specific number of target SSDs, the I / O processing capabilities of the critical SSDs can be maximized without affecting the basic performance of other SSDs, significantly improving the overall storage system's responsiveness and data processing efficiency.
[0044] Through this embodiment, when the first ratio of the total number of solid-state drives to the total number of physical cores is not an integer, the integer part of the first ratio is defined as the first basic core number, and the remainder is defined as the remaining core number. Then, the target SSD is selected according to the priority of the SSD, and additional physical core support is given according to the first basic core number to ensure that the key SSD can obtain optimal performance. At the same time, the remaining SSDs can also obtain core resources according to the ratio, reducing performance bottlenecks and resource waste.
[0045] In an exemplary embodiment, the resource allocation method further includes:
[0046] When the first ratio between the total number of solid-state drives and the total number of physical cores is an integer, the first ratio is determined as the second basic core number, and a number of physical cores equal to the second basic core number is allocated to each solid-state drive in the server; the second basic core number refers to the number of cores required to be allocated to each solid-state drive.
[0047] The first ratio is a mathematical ratio between the total number of physical cores and the total number of solid-state drives. In this embodiment, when the first ratio is an integer, it is used as a basis for determining the second basic core number, which represents the average number of physical cores that can be theoretically allocated to each SSD. The second basic core number refers to the number of physical cores that should theoretically be allocated to each solid-state drive when the ratio between the total number of solid-state drives and the total number of physical cores is an integer. The second basic core number can be expressed using the following formula (2), where N represents the total number of solid-state drives and M represents the total number of physical cores:
[0048]
[0049] For example, the total number of physical cores of the server is 32 cores, the total number of solid-state drives is 4 SSDs, and the test task type is random / sequential read and write. In this case, the first ratio between the total number of solid-state drives and the total number of physical cores is 8, that is, the first ratio is an integer, then the second basic core number is also 8, and the core binding strategy is that the number of physical cores required to be allocated to a single solid-state drive in the server is 8 cores, that is, each SSD is allocated 8 cores.
[0050] Through this embodiment, when the first ratio between the total number of SSDs and the total number of physical cores is an integer, the first ratio is determined as the second basic core number, and the second basic core number refers to the number of cores required to be allocated to a single solid-state drive. The core binding strategy is determined in this way, thereby automatically determining the number of cores that each SSD should be bound to, avoiding the situation in the related art where some SSDs occupy too many resources while other SSDs have insufficient resources due to the random core binding strategy, ensuring that all SSDs can obtain balanced CPU support in multi-tasking scenarios, and reducing performance fluctuations.
[0051] In an exemplary embodiment, after allocating the number of physical cores to a group of target solid-state drives according to the number of physical cores required to be allocated to the target solid-state drives, the resource allocation method further includes:
[0052] The number of physical cores allocated to the other SSDs in the server, excluding the target SSDs, based on the number of physical cores in the total number of physical cores excluding the physical cores allocated to the target SSDs.
[0053] Among them, the number of other physical cores refers to the number of cores remaining in the total number of physical cores of the server, excluding the physical cores allocated to a group of target solid-state drives, which can be used for subsequent resource allocation optimization. Other solid-state drives refer to the remaining SSDs on the server, except for a group of target solid-state drives that are given priority. They will allocate resources based on the remaining number of physical cores and other system policies. The number of physical cores required to be allocated to other solid-state drives can be dynamically determined based on the performance requirements and workload of the remaining SSDs. For example, if the load on other solid-state drives is relatively even, the remaining cores can be roughly evenly distributed to each SSD in the other solid-state drives to maintain overall load balance. Conversely, if it is detected that the load of several SSDs in the other solid-state drives suddenly increases, the resource allocation of the SSD with the sudden increase in load will be adjusted first to ensure its stable performance. At the same time, appropriate resource allocation will be made to other SSDs to avoid a decrease in overall system efficiency.
[0054] Through this embodiment, after allocating resources to a group of target SSDs based on the number of physical cores required by the target SSDs, resources are further allocated to other SSDs based on the remaining number of physical cores. This ensures that all SSDs have the opportunity to obtain physical core resources that match their performance requirements, avoids idle and wasted resources, and achieves comprehensive optimization of server resources. This intelligent allocation method not only ensures the performance of key SSDs, but also enables other SSDs to obtain appropriate physical core support based on their actual workloads, helping to achieve load balancing for the entire system and preventing performance bottlenecks caused by improper resource allocation.
[0055] In an exemplary embodiment, the number of physical cores allocated to other solid-state drives in the server except for the group of target solid-state drives according to the number of other physical cores in the total number of physical cores except for the physical cores allocated to the group of target solid-state drives includes:
[0056] The second ratio between the number of other physical cores and the number of other solid-state drives in the server except for a group of target solid-state drives is rounded up, and the resulting integer is determined as the third basic core number; the number of physical cores equal to the third basic core number is allocated to the other solid-state drives; the third basic core number refers to the number of physical cores required to be allocated to the other solid-state drives.
[0057] Among them, the number of other physical cores refers to the number of unallocated physical cores remaining after the physical cores are allocated to a group of target solid-state drives. Other solid-state drives refer to all SSDs except a group of target solid-state drives. The second ratio describes the ratio between the remaining cores and the number of other solid-state drives after removing the cores required by a group of target solid-state drives from the total number of physical cores. When the second ratio is a non-integer, the third basic core number is determined by rounding up to ensure fairness and maximum resource utilization. The third basic core number refers to the number of physical cores that should be allocated to each other solid-state drive after rounding up the second ratio during the resource allocation process. The third basic core number is intended to ensure that non-target SSDs can also obtain basic performance support, while taking into account the limited server resources and the need for balanced distribution. For example, assuming the total number of physical cores is 32, there are 5 SSDs, the first base core count is 6 cores, the remaining core count is 2, the number of other physical cores is 20, and the number of other SSDs is 3, then the third base core count obtained by rounding up the second ratio is 7. Therefore, the remaining 3 other SSDs are allocated a number of cores equal to the third base core count (7).
[0058] It should be noted that the first basic core number prioritizes the high performance requirements of the target SSD, while the third basic core number ensures that all SSDs have basic CPU support. The use of the first basic core number to allocate physical cores to the target solid-state drive is intended to ensure that these critical storage devices can obtain priority resources to meet high-load requirements, thereby optimizing the performance of core services. Through the third basic core number allocation strategy, other solid-state drives are rounded up and allocated, ensuring that even in the case of limited resources, each SSD can obtain a fair number of physical cores that is sufficient to support its basic functions, avoiding performance bottlenecks caused by uneven resource allocation. This differentiated allocation mechanism not only enhances the processing power of the target SSD, but also takes into account the performance balance of all SSDs, avoids resource waste and performance bottlenecks, and improves the overall efficiency and resource utilization of the system.
[0059] In this embodiment, the allocation strategy for the number of physical cores required to be allocated to a target SSD in a group of target SSDs and the number of physical cores allocated to other SSDs is defined as a core binding strategy. For example, assuming a total of 32 physical cores and 5 SSDs, the core binding strategy can be expressed as allocating 7 cores × 3 SSDs + 6 cores × 2 SSDs. That is, the core binding strategy indicates that for the target SSDs with the highest and second highest priority, 6 physical cores are allocated to each target SSD, and for the remaining 3 SSDs, 7 physical cores are allocated to each SSD.
[0060] Through this embodiment, the ratio of the number of remaining cores after excluding the cores required by the target SSD to the non-target SSDs in the server is rounded up to obtain a third basic core number, ensuring that the non-target SSDs also obtain the necessary CPU resources; by allocating the third basic core number rounded up, even in the case of tight resources, it can be guaranteed that each SSD has sufficient physical core support, avoiding performance degradation due to insufficient resources, achieving overall performance balance and improvement, and solving the shortcomings of uneven resource allocation and overly extensive resource allocation in a multi-SSD environment.
[0061] In one exemplary embodiment, for example, Figure 3 An example diagram of physical core allocation provided in an embodiment of the present application is shown as follows: Figure 3 As shown, assume that a server is configured with two physical CPUs (denoted as CPU0 and CPU1), each with 16 physical cores, for a total of 32 physical cores. Five SSDs are installed on the server. The first two SSDs (denoted as SSD1 and SSD2) are located on the first NUMA node and associated with CPU0, while the last three SSDs (denoted as SSD3, SSD4, and SSD5) are located on the second NUMA node and associated with CPU1. Assuming that SSD1 and SSD2 require 6 cores, and SSD3, SSD4, and SSD5 require 7 cores, then 6 cores are allocated from CPU0 to SSD1 and SSD2, respectively, leaving 4 cores for CPU0. Seven cores are allocated from CPU1 to SSD3 and SSD4, respectively, leaving 2 cores for CPU1. Because the remaining 6 cores of CPU0 and CPU1 are insufficient to allocate to SSD5, this embodiment provides the following solutions for situations where the SSDs fail to achieve expected performance due to insufficient CPU resources or the allocation principle of the SSDs being in the same NUMA as the bound CPUs is not met:
[0062] Method 1: If the designated CPU and the designated SSD are located in the same memory access node and the number of remaining cores in the designated CPU is less than the number of physical cores required to be allocated to the designated SSD, the number of remaining cores in the designated CPU is used as the number of cores allocated to the designated SSD. The designated SSD refers to an SSD that does not meet the expected performance due to insufficient physical core resources or fails to meet the allocation principle of having the SSD and the bound CPU in the same memory node (such as a NUMA node). The designated CPU is the CPU bound to the designated SSD.
[0063] For example, in the preceding example, SSD3, SSD4, and SSD5 are located on the second NUMA node and are associated with CPU1. Seven cores are allocated to SSD3, SSD4, and SSD5, respectively. Seven cores are allocated from CPU1 to SSD3 and SSD4, leaving two cores in CPU1. These remaining two cores are used as the number of cores allocated to SSD5.
[0064] Method 2: When a designated central processor and a designated solid-state drive are located in the same memory access node, and the number of remaining cores of the designated central processor is less than the number of physical cores required to be allocated to the designated solid-state drive, determine multiple solid-state drives bound to the designated central processor and the number of physical cores required to be allocated to solid-state drives other than the designated solid-state drive among the multiple solid-state drives, continuously monitor the CPU core utilization of the solid-state drives other than the designated solid-state drive among the multiple solid-state drives, select at least one borrowing solid-state drive from the multiple solid-state drives other than the designated solid-state drive, borrow a specified number of cores from the at least one borrowing solid-state drive, and use the number of remaining cores of the designated central processor and the specified number of cores borrowed from the at least one borrowing solid-state drive as the number of cores allocated to the designated solid-state drive; continuously monitor the CPU core utilization of the designated solid-state drive, and release the borrowed specified number of cores when the CPU core utilization of the designated solid-state drive is less than a preset utilization threshold; wherein the borrowing solid-state drive refers to an solid-state drive bound to the designated central processor and whose CPU core utilization is less than the preset utilization threshold; and the specified number of cores refers to the minimum number of physical cores required to meet the performance of the designated solid-state drive and to be located in the same memory node as the designated central processor.
[0065] For example, Figure 3As shown, for the above example, SSD3, SSD4, and SSD5 are located on the second NUMA node and are associated with CPU1. SSD3, SSD4, and SSD5 need to be allocated 7 cores. 7 cores are allocated from CPU1 to SSD3 and SSD4 respectively. CPU1 has 2 cores remaining, and SSD5 still needs 5 cores. The utilization of the CPU cores of SSD3 and SSD4 is continuously monitored. Assuming that the utilization of SSD3 and SSD4 is less than the preset utilization threshold, 5 cores are borrowed from SSD3 and SSD4, such as 2 cores from SSD3 and 3 cores from SSD4. The remaining two cores of CPU1 and the borrowed five cores are used as the number of cores allocated to the specified solid-state drive, and the utilization of the CPU cores of SSD5 is continuously monitored. When the utilization of the CPU cores of SSD5 is lower than the preset utilization threshold, the five borrowed cores are released. For example, the two cores borrowed from SSD3 are returned to SSD3, and the three cores borrowed from SSD4 are returned to SSD4.
[0066] Through this embodiment, when the performance demand of a designated solid-state drive exceeds the remaining resources of a designated central processor, by intelligently borrowing additional physical cores from a low-load SSD, it is possible to ensure that the designated solid-state drive achieves the expected performance and avoids performance bottlenecks. It is also possible to ensure that the cores of the designated solid-state drive and the designated central processor are allocated in the same NUMA node, thereby reducing the delay in cross-node access and improving the consistency of data access speed and overall system response time. By continuously monitoring the CPU core utilization of all SSDs bound to them, it is possible to effectively prevent some cores from being in a low-utilization state for a long time and avoid idle resources. Once the performance demand of a designated SSD decreases or the system load changes, causing the utilization of its bound cores to decrease, the system can automatically release the previously borrowed cores and allocate them to SSDs or applications that need them more, thereby achieving efficient reallocation of resources.
[0067] In an exemplary embodiment, the working mode of the central processing unit includes a performance mode and an energy-saving mode; the performance mode refers to the mode in which the central processing unit operates at the highest frequency; the energy-saving mode refers to the mode in which the central processing unit dynamically adjusts the frequency according to the load. The above resource allocation method also includes:
[0068] Set the central processing unit to performance mode and disable energy-saving mode; perform performance testing on the server after the setting and analyze the test results. If the analysis results indicate that the performance value of the server is less than or equal to the preset threshold, adjust the core binding policy. The core binding policy refers to the number of physical cores required to be allocated to a single solid-state drive in the server; according to the core binding policy, reallocate the required number of physical cores to the single solid-state drive until the server's performance value exceeds the preset threshold.
[0069] C-states are technologies that typically limit CPU frequency or core usage to reduce power consumption. Disabling C-states removes any power restrictions on the CPU, allowing it to run at full speed without being affected by power-saving policies. During performance testing, cpupower is used to force the CPU to run at its highest frequency, eliminating interference from power-saving policies and optimizing SSD data processing performance.
[0070] The core binding strategy is a method of intelligently determining the number of physical cores to be allocated to each SSD based on the ratio of the total number of solid-state drives to the total number of physical cores. In this embodiment, the core binding strategy includes the number of physical cores required to be allocated to the target solid-state drives in a group of target solid-state drives, and the number of physical cores allocated to other solid-state drives in the server except for a group of target solid-state drives. The core binding strategy can be dynamic. Assuming that the total number of solid-state drives in the server is N and the total number of physical cores is M, it is adaptively adjusted according to the ratio of N and M. For example, if N / M is less than 0.5, that is, the number of SSDs is small relative to the number of physical cores, then more physical cores can be allocated to each SSD, such as twice M / N, to fully utilize computing resources and improve the performance of the SSD. Conversely, if N / M is greater than or equal to 0.5, it may be necessary to allocate fewer cores to each SSD to maintain the overall system responsiveness and avoid resource bottlenecks caused by over-allocation.
[0071] In another example, the core allocation policy is adjusted based on the server's current workload type (e.g., I / O-intensive, compute-intensive) and the ratio of the total number of SSDs (N) to the total number of physical cores (M). For example, in I / O-intensive workloads, even with a low N / M ratio, more cores might be allocated to each SSD because the performance requirements are higher. In compute-intensive tasks, the number of cores allocated to the SSD can be appropriately reduced based on the N / M ratio to ensure sufficient computing resources.
[0072] In another example, core binding policies can be designed to intelligently adjust to the workloads faced by servers at different times. For example, during peak daytime hours, when frequent user activity pushes SSDs to a high number of concurrent requests, sufficient cores should be allocated to each SSD based on the N / M ratio to ensure responsiveness. During off-peak nighttime hours, when user activity decreases, the number of cores bound to the SSD can be reduced, freeing up idle resources for background maintenance or energy optimization.
[0073] After determining the core binding strategy, that is, determining the number of physical cores required to be allocated to a single solid-state drive in the server, record and apply this strategy. For each SSD, use the taskset command to set the range of physical cores to which it is bound based on the determined core binding strategy. Monitor the SSD's I / O load and physical core usage in real time, and fine-tune the allocation when necessary to maintain optimal performance.
[0074] Performance testing refers to the process of using testing tools (such as FIO) to measure the read / write speed, latency, and other performance indicators of a server's solid-state drive (SSD) under different CPU binding policies. Test results are used to evaluate and adjust the binding policy to achieve optimal SSD performance. The preset threshold is the standard for measuring whether server storage performance meets the requirements and is typically set based on the specification sheet (SPEC) provided by the SSD manufacturer. If the performance indicator in the test results is lower than or equal to this threshold, it indicates that the current binding policy is not fully utilizing the SSD performance and needs to be adjusted. If the performance test results do not meet the preset threshold, the binding method between the CPU core and the SSD is adjusted. This may include reallocating the number of physical cores, modifying the core-SSD mapping, or adjusting the core's operating frequency, until the performance value in the test results exceeds the preset threshold to ensure optimal SSD performance.
[0075] Through this embodiment, before performance testing, the CPU is set to performance mode and energy-saving mode is disabled, which can ensure that the CPU runs at the highest frequency without being restricted by energy-saving policies, thereby unleashing the maximum performance potential of the hardware and obtaining accurate test results. Through performance testing and result analysis, the server performance bottleneck under the current configuration can be accurately identified. If the performance does not meet the standard, the core binding policy adjustment is triggered to optimize resource allocation in a targeted manner.
[0076] In one exemplary embodiment, when adding a new SSD or replacing the hardware configuration, the random core binding policy lacks dynamic adjustment capabilities, requiring manual resource reallocation. Manually changing CPU core binding relies primarily on experience, is complex and error-prone, has poor scalability, and exponentially increases operation and maintenance costs. Therefore, to address this issue, in this embodiment, before allocating the required number of physical cores to a single SSD according to the core binding policy, and before reallocating the required number of physical cores to a single SSD according to the adjusted core binding policy, the resource allocation method further includes at least one of the following methods:
[0077] Method 1: Use a pre-trained prediction model to dynamically adjust the core binding strategy based on the real-time server load data to obtain the adjusted core binding strategy.
[0078] Method 2: Use a virtual machine to simulate and execute the core binding policy, and dynamically adjust the core binding policy based on the simulation execution results to obtain the adjusted core binding policy.
[0079] Method 3: When the server adopts a heterogeneous hardware architecture, the hardware interface provided by the hardware abstraction layer is used to shield the underlying hardware differences of the server. The core binding policy is dynamically adjusted according to the server hardware configuration to obtain the adjusted core binding policy.
[0080] Method 1, described above, is an intelligent resource allocation solution that leverages a pre-trained machine learning model (prediction model) to dynamically adjust the SSD and CPU core binding strategy based on real-time server workload changes. The prediction model is trained based on collected CPU and SSD performance data under different load conditions. Method 1 predicts the optimal CPU core allocation in real time to maximize SSD performance, reduce resource waste, and improve overall system responsiveness and processing efficiency. Real-time load data, including CPU usage, SSD I / O operation frequency, and memory access patterns, is input into the prediction model, which outputs a predicted core binding strategy. If the predicted core binding strategy matches the current binding strategy above a preset matching threshold, the current binding strategy remains unchanged. Otherwise, the actual system's CPU core allocation is automatically adjusted based on the predicted binding strategy to achieve performance optimization.
[0081] The second method mentioned above involves building a simulation model in a virtualized environment to simulate the system operating status under different core binding strategies, monitor the VM load in real time, and evaluate its impact on SSD performance. Using the VM as a simulation platform, the currently determined core binding strategy can be tested without affecting actual system operation. If the simulated execution results (key performance indicators such as IOPS and latency) under the current core binding strategy do not meet the preset requirements, the current core binding strategy is intelligently adjusted based on the simulation results to best suit the current load. This adjustment is then applied to the actual server to achieve precise optimization of SSD performance. This approach not only improves resource allocation efficiency but also reduces the risk of debugging in a real-world environment.
[0082] Method 3, described above, proposes a mechanism for dynamically adjusting core binding policies for server environments with heterogeneous hardware architectures (e.g., different CPU architectures, new storage media, etc.). This mechanism provides a unified hardware interface through the Hardware Abstraction Layer (HAL), enabling upper-layer software to transparently access and manage underlying hardware resources without having to worry about the specific hardware implementation details. In heterogeneous hardware environments, Method 3 automatically identifies different hardware characteristics, such as ARM-based CPUs versus Intel-based CPUs, and standard SSDs versus Optane SSDs, and intelligently adjusts the binding policy between SSDs and CPU cores based on the server's hardware configuration. Method 3 overcomes the limitations of traditional binding policies when dealing with heterogeneous hardware, improves system compatibility and scalability, and ensures efficient and stable operation across diverse hardware architectures.
[0083] Figure 4 This is a flow chart of another resource allocation method provided by an embodiment of the present application. Figure 4 As shown, at the beginning of resource allocation, the server topology is determined through environmental awareness. This information then identifies the relationship between the SSD and CPU NUMA nodes, obtains CPU topology information, and resolves physical and logical cores. Next, a core binding strategy is determined based on the ratio between the total number of SSDs and the total number of physical cores. This binding strategy prioritizes the allocation of remaining cores. Furthermore, the binding strategy is optimized through three methods: dynamic model tuning, cloud environment adaptation, and heterogeneous hardware tuning. Dynamic model tuning involves loading a machine learning model, predicting the optimal binding strategy, and adjusting it in real time based on the optimal binding strategy. Cloud environment adaptation involves monitoring virtual machine load and dynamically allocating CPU and SSD resources. Heterogeneous hardware tuning adapts to ARM architecture CPUs and new storage media. Furthermore, CPU tuning is configured, including setting the CPU to performance mode and disabling energy-saving mode to force the CPU to run at its highest frequency. Afterwards, final testing and FIO testing are performed, test data is collected, performance metrics are analyzed, and vendor performance standards (such as SPEC) are compared. The test data is then analyzed and the binding strategy is adjusted based on the results.
[0084] For example, configure a server with two CPUs (each with 16 cores) and install four NVMe SSDs. Install the FIO testing tool and configure a test script. Run the command "lspci -vvv" on the server to confirm the NUMA node relationship between the SSDs and the CPU. Run the command "numactl --hardware" on the server to view the NUMA node distribution. Run the command "lscpu" on the server to obtain CPU topology information. Input parameters include: number of SSDs = 4, test task type = random read / write, and number of CPU physical cores = 32. The server determines the core binding strategy based on the ratio between the total number of SSDs and the total number of physical cores, allocating 8 cores to each SSD. Based on real-time load data, the server uses a pre-trained machine learning model (prediction model) to predict the optimal core binding strategy and dynamically adjusts the binding strategy. Alternatively, the server deploys a test platform in a virtualized environment to monitor virtual machine loads in real time and dynamically adjust CPU and SSD resource allocation, i.e., dynamically adjust the core binding strategy. Alternatively, the server deploys a test platform on an ARM architecture server and installs an Optane SSD. The hardware abstraction layer (HAL) masks underlying hardware differences and automatically adjusts the core binding strategy. After adjusting the core binding policy, the server executes the cpupower command, sets the CPU to performance mode, performs a performance test, and analyzes the test results. If the analysis results indicate that the server's performance value is less than or equal to the preset threshold, the core binding policy is adjusted and the required number of physical cores is reallocated to the single solid-state drive according to the core binding policy until the server's performance value exceeds the preset threshold.
[0085] Through this embodiment, by intelligently allocating CPU resources, SSD performance data is significantly improved, and IOPS and latency indicators both reach or exceed the manufacturer's nominal performance; it can also improve resource utilization, and CPU core utilization is increased from 50% of traditional methods to more than 85%, reducing resource waste; it can also standardize and reproducibly provide reproducible test processes, reduce human operation errors, and ensure the consistency of test results; introduce machine learning models to predict the optimal core binding strategy based on historical load data, realize intelligent resource allocation and performance optimization, and reduce operation and maintenance costs; this embodiment not only supports traditional physical machine environments, but also extends to virtualization scenarios and heterogeneous hardware environments, improving the flexibility and scalability of the system.
[0086] In an exemplary embodiment, the server includes a plurality of central processing units (CPUs), wherein the CPUs in the plurality of CPUs and the local memory constitute a memory access node; and the CPUs in the plurality of CPUs include a plurality of physical cores.
[0087] A memory access node is a physical unit consisting of one or more CPUs and directly connected local memory. For example, a memory access node can be a NUMA node. When accessing data, the CPUs within a memory access node prioritize accessing local memory to reduce cross-node communication latency and improve processing efficiency.
[0088] In one embodiment, according to the core binding strategy, the required number of physical cores is reallocated to a single solid-state drive, including:
[0089] Based on the topology of the server, determine the target central processor bound to the single solid-state drive; the topology includes the physical layout and access relationship between the storage device and different physical cores in the server; the single solid-state drive and the target central processor are in the same memory access node; the number of physical cores in the target central processor that are in the same memory access node as the single solid-state drive and are equal to the number of physical cores required to be allocated to the single solid-state drive are allocated to the single solid-state drive.
[0090] The topology of the server has been explained in the above embodiments and will not be repeated here.
[0091] The target central processing unit is a CPU selected as the one bound to a single solid-state drive in the topology of the server to optimize the data reading and writing performance of the SSD. In the related art, when accessing across NUMA nodes, the memory path needs to pass through the interconnection bus, resulting in additional delay. Therefore, in order to solve this problem, in this application, the target central processing unit and the single solid-state drive are in the same memory access node, reducing the cross-node access delay and ensuring the efficiency of data access. It should be noted that each time a physical core is allocated to a single solid-state drive, the same NUMA node allocation method can be used, and it is not limited to the process of reallocating the number of physical cores. The access delay within the same node is much lower than that of cross-node access. The same NUMA node allocation method helps to maintain the high speed of SSD data reading and writing. By ensuring that the SSD and the CPU core that processes its request are in the same node, the data processing efficiency can be significantly improved.
[0092] For example, suppose a server is configured with two physical CPUs (CPU0 and CPU1), each with 16 physical cores, for a total of 32 physical cores. Four SSDs are installed in the server. The first two SSDs (SSD1 and SSD2) are located on the first NUMA node and associated with CPU0, while the second two SSDs (SSD3 and SSD4) are located on the second NUMA node and associated with CPU1. Therefore, for SSD1, the target CPU is CPU0. Assuming each SSD requires eight physical cores, SSD1 is bound to eight consecutive or similarly performing cores in CPU0. Similarly, SSD2 is bound to the remaining eight cores in CPU0, while SSD3 and SSD4 are each bound to eight cores in CPU1. Suppose the server's physical cores are distributed as follows: CPU0 has cores 0 to 15, and CPU1 has cores 16 to 31. Then, SSD1 can be bound to CPU0 cores 0-7, SSD2 to cores 8-15, SSD3 to cores 16-23, and SSD4 to cores 24-31. This allocation ensures that each SSD is bound to a sufficient number of directly connected CPU cores, and that all SSD-CPU bindings are within their respective NUMA nodes, thereby optimizing data access paths, reducing cross-node access latency, and improving storage performance.
[0093] Through this embodiment, setting the SSD and CPU in the same NUMA node can significantly reduce data access latency, improve I / O throughput and the overall performance of the SSD, optimize the data access mode under the NUMA architecture, reduce the overhead of cross-node memory access, and improve data access efficiency.
[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0095] The embodiment of the present application also provides a resource allocation device, such as Figure 5 As shown, including:
[0096] An acquisition module 502 is configured to acquire the total number of solid-state drives of the server and the total number of physical cores of the central processing unit of the server;
[0097] a policy determination module 504 configured to, when a first ratio between the total number of SSDs and the total number of physical cores is non-integer, determine the remainder of the first ratio as the number of remaining cores, select a group of target SSDs from the server that is equal to the number of remaining cores in descending order of priority of the individual SSDs, and determine the number of physical cores to be allocated to the target SSDs in the group of target SSDs;
[0098] The allocation module 506 is configured to allocate the number of physical cores to a group of target solid state drives according to the number of physical cores required to be allocated to the target solid state drives.
[0099] For the description of the features in the embodiment corresponding to the resource allocation device, reference can be made to the relevant description of the embodiment corresponding to the resource allocation method, which will not be repeated here.
[0100] In an exemplary embodiment, the acquisition module 502 is also used to determine the topology of the server; the topology includes the physical layout and access relationship between the storage devices and different physical cores in the server; based on the topology, the total number of solid-state drives of the server and the total number of physical cores of the server's central processing unit are determined.
[0101] In an exemplary embodiment, the policy determination module 504 is also used to determine the integer part of the first ratio as a first basic core number, and determine the number of physical cores equal to the first basic core number as the number of physical cores required to be allocated to the target solid-state drives in a group of target solid-state drives; the first basic core number refers to the number of cores required to be allocated to the target solid-state drives in a group of target solid-state drives.
[0102] In an exemplary embodiment, the policy determination module 504 is also used to determine the first ratio as a second basic core number when the first ratio between the total number of solid-state drives and the total number of physical cores is an integer, and to allocate a number of physical cores equal to the second basic core number to a single solid-state drive in the server; the second basic core number refers to the number of cores required to be allocated to a single solid-state drive.
[0103] In an exemplary embodiment, the policy determination module 504 is also used to allocate the number of physical cores to other solid-state drives in the server except for a group of target solid-state drives based on the number of other physical cores in the total number of physical cores except for the physical cores allocated to a group of target solid-state drives.
[0104] In an exemplary embodiment, the policy determination module 504 is also used to round up the second ratio between the number of other physical cores and the number of other solid-state drives in the server except for a group of target solid-state drives, and determine the resulting integer as the third basic core number; allocate a number of physical cores equal to the third basic core number to other solid-state drives; the third basic core number refers to the number of physical cores required to be allocated to other solid-state drives.
[0105] In an exemplary embodiment, the working module of the central processing unit includes a performance mode and an energy-saving mode; the performance mode refers to the mode in which the central processing unit runs at the highest frequency; the energy-saving mode refers to the mode in which the central processing unit dynamically adjusts the frequency according to the load; the allocation module 506 is also used to set the central processing unit to be in performance mode and disable the energy-saving mode; perform performance testing on the server after setting, and analyze the test results, and adjust the core binding strategy when the analysis results indicate that the performance value of the server is less than or equal to the preset threshold; the core binding strategy refers to the number of physical cores required to be allocated to the single solid-state hard drive in the server; according to the adjusted core binding strategy, the required number of physical cores is reallocated to the single solid-state hard drive until the performance value of the server is greater than the preset threshold.
[0106] In an exemplary embodiment, a server includes multiple central processing units (CPUs), wherein the CPUs in the multiple CPUs and the local memory constitute a memory access node; the CPUs in the multiple CPUs include multiple physical cores; the allocation module 506 is further used to determine the target CPU bound to the single solid-state drive based on the topology of the server; the topology includes the physical layout and access relationship between the storage device and different physical cores in the server; the single solid-state drive and the target CPU are in the same memory access node; the number of physical cores in the target CPU that are in the same memory access node as the single solid-state drive and are equal to the number of physical cores required to be allocated to the single solid-state drive are allocated to the single solid-state drive.
[0107] In an exemplary embodiment, before reallocating the required number of physical cores to a single solid-state drive according to the adjusted core binding policy, the policy determination module 504 is further configured to perform at least one of the following methods:
[0108] Using a pre-trained prediction model, the core binding strategy is dynamically adjusted based on the server's real-time load data to obtain the adjusted core binding strategy.
[0109] The core binding strategy is simulated and executed through a virtual machine. Based on the simulation execution results, the core binding strategy is dynamically adjusted to obtain the adjusted core binding strategy.
[0110] When the server adopts a heterogeneous hardware architecture, the hardware interface provided by the hardware abstraction layer is used to shield the underlying hardware differences of the server, and the core binding strategy is dynamically adjusted according to the hardware configuration of the server to obtain the adjusted core binding strategy.
[0111] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above resource allocation method embodiments.
[0112] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned resource allocation method embodiments when running.
[0113] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0114] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above-mentioned resource allocation method embodiments are implemented.
[0115] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned resource allocation method embodiments are implemented.
[0116] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0117] The above is a detailed introduction to a resource allocation method, device, electronic device and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A resource allocation method, characterized in that: include: Obtaining the total number of solid-state drives of a server and the total number of physical cores of a central processing unit of the server; wherein individual solid-state drives in the total number of solid-state drives have different priorities; When a first ratio between the total number of solid-state drives and the total number of physical cores is a non-integer, determining a remainder of the first ratio as the number of remaining cores, selecting a group of target solid-state drives equal to the number of remaining cores from the server in descending order of priority of the individual solid-state drives; and determining the number of physical cores to be allocated to the target solid-state drives in the group of target solid-state drives; The number of physical cores allocated to the group of target solid-state drives is determined based on the number of physical cores required to be allocated to the target solid-state drives.
2. The resource allocation method according to claim 1, characterized in that: The obtaining of the total number of solid-state hard disks of the server and the total number of physical cores of the central processing unit of the server includes: Determining a topology of the server; the topology including a physical layout and access relationship between storage devices and different physical cores in the server; The total number of solid-state hard disks of the server and the total number of physical cores of the central processing unit of the server are determined according to the topology structure.
3. The resource allocation method according to claim 1, wherein: The determining the number of physical cores required to be allocated to the target solid-state hard disks in the group of target solid-state hard disks includes: The integer part of the first ratio is determined as the first basic core number, and the number of physical cores equal to the first basic core number is determined as the number of physical cores required to be allocated to the target solid-state drives in the group of target solid-state drives; the first basic core number refers to the number of cores required to be allocated to the target solid-state drives in the group of target solid-state drives.
4. The resource allocation method according to claim 1, wherein: The method further comprises: When the first ratio between the total number of solid-state drives and the total number of physical cores is an integer, the first ratio is determined as a second basic core number, and a number of physical cores equal to the second basic core number is allocated to the single solid-state drive in the server; the second basic core number refers to the number of cores required to be allocated to the single solid-state drive.
5. The resource allocation method according to claim 1, characterized in that: After allocating the number of physical cores to the group of target solid-state drives according to the number of physical cores required to be allocated to the target solid-state drives, the method further includes: The number of physical cores allocated to the solid-state drives in the server except the group of target solid-state drives is determined based on the number of physical cores in the total number of physical cores except the physical cores allocated to the group of target solid-state drives.
6. The resource allocation method according to claim 5, characterized in that: The number of physical cores allocated to solid-state drives other than the group of target solid-state drives in the server according to the number of physical cores other than the physical cores allocated to the group of target solid-state drives in the total number of physical cores includes: The second ratio between the number of other physical cores and the number of other solid-state drives in the server except the group of target solid-state drives is rounded up, and the resulting integer is determined as the third basic core number; the number of physical cores equal to the third basic core number is allocated to the other solid-state drives; the third basic core number refers to the number of physical cores required to be allocated to the other solid-state drives.
7. The resource allocation method according to claim 5, characterized in that: The working module of the central processing unit includes a performance mode and an energy-saving mode; the performance mode refers to a mode in which the central processing unit operates at a maximum frequency; the energy-saving mode refers to a mode in which the central processing unit dynamically adjusts its frequency according to load; the method further includes: Setting the central processing unit to the performance mode and disabling the energy saving mode; Performing a performance test on the server after being set up and analyzing the test results. If the analysis results indicate that the performance value of the server is less than or equal to a preset threshold, adjusting the core binding policy; the core binding policy refers to the number of physical cores required to be allocated to the single solid-state drive in the server; According to the adjusted core binding strategy, the required number of physical cores is reallocated to the single solid-state drive until the performance value of the server is greater than the preset threshold.
8. The resource allocation method according to claim 7, characterized in that: The server includes a plurality of central processing units, wherein a central processing unit among the plurality of central processing units and a local memory form a memory access node; the central processing unit among the plurality of central processing units includes a plurality of physical cores; and re-allocating the required number of physical cores to the single solid-state drive according to the adjusted core binding strategy includes: Determining a target central processing unit bound to the single solid-state drive according to a topological structure of the server; the topological structure includes a physical layout and access relationship between storage devices and different physical cores in the server; the single solid-state drive and the target central processing unit are located in the same memory access node; Allocate to the single solid-state drive a number of physical cores in the target central processor that are in the same memory access node as the single solid-state drive and are equal to the number of physical cores required to be allocated to the single solid-state drive.
9. The resource allocation method according to claim 7, characterized in that: Before reallocating the required number of physical cores to the single solid-state drive according to the adjusted core binding strategy, the method further includes at least one of the following methods: Dynamically adjusting the core binding strategy based on the real-time load data of the server using a pre-trained prediction model to obtain the adjusted core binding strategy; simulating and executing the core binding strategy through a virtual machine, and dynamically adjusting the core binding strategy according to the simulation execution result to obtain the adjusted core binding strategy; In the case where the server adopts a heterogeneous hardware architecture, the hardware interface provided by the hardware abstraction layer is used to shield the underlying hardware differences of the server, and the core binding strategy is dynamically adjusted according to the hardware configuration of the server to obtain the adjusted core binding strategy.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the resource allocation method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Hard disk access method and device, storage medium and electronic device
CN114443300A
Hard disk performance test method and device, equipment and storage medium
CN115202944A
Storage device management method and device, storage medium and electronic device
CN115858221A
Method for determining core binding parameters and computing equipment
CN116974749A
Hard disk test method, device and equipment and readable storage medium
CN119724304A
Cited By
Disk dropping method and device for network flow data packet, and medium
CN121934789A