A method, device, equipment and medium for selecting path device of multi-path storage
By monitoring and recording the IO processing of path devices in the server, and switching path devices based on real-time statistical data, the problem of inflexible task distribution in multi-path storage is solved, and IO processing efficiency and intelligent selection are improved.
Patent Information
- Application Number
- CN202210753296.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-06-29
AI Technical Summary
In multi-path storage applications, existing path device selection strategies cannot allocate and adjust tasks intelligently and flexibly, resulting in inflexible task distribution and low efficiency.
By setting up the first and second request sending modules in the server, the IO processing of the path device is monitored, real-time statistical data is generated, and the path device is switched according to preset conditions to achieve flexible and intelligent task distribution of the path device.
It improves the overall efficiency of path device processing IO, realizes real-time and precise control of IO data processing, and expands the functions of multi-path tools.
Smart Images

Figure CN115098028B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage, and in particular to a method, device, equipment and medium for selecting a path device for multi-path storage. Background Art
[0002] In a SAN (Storage Area Network) environment composed of optical fiber, or an IPSAN environment composed of iSCSI (Internet Small Computer System Interface), since the host and storage are connected through an optical fiber switch or multiple network cards and IP (Internet Protocol), a many-to-many relationship is formed, and a multi-path relationship from the host to the storage is formed accordingly. At present, in the application of multi-path, the path selection strategy of the multi-path software refers to the method of selecting the target device from multiple devices when an I / O (Input / Output) operation occurs on the host side. There are three path selection strategies: 1) round robin: give priority to polling and sending IO on all valid path devices in the optimal path group. If there is no available path device in the optimal path group, poll and send IO on the valid path devices in the non-optimal path group; 2) least queue depth: give priority to sending I / O to the path device with the least currently uncompleted I / O requests on the optimal path group; 3) service-time: send I / O to the path with the shortest service time. However, these three path device selection strategies all have corresponding shortcomings. In actual operation, only one of the schemes can be executed mechanically, and the execution tasks of each path device cannot be automatically and intelligently allocated and adjusted in real time.
[0003] As can be seen from the above, in the multipath application process of data storage, how to avoid the situation where the task distribution of each path device is inflexible and unintelligent due to the inherent path device selection method is a problem to be solved in the art. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a path device selection method, apparatus, device and medium for multi-path storage, which can simultaneously consider the performance, processing capacity and service duration of each path device and perform flexible and intelligent task distribution for each path device. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a path device selection method for multi-path storage, which is applied to a server and includes:
[0006] A first request sending module, configured to send the received IO request to each path device corresponding to the target multipath device in a preset polling manner, so that each path device writes the IO data corresponding to the IO request into a target volume in the storage system corresponding to the target multipath device;
[0007] A data recording module is used to monitor the processing process of each IO request by each path device, and record the IO processing times and the processing time of each IO by each path device in real time to generate real-time statistical data;
[0008] The second request sending module is used to determine the target path device based on the real-time statistical data when the preset path device switching condition is met, and send the current IO request to be distributed to the target path device, so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume.
[0009] Optionally, before sending the received IO request to each path device corresponding to the target multipath device in a preset polling manner, the method further includes:
[0010] Using the identification information of the server and a preset path link type, a path link is created between the server and a preset storage system; the preset storage system includes a host and a volume with the identification information of the server, and the volume has been pre-mapped to the host;
[0011] Each path device is determined based on the path link, and the path devices with the same WWID are aggregated into a target multipath device.
[0012] Optionally, when a preset path device switching condition is met, determining a target path device based on the real-time statistical data includes:
[0013] When the number of data IOs in the target volume meets a preset number, determining a target path device based on the real-time statistical data;
[0014] Or, when the write capacity of each of the path devices meets a preset capacity value, the target path device is determined based on the real-time statistical data.
[0015] Optionally, sending the received IO request to each path device corresponding to the target multipath device in a preset polling manner includes:
[0016] The received IO request is sent to each path device corresponding to the target multipath device based on the round-robin algorithm.
[0017] Optionally, the real-time recording of the number of IO processing times of each path device and the processing time of each IO to generate real-time statistical data includes:
[0018] Determine and record in real time the number of IO processing times of each path device and the processing time of each IO, and determine the average IO processing time of each path device by using the number of IO processing times of each path device and the processing time of each IO;
[0019] Real-time statistical data is generated based on the IO processing times of each path device, the processing time of each IO, and the average IO processing time.
[0020] Optionally, determining the target path device based on the real-time statistical data includes:
[0021] Determine the number of unprocessed IOs of each path device, and determine the estimated waiting time based on the average IO time consumed by each path device in the real-time statistical data and the number of unprocessed IOs;
[0022] The path device with the shortest estimated waiting time among all the path devices corresponding to the target multipath device is determined as the target path device.
[0023] Optionally, after sending the current IO request to be distributed to the target path device so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume, the method further includes:
[0024] Calculate the total IO flow of each path device in real time using a preset flow calculation formula;
[0025] The total IO flow is sent to a preset multipath tool in the server to be displayed in the preset multipath tool based on a preset display format.
[0026] In a second aspect, the present application discloses a path device selection device for multi-path storage, comprising:
[0027] A first request sending module, configured to send the received IO request to each path device corresponding to the target multipath device in a preset polling manner, so that each path device writes the IO data corresponding to the IO request into a target volume in the storage system corresponding to the target multipath device;
[0028] A data recording module is used to monitor the processing process of each IO request by each path device, and record the IO processing times and the processing time of each IO by each path device in real time to generate real-time statistical data;
[0029] The second request sending module is used to determine the target path device based on the real-time statistical data when the preset path device switching condition is met, and send the current IO request to be distributed to the target path device, so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume.
[0030] In a third aspect, the present application discloses an electronic device, including:
[0031] Memory, used to store computer programs;
[0032] The processor is used to execute the computer program to implement the aforementioned path device selection method for multi-path storage.
[0033] In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the path device selection method for multi-path storage disclosed above are implemented.
[0034] In the present application, the server first sends the received IO request to each path device corresponding to the target multipath device in a preset polling manner, so that each path device writes the IO data corresponding to the IO request into the target volume in the storage system corresponding to the target multipath device; monitors the processing process of each path device on each IO request, and records the IO processing times and the processing time of each IO of each path device in real time to generate real-time statistical data; when the preset path device switching condition is met, the target path device is determined based on the real-time statistical data, and the current IO request to be distributed is sent to the target path device, so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume. In this way, the present invention considers the execution capability and execution time of each path device, distributes the received IO request in stages according to different path selection algorithms, and distributes the IO request according to the specific execution capability of each path device, which greatly improves the overall efficiency of each path device in processing IO, and proposes that the processing of IO data can be controlled in real time and accurately by using the preset path device switching condition, thereby improving the intelligent selection of data storage. In addition, the present invention proposes that the total flow of each path device can be recorded in real time, and the total flow processed by each path device can be counted, and visualized in the preset multi-path tool in the server, thereby expanding the function of the multi-path tool and improving the practicality and rationality of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0036] Figure 1 A flow chart of a path device selection method for multi-path storage provided by the present application;
[0037] Figure 2 A flow chart of a specific multi-path storage path device selection method provided by this application;
[0038] Figure 3 A schematic diagram of the structure of a path device selection device for multi-path storage provided by the present application;
[0039] Figure 4 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] In the prior art, only the method of polling and distributing to the path devices, or distributing to the path devices with the least number of tasks, or distributing to the path devices with the shortest service time can be selected, resulting in inflexible and unintelligent task distribution to each path device. In this application, the performance, processing capacity and service time of each path device are considered at the same time, and tasks are distributed flexibly and intelligently to each path device, which greatly improves the execution efficiency of data IO.
[0042] The embodiment of the present invention discloses a path device selection method for multi-path storage, which is applied to a server, see Figure 1 Said method comprises:
[0043] Step S11: sending the received IO request to each path device corresponding to the target multipath device in a preset polling manner, so that each path device writes the IO data corresponding to the IO request into the target volume in the storage system corresponding to the target multipath device.
[0044] In this embodiment, the path device is a path device corresponding to each link after the storage system and the server establish a path link, and the multipath device is a device obtained by aggregating each path device.
[0045] It should be noted that there are different multipath grouping strategies in the prior art, and the multipath grouping strategy refers to the grouping method of the path devices (sdX) under the multipath device (dm-X). The method in the present invention is limited to the multibus strategy in the multipath grouping strategy, that is, all path devices are grouped in the same path group.
[0046] In this embodiment, sending the received IO request to each path device corresponding to the target multipath device in a preset polling manner may include: sending the received IO request to each path device corresponding to the target multipath device based on a round-robin algorithm.
[0047] In this embodiment, before sending the received IO request to each path device corresponding to the target multipath device in a preset polling manner, it may also include: using the identification information of the server and the preset path link type to create a path link between the server and a preset storage system; the preset storage system includes a host and a volume with the identification information of the server, and the volume has been pre-mapped to the host; based on the path link, each path device is determined, and path devices with the same WWID (i.e., World Wide Identification) are aggregated into a target multipath device.
[0048] In some specific implementations, a host and a volume corresponding to a server may be created in advance in the storage system, and the volume may be mapped to the host. Specifically, when a preset command is obtained or a host and volume creation instruction is obtained in a preset visual interface, the host and the volume may be created based on the creation instruction. It should be noted that the host created in this step is a concept on the storage system, and when the preset path link type is an iSCSI link, the created host must contain the IQN (i.e., ISCSI (Internet Small Computer System Interface) Qualified Name) information of the current server; when the preset path link type is an FC (i.e., Fiber Channel) link, the created host must contain the WWPN (i.e., World Wide Port Name) information of the current server.
[0049] After the storage system operation is completed, the server will create a link between the server and the storage system through the link establishment command entered by the user. At this time, multiple links are generally created. When creating a link, the user can first use the iscsiadm–m discovery-t sendtargets-p${storage_IP}:${storage_PORT} command to discover the target on the storage, where ${storage_IP} is the management IP in the storage system cluster, which can be set to 100.7.46.45 in a specific implementation; ${storage_PORT} is the host port corresponding to the management IP, which can be set to 3260 in a specific implementation. The commands entered by the user can be combined into: iscsiadm–mdiscovery-tsendtargets-p 100.7.46.45:3260.
[0050] Next, the user can log in to the node in the storage system to establish a link through the iscsiadm-m node-T${storage_IQN}-p${storage_IP}–login command, where ${storage_IQN} is the IQN information of the current server.
[0051] Finally, you can use the iscsiadm-m session command to view the established links between the server and the storage system.
[0052] After the link is established, the corresponding path devices can be generated based on each storage link. Users can scan through echo'---'> / sys / class / scsi_host / ${hostName} / device / scsi_host / ${hostName} / scan. At this time, the path devices can be found in the directory / dev / disk / by-path / . For example: if there are four links established, each volume corresponds to four path devices, such as: / dev / sdb, / dev / sdc, / dev / sdd and / dev / sde.
[0053] The server will then aggregate devices with the same WWID into a target multipath device. Specifically, in the process of aggregating path devices, you can use systemctl start multipathd to start the multipath software, and multipathd will automatically aggregate devices with the same wwid into a multipath device. For example, if / dev / sdb, / dev / sdc, / dev / sdd, and / dev / sde have the same WWID, these four devices will be aggregated into the target multipath device / dev / dm-0. At this time, the corresponding relationship between multipath devices and path devices will be formed as shown in Table 1 below.
[0054] Table 1
[0055]
[0056] In this embodiment, when an IO request is received, the received IO request will first be sent to each path device corresponding to the target multipath device according to a preset polling method. In a specific implementation, a user can write data to / dev / dm-0 by using the command dd if= / dev / zero of= / dev / dm-0bs=1k count=10000, writing 1k of data each time, for a total of 10,000 times. When the server obtains these IO requests, it will write data to / dev / dm-0 based on the above commands. First, the server will use the preset round-robin polling algorithm to poll and select the path device. Each path device will write the corresponding IO data to the target volume in the storage system corresponding to the multipath device based on the IO request received by each. In a specific implementation, when the above-mentioned data write command is received, the target multipath device will be determined as / dev / dm0, and the IO request polling will be sent to the target path devices / dev / sdb, / dev / sdc, / dev / sdd and / dev / sde, and each target path device will write the corresponding IO data to the target volume corresponding to / dev / dm0.
[0057] Step S12: monitoring the processing process of each path device on each IO request, and recording the IO processing times and the processing time of each IO by each path device in real time to generate real-time statistical data.
[0058] In this embodiment, the processing process of each path device for each IO request is monitored, and the real-time data is recorded. Specifically, the number of I / Os processed on the path device corresponding to each path link (i.e., the number of IO processing times) and the processing time can be monitored. If each path device executes 10 I / O requests, the time consumption for each request and the average time consumption are shown in Table 2 below.
[0059] Table 2
[0060]
[0061] In this embodiment, the average time consumption can be expressed by the formula It is calculated as follows, where i represents the i-th path device and k represents the k-th sample.
[0062] In some specific implementations, when the number of path devices is 4, the value range of i is 1 to 4. In addition, if the number of samples is 10 as shown in Table 2, the value range of the number of samples k is 1 to 10.
[0063] Step S13: When the preset path device switching condition is met, the target path device is determined based on the real-time statistical data, and the current IO request to be distributed is sent to the target path device, so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume.
[0064] When the preset path device switching condition is met, the polling and sending of IO requests will be stopped, and the target path device will be determined based on real-time statistical data, and then the current IO request to be distributed will be sent to the target path device.
[0065] In this embodiment, when the preset path device switching condition is met, the target path device is determined based on the real-time statistical data, which may include: when the number of data IO in the target volume meets the preset number, the target path device is determined based on the real-time statistical data; or, when the write capacity of each of the path devices meets the preset capacity value, the target path device is determined based on the real-time statistical data. It can be understood that in this embodiment, the preset path device switching condition can be set to when the number of data IO in the target volume meets the preset number or when the write capacity of each of the path devices meets the preset capacity value, and the preset number and the preset capacity value can be set according to different scenarios and can be changed at any time. In some specific implementations, when the preset path device switching condition is set to when each path device writes 1G data, in actual operation, the capacity of each path device to write data will be recorded, and when the write capacity of each path device is greater than 1G, the polling and sending of IO requests will be stopped, and the target path device will be determined, and then the current IO request to be distributed will be sent to the target path device.
[0066] In this embodiment, when the preset path device switching conditions are met, the current IO request to be distributed will be automatically distributed to the target path device that meets the preset conditions, abandoning the method of mechanically distributing IO requests in the traditional path device selection method, thereby improving the efficiency of IO execution.
[0067] In this embodiment, after sending the current IO request to be distributed to the target path device so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume, it can also include: using a preset traffic calculation formula to calculate the total IO traffic of each path device in real time; sending the total IO traffic to a preset multipath tool in the server to display it in the preset multipath tool based on a preset display format.
[0068] Specifically, in this step, the formula Calculate the IO traffic on each path device in real time. Where i represents the i-th path device, k represents the k-th IO, and f i [k] Indicates the traffic of the kth I / O on the i-th path device. i Represents the total traffic on the i-th path device.
[0069] It is understandable that in this embodiment, when each path device receives an IO request and performs a corresponding data read or write operation, its IO traffic will be recorded in real time, and the total IO traffic of each path device will be counted. In some specific implementations, the total IO traffic can be sent to the multipathd tool in the server and displayed in multipathd according to a preset display format. In the specific implementation process, the preset display format includes but is not limited to tables, line charts, text and other formats, which are not limited here. In some other implementations, the total IO traffic can also be directly displayed in a preset window interface in the server based on a preset display format without connecting to the preset multipath tool.
[0070] In this embodiment, the server first sends the received IO request to each path device corresponding to the target multipath device in a preset polling manner, so that each path device writes the IO data corresponding to the IO request into the target volume in the storage system corresponding to the target multipath device; monitors the processing process of each path device on each IO request, and records the IO processing times and the processing time of each IO by each path device in real time to generate real-time statistical data; when the preset path device switching condition is met, the target path device is determined based on the real-time statistical data, and the current IO request to be distributed is sent to the target path device, so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume. In this way, the present invention considers the execution capability and execution time of each path device, distributes the received IO request in stages according to different path selection algorithms, and distributes the IO request according to the specific execution capability of each path device, which greatly improves the overall efficiency of each path device in processing IO, and proposes that the processing of IO data can be controlled in real time and accurately by using the preset path device switching condition, thereby improving the intelligent selection of data storage. In addition, the present invention proposes that the total flow of each path device can be recorded in real time, and the total flow processed by each path device can be counted, and visualized in the preset multi-path tool in the server, thereby expanding the function of the multi-path tool and improving the practicality and rationality of the present invention.
[0071] Figure 2 A flowchart of a specific multi-path storage path device selection method provided in an embodiment of the present application. Figure 2 As shown, the method includes:
[0072] Step S21: sending the received IO request to each path device corresponding to the target multipath device based on the round-robin algorithm, so that each path device writes the IO data corresponding to the IO request into the target volume in the storage system corresponding to the target multipath device.
[0073] It can be understood that, in this embodiment, a round-robin algorithm can be used to complete the polling and sending operation for IO requests.
[0074] Step S22: monitor the processing process of each IO request by each path device, determine and record in real time the number of IO processing times and the processing time of each IO by each path device, and determine the average IO time of each path device using the number of IO processing times and the processing time of each IO by each path device.
[0075] For a more specific processing procedure of step S22, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.
[0076] Step S23: Generate real-time statistical data based on the IO processing times of each path device, the processing time of each IO, and the average IO processing time.
[0077] In this embodiment, the number of completed I / Os, the time consumption, and the average time consumption on the path device are updated in real time, and real-time statistical data are generated.
[0078] Step S24: determining the number of unprocessed IOs of each path device, and determining an estimated waiting time based on the average IO time consumed by each path device in the real-time statistical data and the number of unprocessed IOs.
[0079] In this embodiment, the number of unfinished I / O operations on the path device is also counted in real time. When a new I / O operation is triggered, the waiting time is estimated based on the average time consumption and the number of unfinished I / O operations, and finally the target path device is selected based on the waiting time. The following Table 3 shows the average time consumption of each path device and the IO request corresponding to each path device, as well as the number of unfinished IO operations.
[0080] Table 3
[0081] Path Device Average time taken for I / O requests (milliseconds) Unfinished I / O operations / dev / sdb 11 10 / dev / sdc 15 9 / dev / sdd 11.1 11 / dev / sde 26.1 12
[0082] In some specific implementations, the formula Calculate the estimated waiting time of each path device, where: is the average time consumed by the i-th path device, C i is the number of unfinished I / Os on the i-th path device. For example, the estimated waiting time for / dev / sdb in the above table is T 1 =11*10=110, the estimated waiting time T for / dev / sdc 2 = 15*9=135. Use the same method to calculate the estimated waiting time T for / dev / sdd. 3 is 122.1, the estimated waiting time T for / dev / sde 4 It is 313.2.
[0083] In addition, it should be noted that, since the present embodiment records the number of processed IOs, the number of unprocessed IOs, and the average time consumption of each path device in real time, when an I / O is completed on the i-th path device, the number of uncompleted I / Os C is updated. i , that is, C i =C i -1; when an I / O is completed on the i-th path device, the number of completed I / Os N is updated, that is, N = N + 1; when an I / O is completed on the i-th path device, the average time consumed is updated Right now When a new I / O is allocated on the i-th path device, the number of outstanding I / Os C is updated. i , that is, C i =C i +1.
[0084] Step S25: Determine the path device with the shortest estimated waiting time among all the path devices corresponding to the target multipath device as the target path device.
[0085] In this embodiment, the path device with the shortest estimated waiting time is determined as the target path device. Taking the data in Table 3 as an example, the estimated waiting time of / dev / sdb is T 1 =11*10=110 is the minimum value, and / dev / sdb will be determined as the target path device.
[0086] Step S26: Send the current IO request to be distributed to the target path device, so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume.
[0087] In this embodiment, when a new IO operation is triggered, that is, when an IO request to be distributed is received, the IO request to be distributed will be preferentially sent to the device with the shortest estimated waiting time, that is, / dev / sdb.
[0088] In the prior art, round-robin selects path devices by polling, without considering the performance and processing capacity of the path devices. Although queue depth considers the number of unfinished I / Os on the path device, it does not consider the time it takes for the path device to process an I / O. Although service time considers the time it takes for an I / O, it only considers the most recent I / O, and does not consider the time it takes for all I / Os within a period of time, nor does it consider the number of unfinished I / Os on the path device. The path device selection method for multi-path storage proposed in this embodiment can select different path selection algorithms in two stages. In the first stage, OA requests are sent by polling, and when the preset path device switching conditions are met, the average time and number of unfinished I / Os on the path device are determined based on the statistical data recorded in real time in the first stage, the waiting time of each path device is calculated, and in the second stage, the path device is intelligently selected based on the waiting time, thereby reducing the waiting time of I / O requests and improving processing capacity.
[0089] See also Figure 3 As shown, the embodiment of the present application discloses a path device selection device for multi-path storage, which is applied to a server and may specifically include:
[0090] A first request sending module 11 is used to send the received IO request to each path device corresponding to the target multipath device in a preset polling manner, so that each path device writes the IO data corresponding to the IO request into a target volume in the storage system corresponding to the target multipath device;
[0091] The data recording module 12 is used to monitor the processing process of each IO request by each path device, and record the IO processing times and the processing time of each IO by each path device in real time to generate real-time statistical data;
[0092] The second request sending module 13 is used to determine the target path device based on the real-time statistical data when the preset path device switching condition is met, and send the current IO request to be distributed to the target path device, so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume.
[0093] In the present invention, the server first sends the received IO request to each path device corresponding to the target multipath device in a preset polling manner, so that each path device writes the IO data corresponding to the IO request into the target volume of the storage system corresponding to the target multipath device; monitors the processing process of each path device on each IO request, and records the IO processing times and the processing time of each IO by each path device in real time to generate real-time statistical data; when the preset path device switching condition is met, the target path device is determined based on the real-time statistical data, and the current IO request to be distributed is sent to the target path device, so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume. In this way, the present invention considers the execution capability and execution time of each path device, distributes the received IO request in stages according to different path selection algorithms, and distributes the IO request according to the specific execution capability of each path device, which greatly improves the overall efficiency of each path device in processing IO, and proposes that the processing of IO data can be controlled in real time and accurately by using the preset path device switching condition, thereby improving the intelligent selection of data storage. In addition, the present invention proposes that the total flow of each path device can be recorded in real time, and the total flow processed by each path device can be counted, and visualized in the preset multi-path tool in the server, thereby expanding the function of the multi-path tool and improving the practicality and rationality of the present invention.
[0094] In some specific embodiments, the path device selection device of the multi-path storage further includes:
[0095] A link creation unit, configured to create a path link between the server and a preset storage system using the identification information of the server and a preset path link type; the preset storage system includes a host and a volume with the identification information of the server, and the volume has been pre-mapped to the host;
[0096] The device aggregation unit is used to determine each path device based on the path link, and aggregate the path devices with the same WWID into a target multipath device.
[0097] In some specific embodiments, the second request sending module 13 specifically includes:
[0098] A first device determining unit, configured to determine a target path device based on the real-time statistical data when the number of data IO times in the target volume meets a preset number;
[0099] Or, a second device determination unit is used to determine the target path device based on the real-time statistical data when the write capacity of each of the path devices meets a preset capacity value.
[0100] In some specific embodiments, the first request sending module 11 includes:
[0101] The request sending unit is used to send the received IO request to each path device corresponding to the target multipath device based on the round-robin algorithm.
[0102] In some specific embodiments, the data recording module 12 includes:
[0103] An average time consumption calculation unit is used to determine and record in real time the number of IO processing times of each path device and the processing time consumption of each IO, and determine the average IO time consumption of each path device by using the number of IO processing times of each path device and the processing time consumption of each IO;
[0104] The statistical data generating unit is used to generate real-time statistical data based on the IO processing times of each path device, the processing time of each IO and the average IO processing time.
[0105] In some specific embodiments, the second request sending module 13 includes:
[0106] A waiting time determination unit, used to determine the number of unprocessed IOs of each path device, and determine an estimated waiting time based on the average IO time consumed by each path device in the real-time statistical data and the number of unprocessed IOs;
[0107] The target device determining unit is configured to determine the path device with the shortest estimated waiting time among all the path devices corresponding to the target multipath device as the target path device.
[0108] In some specific embodiments, the path device selection apparatus for multi-path storage further includes:
[0109] A total flow calculation unit, used to calculate the total IO flow of each path device in real time using a preset flow calculation formula;
[0110] The total flow display unit is used to send the total IO flow to a preset multipath tool in the server so as to display it in the preset multipath tool based on a preset display format.
[0111] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be considered as any limitation on the scope of use of the present application.
[0112] Figure 4 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a display screen 24, an input / output interface 25, a communication interface 26, and a communication bus 27. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the path device selection method for multi-path storage disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0113] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 26 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0114] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222 and virtual machine data 223, etc. The virtual machine data 223 may include various data. The storage method may be temporary storage or permanent storage.
[0115] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the path device selection method for multi-path storage performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0116] Furthermore, the present application also discloses a computer-readable storage medium, wherein the computer-readable storage medium mentioned here includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk or an optical disk, or any other form of storage medium known in the technical field. Wherein, when the computer program is executed by the processor, the path device selection method for multi-path storage disclosed above is implemented. For the specific steps of the method, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.
[0117] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts refer to the method part description. Professionals can also further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but this implementation should not be considered to exceed the scope of this application.
[0118] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0119] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0120] The above is a detailed introduction to the path device selection method, apparatus, device, and storage medium for multi-path storage provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A path device selection method for multi-path storage, It is characterized in that Applicable to servers, including: Sending the received IO request to each path device corresponding to the target multipath device in a preset polling manner, so that each path device writes the IO data corresponding to the IO request into the target volume in the storage system corresponding to the target multipath device; Monitor the processing process of each IO request by each path device, and record the IO processing times and the processing time of each IO by each path device in real time to generate real-time statistical data; When a preset path device switching condition is met, a target path device is determined based on the real-time statistical data, and the current IO request to be distributed is sent to the target path device, so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume; Before sending the received IO request to each path device corresponding to the target multipath device in a preset polling manner, the method further includes: Using the identification information of the server and a preset path link type, a path link is created between the server and a preset storage system; the preset storage system includes a host and a volume with the identification information of the server, and the volume has been pre-mapped to the host; Determine each path device based on the path link, and aggregate the path devices with the same WWID into a target multipath device; The real-time recording of the IO processing times of each path device and the processing time of each IO to generate real-time statistical data includes: Determine and record in real time the number of IO processing times of each path device and the processing time of each IO, and determine the average IO processing time of each path device by using the number of IO processing times of each path device and the processing time of each IO; Generate real-time statistical data based on the IO processing times of each path device, the processing time of each IO, and the average IO processing time; The determining of the target path device based on the real-time statistical data comprises: Determine the number of unprocessed IOs of each path device, and determine the estimated waiting time based on the average IO time consumed by each path device in the real-time statistical data and the number of unprocessed IOs; The path device with the shortest estimated waiting time among all the path devices corresponding to the target multipath device is determined as the target path device.
2. The method for selecting a path device for multi-path storage according to claim 1, It is characterized in that When the preset path device switching condition is met, determining the target path device based on the real-time statistical data includes: When the number of data IOs in the target volume meets a preset number, determining a target path device based on the real-time statistical data; Or, when the write capacity of each of the path devices meets a preset capacity value, the target path device is determined based on the real-time statistical data.
3. The method for selecting a path device for multi-path storage according to claim 1, It is characterized in that The step of sending the received IO request to each path device corresponding to the target multipath device in a preset polling manner includes: The received IO request is sent to each path device corresponding to the target multipath device based on the round-robin algorithm.
4. The method for selecting a path device for multi-path storage according to any one of claims 1 to 3, It is characterized in that After sending the current IO request to be distributed to the target path device so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume, the method further includes: Calculate the total IO flow of each path device in real time using a preset flow calculation formula; The total IO flow is sent to a preset multipath tool in the server to be displayed in the preset multipath tool based on a preset display format.
5. A path device selection device for multi-path storage, It is characterized in that Applicable to servers, including: A first request sending module, configured to send the received IO request to each path device corresponding to the target multipath device in a preset polling manner, so that each path device writes the IO data corresponding to the IO request into a target volume in the storage system corresponding to the target multipath device; A data recording module is used to monitor the processing process of each IO request by each path device, and record the IO processing times and the processing time of each IO by each path device in real time to generate real-time statistical data; A second request sending module is used to determine a target path device based on the real-time statistical data when a preset path device switching condition is met, and send the current IO request to be distributed to the target path device, so that the target path device writes the IO data corresponding to the IO request to be distributed into the target volume; Wherein, the path device selection device for multi-path storage further includes: A link creation unit, configured to create a path link between the server and a preset storage system using the identification information of the server and a preset path link type; the preset storage system includes a host and a volume with the identification information of the server, and the volume has been pre-mapped to the host; A device aggregation unit, configured to determine each path device based on the path link, and aggregate the path devices with the same WWID into a target multipath device; The data recording module 12 includes: An average time consumption calculation unit is used to determine and record in real time the number of IO processing times of each path device and the processing time consumption of each IO, and determine the average IO time consumption of each path device by using the number of IO processing times of each path device and the processing time consumption of each IO; A statistical data generating unit, configured to generate real-time statistical data based on the number of IO processing times of each path device, the processing time of each IO, and the average IO processing time; The second request sending module 13 includes: A waiting time determination unit, used to determine the number of unprocessed IOs of each path device, and determine an estimated waiting time based on the average IO time consumed by each path device in the real-time statistical data and the number of unprocessed IOs; The target device determining unit is configured to determine the path device with the shortest estimated waiting time among all the path devices corresponding to the target multipath device as the target path device.
6. An electronic device, It is characterized in that It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the path device selection method for multi-path storage as claimed in any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, It is characterized in that Used to store computer programs; wherein, when the computer program is executed by a processor, the path device selection method for multi-path storage according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Data perspective table processing method, device and system
CN111177206A
Method, device and equipment for cleaning residual paths at host end
CN113238719A
Data access method and device, electronic equipment and storage medium
CN113885799A
Information processing system and path management method
US20190310925A1
