Cache deployment method and device, equipment, storage medium and program product
By obtaining and parsing the hardware topology information of the hybrid flash storage server, grouping and partitioning cache disks to improve cache deployment efficiency and stability, it solves the problem of low efficiency and stability in the hybrid flash storage server deployment environment in the existing technology, and improves Storage performance.
Patent Information
- Application Number
- CN202410939421.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-07-12
Smart Images

Figure CN118567572A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a cache deployment method, apparatus, device, storage medium and program product. Background Art
[0002] At present, hybrid flash storage servers are usually used in some application scenarios that require high-performance data access while maintaining a large storage capacity. This server uses a storage architecture that combines solid-state drives and mechanical hard drives. It aims to combine the advantages of both to improve the overall performance and cost-effectiveness of the storage system. Among them, solid-state drives are usually used to accelerate cache for mechanical hard drives.
[0003] In order to deploy the accelerated cache of the hybrid flash storage server, each partition of the solid-state drive is usually configured as the cache of the mechanical hard disk in sequence according to the drive letter number reported by the solid-state drive and the partition number corresponding to each drive letter and the drive letter number reported by the mechanical hard disk.
[0004] However, the existing cache deployment method has low deployment efficiency and stability in a complex deployment environment with various types of hybrid flash storage servers, thereby reducing the storage performance of the storage server. Summary of the invention
[0005] Embodiments of the present application provide a cache deployment method, apparatus, device, storage medium, and program product for a storage cluster, to solve the problems of low efficiency and stability of existing cache deployment.
[0006] In a first aspect, the present application provides a cache deployment method, applied to a hybrid flash storage server, the method comprising:
[0007] Obtaining hardware topology information of a target hybrid flash storage server, where the hardware topology information is used to indicate a physical topological relationship between multiple CPUs, cache disks, and data disks of the server;
[0008] Parsing the hardware topology information to obtain a cache disk and a data disk connected to a CPU bus of each CPU;
[0009] The cache disk and the data disk are grouped according to the corresponding CPU bus to obtain a plurality of disk groups, and there is a corresponding relationship between the disk groups and the CPU;
[0010] For each disk group, multiple sub-cache areas in the disk group are configured as caches of the data disk in turn, and the sub-cache areas are obtained by partitioning the cache disk based on the number of the cache disks and data disks.
[0011] In a possible implementation manner, before obtaining the hardware topology information of the target hybrid flash storage server, the method further includes:
[0012] Obtaining configuration information of the target hybrid flash storage server, the configuration information including: the number and capacity of cache disks, and the number of data disks;
[0013] Obtaining a target partition number of the cache disk according to the number of the cache disks and the number of the data disks;
[0014] According to the target number of partitions, the capacity of each cache disk is partitioned in turn to obtain a plurality of sub-cache areas corresponding to each cache disk, wherein the capacities of the sub-cache areas of the same cache disk are equal.
[0015] In a possible implementation manner, obtaining the target partition number of the cache disk according to the number of the cache disks and the number of the data disks includes:
[0016] If the number of cache disks is M, the number of data disks is N;
[0017] When M is divisible by N, the target partition number of the cache disk is determined to be N / M;
[0018] When M does not divide N evenly, the target partition number of the cache disk is determined to be N / M+1.
[0019] In a possible implementation manner, the cache disk and the data disk are grouped according to the corresponding CPU bus to obtain multiple disk groups, including:
[0020] Obtain drive letters of the multiple data disks, drive letters of the multiple cache disks, and partition numbers of the sub-cache areas corresponding to each cache disk;
[0021] According to the positions of the multiple cache disks on the CPU bus, the drive letters of the multiple cache disks and the partition numbers of the sub-cache areas corresponding to each cache disk are sorted to obtain a cache disk list corresponding to each CPU;
[0022] According to the positions of the multiple data disks on the CPU bus, the drive letters of the multiple data disks are sorted to obtain a data disk list corresponding to each CPU;
[0023] Based on the cache disk list and the data disk list corresponding to each CPU, multiple disk groups are determined.
[0024] In a possible implementation, for each disk group, sequentially configuring multiple sub-cache areas in the disk group as caches of the data disk includes:
[0025] Traverse the data disk list corresponding to each disk group, and establish the association relationship between the drive letter of each data disk and the partition number of the target sub-cache area in the cache disk list corresponding to the disk group, wherein the target sub-cache area selected each time is a sub-cache area in a different cache disk.
[0026] In a possible implementation manner, sequentially establishing an association relationship between the drive letter of each data disk and the partition number of the target sub-cache area in the cache disk list corresponding to the disk group includes:
[0027] Traversing the cache disk list corresponding to the disk group, and determining the target cache disk and the target sub-cache area corresponding to the target cache disk in sequence;
[0028] An association relationship between the drive letter of each data disk and the partition number of the target sub-cache area is established in sequence.
[0029] In a possible implementation, the method further includes:
[0030] When M does not divide N evenly and the remainder of N / M is L, after the caches of N / M data disks are deployed in sequence, the sub-cache areas corresponding to different cache disks in the disk group are used in sequence as caches for L data disks.
[0031] In a second aspect, the present application provides a cache deployment device, including:
[0032] An acquisition module, used to acquire hardware topology information of a target hybrid flash storage server, wherein the hardware topology information is used to indicate a physical topological relationship between multiple CPUs, cache disks, and data disks of the server;
[0033] A processing module, used for parsing the hardware topology information to obtain a cache disk and a data disk connected to a CPU bus of each CPU;
[0034] The processing module is further used to group the cache disk and the data disk according to the corresponding CPU bus to obtain multiple disk groups, and there is a corresponding relationship between the disk groups and the CPU;
[0035] The processing module is also used to configure multiple sub-cache areas in the disk group as cache of the data disk in turn for each disk group, and the sub-cache areas are obtained by partitioning the cache disk based on the number of the cache disks and data disks.
[0036] Optionally, the acquisition module is further used to acquire configuration information of the target hybrid flash storage server, the configuration information including: the number and capacity of cache disks, and the number of data disks;
[0037] The processing module is further used to obtain the target partition number of the cache disk according to the number of the cache disks and the number of the data disks;
[0038] The processing module is further used to partition the capacity of each cache disk in turn according to the target number of partitions to obtain multiple sub-cache areas corresponding to each cache disk, wherein the capacities of the sub-cache areas of the same cache disk are equal.
[0039] Optionally, the processing module is specifically used when the number of cache disks is M and the number of data disks is N;
[0040] When M is divisible by N, the target partition number of the cache disk is determined to be N / M;
[0041] When M does not divide N evenly, the target partition number of the cache disk is determined to be N / M+1.
[0042] Optionally, the acquisition module is further used to acquire the drive letters of the multiple data disks, the drive letters of the multiple cache disks, and the partition number of the sub-cache area corresponding to each cache disk;
[0043] The processing module is further used to sort the drive letters of the multiple cache disks and the partition numbers of the sub-cache areas corresponding to each cache disk according to the positions of the multiple cache disks on the CPU bus to obtain a cache disk list corresponding to each CPU;
[0044] The processing module is further used to sort the drive letters of the multiple data disks according to the positions of the multiple data disks on the CPU bus to obtain a data disk list corresponding to each CPU;
[0045] The processing module is further used to determine multiple disk groups based on the cache disk list and the data disk list corresponding to each CPU.
[0046] Optionally, the processing module is also used to traverse the data disk list corresponding to each disk group, and establish in turn the association relationship between the drive letter of each data disk and the partition number of the target sub-cache area in the cache disk list corresponding to the disk group, wherein the target sub-cache area selected each time is a sub-cache area in a different cache disk.
[0047] Optionally, the processing module is further used to traverse the cache disk list corresponding to the disk group, and sequentially determine the target cache disk and the target sub-cache area corresponding to the target cache disk;
[0048] The processing module is further used to sequentially establish an association relationship between the drive letter of each data disk and the partition number of the target sub-cache area.
[0049] Optionally, the processing module is also used to, when M does not satisfy the integer division of N and the remainder of N / M is L, after the cache of N / M data disks is deployed in sequence, use the sub-cache areas corresponding to different cache disks in the disk group as cache for L data disks in sequence.
[0050] In a third aspect, an embodiment of the present application provides a cache deployment device, including: a memory, a processor;
[0051] The memory stores computer-executable instructions;
[0052] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the cache deployment method described in the first aspect and / or various possible implementations of the first aspect.
[0053] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the cache deployment method described in the first aspect and / or various possible implementation methods of the first aspect.
[0054] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the cache deployment method described in the first aspect and / or various possible implementations of the first aspect.
[0055] The cache deployment method, apparatus, device, storage medium and program product provided in the embodiments of the present application obtain hardware topology information of a target hybrid flash storage server, wherein the hardware topology information is used to indicate the physical topological relationship between multiple CPUs, cache disks and data disks of the server, parse the hardware topology information to obtain cache disks and data disks connected to the CPU bus of each CPU, group the cache disks and data disks according to the corresponding CPU buses to obtain multiple disk groups, and for each disk group, sequentially configure multiple sub-cache areas within the disk group as caches for the data disk; the method improves the efficiency and stability of cache deployment, thereby reducing the impact of hardware configuration on the storage performance of the hybrid flash storage server. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0057] Figure 1 Schematic diagram of the cache deployment method provided for this application Figure 1 ;
[0058] Figure 2Schematic diagram of the cache deployment method provided for this application Figure 2 ;
[0059] Figure 3 A schematic diagram of the hardware topology of the hybrid flash storage server provided for this application;
[0060] Figure 4 A schematic diagram of partitioning of a cache disk provided in an embodiment of the present application;
[0061] Figure 5 A schematic diagram of the structure of the cache deployment device provided in this application;
[0062] Figure 6 A schematic diagram of the structure of the cache deployment device provided for this application.
[0063] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0065] The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein.
[0066] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0067] First, the terms involved in this application are explained.
[0068] NVMe SSD (Non-Volatile Memory Express Solid State Drive): is a high-performance solid-state drive that uses the NVMe protocol and communicates with the computer system through the PCI-E (Peripheral Component Interconnect Express) interface, achieving extremely high data transfer rates and lower access latency. It is characterized by good read and write performance but small storage capacity.
[0069] HDD (Hard Disk Drive): is a traditional data storage device that uses magnetic storage technology. It is characterized by poor read and write performance but large storage capacity.
[0070] Hybrid flash storage server: a storage system that uses a combination of NVMe SSD disks and HDD disks. In such a system, NVMe SSD disks are used to accelerate the cache of HDD disks. This is because NVMe SSD can provide fast data access speeds and is usually used as the front-end disk of the cache layer; while HDD is the place where data is persistently stored, that is, the back-end disk where data is ultimately stored.
[0071] Accelerated caching: refers to configuring a block device as a cache for another block device to improve the read and write performance of the storage device. For example, a hybrid flash storage server has 2 NVMe disks and 12 HDD disks. Each NVMe disk is divided into 6 partitions, for a total of 12 partitions, and each of the 12 HDD disks can be used as accelerated cache.
[0072] Storage cluster: refers to deploying a distributed storage system on multiple storage servers of the same type to form a storage cluster and provide storage services to the outside world.
[0073] Hybrid Flash storage cluster: a storage cluster consisting of multiple hybrid flash storage servers.
[0074] In order to deploy a hybrid flash storage cluster, for each storage node in the cluster, each partition of the solid-state drive is usually configured as an accelerated cache for the mechanical hard disk in sequence according to the serial number of the drive letter reported by the NVMe disk, the partition serial number corresponding to each drive letter, and the serial number of the drive letter reported by the HDD disk.
[0075] For example, a hybrid flash storage server has two NVMe SSD disks and six HDD disks. The drive letters of the NVMe SSD disks and the partitions of each NVMe disk are as follows:
[0076] The drive letter of the first NVMe SSD is: nvme0n1;
[0077] The three partitions of nvme0n1 are: nvme0n1p1, nvme0n1p2, nvme0n1p3;
[0078] The drive letter of the second NVMe SSD is: nvme1n1;
[0079] The three partitions of nvme1n1 are: nvme1n1p1, nvme1n1p2, nvme1n1p3;
[0080] The drive letters of each HDD disk are: sdb, sdc, sdd, sde, sdf, sdg.
[0081] The existing deployment method is to configure an NVMe disk partition for each HDD disk according to the drive letter of each HDD disk, so that it can be used as an accelerated cache for the HDD disk, for example:
[0082] nvme0n1p1-sdb (nvme0n1p1 is used as the acceleration cache of sdb);
[0083] nvme0n1p2-sdc (nvme0n1p2 is used as the acceleration cache of sdc);
[0084] nvme0n1p3-sdd (nvme0n1p3 is used as the acceleration cache of sdd);
[0085] nvme1n1p1-sde (nvme1n1p1 is used as the acceleration cache of sde);
[0086] nvme1n1p2-sdf (nvme1n1p2 is used as an acceleration cache for sdf);
[0087] nvme1n1p3-sdg (nvme1n1p3 is used as acceleration cache for sdg).
[0088] However, in a complex deployment environment where hybrid flash storage servers have various types, for example, the ratio of NVMe disks and HDD disks in hybrid flash storage servers is not fixed and the hardware configuration is complex, the deployment efficiency and stability of the above deployment method are low, resulting in reduced storage performance of the storage cluster.
[0089] In response to the above problems, an embodiment of the present application provides a cache deployment method, which determines the number of partitions of the cache disk based on the number of data disks and cache disks of the hybrid flash storage server, and divides each cache disk into multiple partitions of the same number based on the number of partitions to evenly divide the capacity of the cache disk, and then obtains the hardware topology information of the hybrid flash storage server to obtain the data disks and cache disks on each CPU bus of the server, and groups these cache disks and data disks according to the CPUs to which they are located to obtain multiple groups of disk groups, and for each group of disk groups, selects the partitions corresponding to each cache disk of the same group in turn to accelerate caching for the data disks in the same group; this method improves the stability and efficiency of cache deployment of the hybrid flash storage server in a complex deployment environment, thereby reducing the impact of hardware configuration on the storage performance of the hybrid flash storage server.
[0090] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0091] Figure 1 Schematic diagram of the cache deployment method provided in the embodiment of the present application Figure 1 The execution subject of this embodiment is, for example, a cache deployment device. Figure 1 As shown, the cache deployment method provided in this embodiment includes:
[0092] S101. Obtain hardware topology information of a target hybrid flash storage server, where the hardware topology information is used to indicate a physical topological relationship between multiple CPUs, cache disks, and data disks of the server.
[0093] Among them, the cache disk refers to a storage medium that can respond to external data requests and provide high-speed read and write services. The data disk refers to a storage medium inside the target hybrid flash storage server that can store data for a long time. The data disk has a large capacity, but the read and write speed is lower than that of the cache disk. The cache disk and data disk can be, for example, NVMe SSD and HDD, NVMe SSD and SATA SSD, SATA SSD and HDD, etc.
[0094] It is understandable that in order to handle a large number of concurrent read and write requests, the target hybrid flash storage server is usually configured with multiple CPUs so that multiple CPUs can execute multiple threads simultaneously, reducing latency and improving data processing capabilities. The physical topology information is used to describe the physical connection method and storage architecture between the server's multiple CPUs, cache disks, and data disks. This information reveals how the cache disks and data disks are interconnected through corresponding CPU buses, interfaces, etc.
[0095] S102: Analyze the hardware topology information to obtain a cache disk and a data disk connected to a CPU bus of each CPU.
[0096] By analyzing and processing the hardware topology information of multiple CPUs, cache disks, and data disks, the CPU bus where each cache disk and each data disk are located and the specific position on the CPU bus can be obtained.
[0097] It can be understood that different cache disks and data disks are connected to the corresponding CPU bus through different interfaces, and thus communicate with the corresponding CPU through the CPU bus to form a data transmission system in the target hybrid flash storage server.
[0098] The purpose of this step is to analyze the hardware topology information to identify the cache disks and data disks on each CPU bus.
[0099] S103: Group the cache disks and data disks according to corresponding CPU buses to obtain multiple disk groups.
[0100] Among them, each cache disk and each data disk are grouped according to the CPU bus where they are located, so multiple disk groups can be obtained. Therefore, there is a corresponding relationship between the disk groups and the CPUs.
[0101] This is done to select the optimal cache deployment method corresponding to the hardware configuration according to the hardware topology of the target hybrid flash storage server. It is not only applicable to hybrid flash storage servers of various models, but also reduces the negative impact of communication between cores of different CPUs and memory consistency on storage performance such as read and write speed when the hybrid flash storage server is a multi-core CPU type.
[0102] S104. For each disk group, sequentially configure multiple sub-cache areas in the disk group as caches of the data disk.
[0103] Among them, the sub-cache area is obtained by partitioning the cache disk based on the number of the cache disk and the data disk. For example, in order to save cache deployment time, multiple partitions can be created on each cache disk before obtaining the hardware topology information of the target hybrid flash storage server, and the sum of the number of sub-cache areas of all cache disks is greater than or equal to the total number of data disks to ensure that each data disk can be configured with a sub-cache area.
[0104] It can be understood that after obtaining multiple disk groups, cache configuration is performed for each disk group in turn, and during configuration, the sub-cache areas of the cache disks of the same group are allocated one by one to a data disk in the same group for accelerated cache, until each data disk in the disk group is configured with a sub-cache area. That is, each sub-cache area is used for accelerated cache for a data disk on the same CPU bus.
[0105] In this step, by deploying cache within a group based on multiple disk groups divided by CPU, the deployment efficiency and stability can be effectively improved, thereby improving the read and write performance of the entire storage system.
[0106] The cache deployment method provided in the embodiment of the present application obtains the hardware topology information of the target hybrid flash storage server, wherein the hardware topology information is used to indicate the physical topological relationship between multiple CPUs, cache disks and data disks of the server, parses the hardware topology information to obtain the cache disk and data disk connected to the CPU bus of each CPU, groups the cache disk and data disk according to the corresponding CPU bus to obtain multiple disk groups, and for each disk group, sequentially configures multiple sub-cache areas in the disk group as caches of the data disk; the method improves the efficiency and stability of cache deployment, thereby reducing the impact of hardware configuration on the storage performance of the hybrid flash storage server.
[0107] Figure 2 Schematic diagram of the cache deployment method provided for this application Figure 2 ,like Figure 2 As shown, in this embodiment Figure 1 Based on the embodiment, the cache deployment method is described in detail. The cache deployment method provided in this embodiment includes:
[0108] S201. Obtain configuration information of a target hybrid flash storage server, where the configuration information includes: the number and capacity of cache disks, and the number of data disks.
[0109] Among them, the configuration of the hybrid flash storage server can be, for example, several to a dozen cache disks as front-end cache, and the number of data disks may reach dozens or even hundreds to ensure sufficient storage capacity. Such a design balances cost and performance, ensuring that the system can not only quickly respond to access to hot data, but also store large amounts of data economically and efficiently. The capacity of the cache disk can be, for example, 128GB, 256GB, 512GB, 1TB, etc. The specific ratio of the number of cache disks to data disks is determined according to actual storage requirements, and this application does not impose any special restrictions.
[0110] S202: Obtain a target partition number of the cache disk according to the number of the cache disks and the number of the data disks.
[0111] The target partition number refers to the number of partitions of each cache disk.
[0112] Exemplarily, if the number of cache disks is M, the number of data disks is N;
[0113] When M is divisible by N, the target partition number of the cache disk is determined to be N / M;
[0114] When M does not divide N evenly, the target partition number of the cache disk is determined to be N / M+1.
[0115] For example, if the number of cache disks of the target hybrid flash storage server is 2 and the number of data disks is 8, then 2 can divide 8 evenly, so the target number of partitions of the cache disk is determined to be 4; if the number of cache disks of the target hybrid flash storage server is 8 and the number of data disks is 60, then 8 cannot divide 60 evenly, and the quotient of 60 divided by 8 is 7, and the remainder is equal to 4, so the target number of partitions of the cache disk can be determined to be 8.
[0116] S203. Partition the capacity of each cache disk in turn according to the target number of partitions to obtain a plurality of sub-cache areas corresponding to each cache disk.
[0117] The capacities of the various sub-cache areas of the same cache disk are equal.
[0118] For example, when the number of cache disks of the target mixed flash storage server is 2, the capacity is 128G, the number of data disks is 8, and the number of target partitions is 4, the two cache disks are evenly divided into 4 sub-cache areas, now a total of 8 sub-cache areas are obtained, and the size of each sub-cache area is 32G; when the number of cache disks of the target mixed flash storage server is 8, the capacity is 128G, the number of data disks is 60, and the number of target partitions is 8, each of the 8 cache disks is evenly divided into 8 sub-cache areas, and the 512G capacity of the cache disk is evenly divided, now a total of 64 sub-cache areas are obtained, and the size of each sub-cache area is 64G.
[0119] The purpose of this step is to partition all cache disks of the target hybrid flash storage server before deploying the cache, and ensure that the total number of all sub-cache areas of the cache disk is greater than or equal to the total number of data disks, so as to avoid subsequent cache deployment interruption due to partition calculation errors, especially in complex implementation scenarios such as hybrid flash storage cluster deployment and heterogeneous server deployment, which can effectively improve deployment efficiency and stability.
[0120] S204: Obtain hardware topology information of a target hybrid flash storage server, where the hardware topology information is used to indicate a physical topological relationship between multiple CPUs, cache disks, and data disks of the server.
[0121] Step S204 is similar to the above step S101 and will not be described again.
[0122] S205: Analyze the hardware topology information to obtain a cache disk and a data disk connected to a CPU bus of each CPU.
[0123] Step S205 is similar to the above step S102 and will not be described again.
[0124] S206. Obtain drive letters of the multiple data disks, drive letters of the multiple cache disks, and a partition number of a sub-cache area corresponding to each cache disk.
[0125] The drive letters of the data disk and the cache disk refer to the identification information corresponding to the disk. The drive letters and partition numbers are unique. The drive letters of the cache disk and the data disk obtained in this step are out of order.
[0126] Figure 3 A schematic diagram of the hardware topology of the hybrid flash storage server provided in the embodiment of the present application, Figure 4 A schematic diagram of the partitioning of the cache disk provided in the embodiment of the present application is shown in FIG. Figure 3 As shown in the figure, there are two hardware topology diagrams corresponding to CPUs, 8 cache disks, and 60 data disks. The cache disks and data disks are connected to different CPU buses through their own interfaces. The drive letters of the multiple data disks are: sdk, sde, sdad, sdh, sdbj, sdaw, etc., and the drive letters of the multiple cache disks are: nvme0n1, nvme1n1, nvme2n1, nvme3n1, etc.
[0127] Please continue reading Figure 4 ,like Figure 4 As shown, the nvme0n1, nvme1n1, nvme2n1, and nvme3n1 disks are evenly divided into 8 sub-cache areas, and the partition numbers of the nvme0n1 disk are nvme1n1p1, nvme1n1p2, nvme1n1p3, nvme1n1p4, nvme1n1p5, nvme1n1p6, nvme1n1p7, and nvme1n1p8, respectively.
[0128] S207. Sort the drive letters of the multiple cache disks and the partition numbers of the sub-cache areas corresponding to each cache disk according to the positions of the multiple cache disks on the CPU bus to obtain a cache disk list corresponding to each CPU.
[0129] For example, Figure 3 and Figure 4As shown, according to the CPU bus to which each cache disk is connected and its position on the CPU bus, all cache disks and corresponding partition numbers are sorted, and the cache disk lists corresponding to CPU0 and CPU1 are obtained as follows:
[0130] CPU0: nvme0n1, nvme1n1, nvme2n1, nvme3n1.
[0131] Among them, the partition numbers of nvme0n1 are sorted as (nvme0n1p1, nvme0n1p2, nvme0n1p3, nvme0n1p4, nvme0n1p5, nvme0n1p6, nvme0n1p7, nvme0n1p8). Other cache disks are similar and will not be repeated here.
[0132] CPU1: nvme4n1, nvme5n1, nvme6n1, nvme7n1.
[0133] S208. Sort the drive letters of the multiple data disks according to the positions of the multiple data disks on the CPU bus to obtain a data disk list corresponding to each CPU.
[0134] For example, Figure 3 As shown in the figure, when the target hybrid flash storage server has 2 CPUs, the data disk list corresponding to each CPU is as follows:
[0135] CPU0: sdk, sde, sdad, sdaz, sdt, sdar, sdn, sdg, sdc, sdag, sdbb, sdw, sdav, sdp, sdak, sdz, sdaq, sdo, sdj, sdd, sdal, sdbg, sdac, sdau, sdr, sdan, sdm, sdf, sdah, sdax
[0136] CPU1: sdh, sdbj, sdaw, sdbf, sdaj, sdba, sdab, sdv, sdl, sdbi, sdas, sdbd, sdaf, sdy, sd s, sdx, sdq, sdbe, sdao, sday, sdai, sdaa, sdu, sdi, sdbh, sdap, sdbc, sdam, sdat, sdae.
[0137] S209: Determine multiple disk groups based on the cache disk list and the data disk list corresponding to each CPU.
[0138] For example, the data disk list and cache disk list of CPU0 may form a Cpu0-disk group, and the data disk list and cache disk list of CPU1 may form a Cpu1-disk group.
[0139] The purpose of this step is to create a cache corresponding to each data disk in sequence when the cache is deployed later, thereby improving the efficiency and stability of cache deployment.
[0140] S210. Traverse the data disk list corresponding to each disk group, and sequentially establish an association relationship between the drive letter of each data disk and the partition number of the target sub-cache area in the cache disk list corresponding to the disk group.
[0141] The target sub-cache area selected each time is a sub-cache area in a different cache disk.
[0142] For example, the cache disk list corresponding to the disk group can be traversed to determine the target cache disk and the target sub-cache area corresponding to the target cache disk in turn, and the association relationship between the drive letter of each data disk and the partition number of the target sub-cache area can be established in turn.
[0143] like Figure 3 As shown, the steps for cache deployment for the CPU0 disk group are to select a sub-cache area from the four cache disks nvme0n1, nvme1n1, nvme2n1, and nvme3n1 in order each time as the target sub-cache area, and establish an association relationship between the sub-cache area and a data disk in the data disk list.
[0144] According to the data disk list of CPU0 disk group, establish the association relationship between data disk sdk and the first sub-cache area nvme0n1p1 in cache disk nvme0n1, the association relationship between data disk sde and the first sub-cache area nvme1n1p1 in cache disk nvme1n1, the association relationship between data disk sdad and the first sub-cache area nvme2n1p1 in cache disk nvme2n1, and the association relationship between data disk sdaz and the first sub-cache area nvme3n1p1 in cache disk nvme3n1. After the first sub-cache areas of these four cache disks are allocated, it is the turn of the second sub-cache area nvme0n1p2 of cache disk nvme0n1, and nvme0n1p2 is configured as the cache area of data disk sdt, and so on.
[0145] Optionally, if the number of cache disks is M and the number of data disks is N, when M is not divisible by N and the remainder of N / M is L, after the cache of N / M data disks is deployed in sequence, the sub-cache areas corresponding to different cache disks in the disk group are used in sequence as the cache of L data disks.
[0146] This is because the ratio of cache disks to data disks may or may not be an integer multiple. If the number of cache disks can exactly divide the data disks, for example, there are 2 cache disks and 8 data disks, then each cache disk is partitioned into 4 sub-cache areas, a total of 8 sub-cache areas, and the association relationship between the 8 data disks and the 8 sub-cache areas is established in sequence. However, if the cache disk cannot divide the data disk and there is a remainder, after deploying the full number aligned acceleration cache, the remaining data disks use partitions of different cache disks on the same CPU bus as their acceleration cache.
[0147] The benefit of doing this is that it can balance the cache services of each cache disk, avoiding storage performance bottlenecks caused by excessive pressure on the disk, thereby improving the read and write stability of the cache disk.
[0148] Please continue reading Figure 4 , the CPU0 disk group has a total of 30 data disks and 4 cache disks. The remainder of dividing the data disk by the cache disk is 2. Different sub-cache areas of the 4 cache disks are used in sequence to deploy accelerated cache for the 30 data disks. The sub-cache areas used are: nvme0n1p1, nvme1n1p1, nvme2n1p1, nvme3n1p1, nvme0n1p2...nvme3n1p7. So far, 28 data disks in the integer part have been deployed, and there are 2 data disks left to be deployed. At this time, the sub-cache areas nvme0n1p8 and nvme1n1p8 of different cache disks on the CPU0 disk are used as cache for the remaining 2 data disks.
[0149] The cache deployment method provided in the embodiment of the present application determines the target partition number of the cache disk according to the number of cache disks and the number of data disks, and partitions each cache disk based on the target partition number to obtain multiple sub-cache areas, obtains the data disk and cache disk on each CPU bus according to the hardware topology information of the target hybrid flash storage server, and groups the data disks and cache disks on each CPU bus according to the drive letters of the multiple data disks, the drive letters of the multiple cache disks, and the partition numbers of the sub-cache areas corresponding to each cache disk to obtain the disk groups corresponding to the CPU, and for each disk group, establishes the association relationship between each sub-cache area and the data disk in the group in turn; the method improves the partitioning efficiency of the cache disk, makes the partitioning more reasonable, and uses these partitions to configure cache for each data disk in turn when deploying the cache, thereby effectively improving the efficiency and stability of subsequent cache deployment.
[0150] Figure 5 A schematic diagram of the structure of the cache deployment device provided in this application, such as Figure 5 As shown, the cache deployment device 500 provided in this embodiment includes:
[0151] An acquisition module 501 is used to acquire hardware topology information of a target hybrid flash storage server, where the hardware topology information is used to indicate a physical topological relationship between multiple CPUs, cache disks, and data disks of the server;
[0152] A processing module 502 is used to parse the hardware topology information to obtain a cache disk and a data disk connected to a CPU bus of each CPU;
[0153] The processing module 502 is further used to group the cache disk and the data disk according to the corresponding CPU bus to obtain multiple disk groups, and there is a corresponding relationship between the disk groups and the CPU;
[0154] The processing module 502 is also used to configure multiple sub-cache areas in the disk group as caches of the data disk in turn for each disk group, and the sub-cache areas are obtained by partitioning the cache disk based on the number of the cache disks and data disks.
[0155] Optionally, the acquisition module 501 is further used to acquire configuration information of the target hybrid flash storage server, the configuration information including: the number and capacity of cache disks, and the number of data disks;
[0156] The processing module 502 is further configured to obtain a target partition number of the cache disk according to the number of the cache disks and the number of the data disks;
[0157] The processing module 502 is further used to partition the capacity of each cache disk in turn according to the target number of partitions to obtain multiple sub-cache areas corresponding to each cache disk, wherein the capacities of the sub-cache areas of the same cache disk are equal.
[0158] Optionally, the processing module 502 is specifically configured to: when the number of cache disks is M and the number of data disks is N;
[0159] When M is divisible by N, the target partition number of the cache disk is determined to be N / M;
[0160] When M does not divide N evenly, the target partition number of the cache disk is determined to be N / M+1.
[0161] Optionally, the acquisition module 501 is further used to acquire the drive letters of the multiple data disks, the drive letters of the multiple cache disks, and the partition number of the sub-cache area corresponding to each cache disk;
[0162] The processing module 502 is further used to sort the drive letters of the multiple cache disks and the partition numbers of the sub-cache areas corresponding to each cache disk according to the positions of the multiple cache disks on the CPU bus to obtain a cache disk list corresponding to each CPU;
[0163] The processing module 502 is further configured to sort the drive letters of the multiple data disks according to the positions of the multiple data disks on the CPU bus to obtain a data disk list corresponding to each CPU;
[0164] The processing module 502 is further configured to determine a plurality of disk groups based on the cache disk list and the data disk list corresponding to each CPU.
[0165] Optionally, the processing module 502 is also used to traverse the data disk list corresponding to each disk group, and establish an association relationship between the drive letter of each data disk and the partition number of the target sub-cache area in the cache disk list corresponding to the disk group, wherein the target sub-cache area selected each time is a sub-cache area in a different cache disk.
[0166] Optionally, the processing module 502 is further configured to traverse a cache disk list corresponding to the disk group, and sequentially determine a target cache disk and a target sub-cache area corresponding to the target cache disk;
[0167] The processing module 502 is further configured to sequentially establish an association relationship between the drive letter of each data disk and the partition number of the target sub-cache area.
[0168] Optionally, the processing module 502 is also used to, when M does not satisfy the integer division of N and the remainder of N / M is L, after the cache of N / M data disks is deployed in sequence, use the sub-cache areas corresponding to different cache disks in the disk group in sequence as the cache of L data disks.
[0169] The cache deployment device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.
[0170] Figure 6 This is a schematic diagram of the structure of the cache deployment device provided in this application. Figure 6 As shown, the present application provides a cache deployment device, and the cache deployment device 600 includes: a receiver 601, a transmitter 602, a processor 603 and a memory 604.
[0171] Receiver 601, used for receiving instructions and data;
[0172] A transmitter 602, used for sending instructions and data;
[0173] Memory 604, used to store computer-executable instructions;
[0174] The processor 603 is used to execute the computer-executable instructions stored in the memory 604 to implement the various steps performed by the cache deployment method in the above embodiment. For details, please refer to the relevant description in the above cache deployment method embodiment.
[0175] Optionally, the memory 604 may be independent or integrated with the processor 603 .
[0176] When the memory 604 is independently provided, the electronic device further includes a bus for connecting the memory 604 and the processor 603 .
[0177] The present application also provides a computer program product, including a computer program, which implements the above-mentioned cache deployment method when executed by a processor.
[0178] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above-mentioned cache deployment method is implemented.
[0179] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0180] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0181] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A cache deployment method, It is characterized in that Applied to a hybrid flash storage server, the method includes: Obtaining hardware topology information of a target hybrid flash storage server, where the hardware topology information is used to indicate a physical topological relationship between multiple CPUs, cache disks, and data disks of the server; Parsing the hardware topology information to obtain a cache disk and a data disk connected to a CPU bus of each CPU; The cache disk and the data disk are grouped according to the corresponding CPU bus to obtain a plurality of disk groups, and there is a corresponding relationship between the disk groups and the CPU; For each disk group, multiple sub-cache areas in the disk group are configured as caches of the data disk in turn, and the sub-cache areas are obtained by partitioning the cache disk based on the number of the cache disks and data disks.
2. The method according to claim 1, It is characterized in that Before obtaining the hardware topology information of the target hybrid flash storage server, the method further includes: Obtaining configuration information of the target hybrid flash storage server, the configuration information including: the number and capacity of cache disks, and the number of data disks; Obtaining a target partition number of the cache disk according to the number of the cache disks and the number of the data disks; According to the target number of partitions, the capacity of each cache disk is partitioned in turn to obtain a plurality of sub-cache areas corresponding to each cache disk, wherein the capacities of the sub-cache areas of the same cache disk are equal.
3. The method according to claim 2, It is characterized in that The step of obtaining the target partition number of the cache disk according to the number of the cache disks and the number of the data disks includes: If the number of cache disks is M, the number of data disks is N; When M is divisible by N, the target partition number of the cache disk is determined to be N / M; When M does not divide N evenly, the target partition number of the cache disk is determined to be N / M+1.
4. The method according to claim 2, It is characterized in that The cache disk and the data disk are grouped according to the corresponding CPU bus to obtain multiple disk groups, including: Obtain drive letters of the multiple data disks, drive letters of the multiple cache disks, and partition numbers of the sub-cache areas corresponding to each cache disk; According to the positions of the multiple cache disks on the CPU bus, the drive letters of the multiple cache disks and the partition numbers of the sub-cache areas corresponding to each cache disk are sorted to obtain a cache disk list corresponding to each CPU; According to the positions of the multiple data disks on the CPU bus, the drive letters of the multiple data disks are sorted to obtain a data disk list corresponding to each CPU; Based on the cache disk list and the data disk list corresponding to each CPU, multiple disk groups are determined.
5. The method according to claim 4, It is characterized in that For each disk group, sequentially configuring multiple sub-cache areas in the disk group as caches of the data disk includes: Traverse the data disk list corresponding to each disk group, and establish the association relationship between the drive letter of each data disk and the partition number of the target sub-cache area in the cache disk list corresponding to the disk group, wherein the target sub-cache area selected each time is a sub-cache area in a different cache disk.
6. The method according to claim 5, It is characterized in that The step of sequentially establishing an association relationship between the drive letter of each data disk and the partition number of the target sub-cache area in the cache disk list corresponding to the disk group includes: Traversing the cache disk list corresponding to the disk group, and determining the target cache disk and the target sub-cache area corresponding to the target cache disk in sequence; An association relationship between the drive letter of each data disk and the partition number of the target sub-cache area is established in sequence.
7. The method according to claim 5, It is characterized in that The method further comprises: When M does not divide N evenly and the remainder of N / M is L, after the caches of N / M data disks are deployed in sequence, the sub-cache areas corresponding to different cache disks in the disk group are used in sequence as caches for L data disks.
8. A cache deployment device, It is characterized in that The device comprises: An acquisition module, used to acquire hardware topology information of a target hybrid flash storage server, wherein the hardware topology information is used to indicate a physical topological relationship between multiple CPUs, cache disks, and data disks of the server; A processing module, used for parsing the hardware topology information to obtain a cache disk and a data disk connected to a CPU bus of each CPU; The processing module is further used to group the cache disk and the data disk according to the corresponding CPU bus to obtain multiple disk groups, and there is a corresponding relationship between the disk groups and the CPU; The processing module is also used to configure multiple sub-cache areas in the disk group as cache of the data disk in turn for each disk group, and the sub-cache areas are obtained by partitioning the cache disk based on the number of the cache disks and data disks.
9. A cache deployment device, It is characterized in that include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the cache deployment method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the cache deployment method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Mixed storage system and method for supporting solid-state disk cache dynamic distribution
CN103902474A
Automatic deployment method and device for distributed storage, equipment and product
CN115499304A
Disk creating method, data dropping method and computing equipment
CN116450032A
Storage configuration adjustment method, device and system of server, equipment and medium
CN117472289A
Method, electronic device and computer program product for storage management
US11163464B1
