A disk-based IO time consumption monitoring method, system, storage medium and device
Patent Information
- Application Number
- CN202210466856.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-04-29
AI Technical Summary
The existing technology is difficult to effectively monitor and solve the problem of performance degradation caused by high disk IO time consumption. In particular, it cannot distinguish between system software and hardware time consumption, and cannot accurately reflect the time consumption of reading and writing physical disk sectors.
By monitoring the entire process from IO requests generated by the file system to data reading and writing to the disk, it is divided into system kernel processing, IO scheduler processing and hardware processing. The IO time consumption of each process is obtained respectively, and the IO time consumption is obtained according to the preset threshold. Issue an alarm message and identify specific problems to take corrective measures.
It achieves specific and comprehensive monitoring of disk IO time-consuming, can early identify and solve the problem of high IO time-consuming, and ensure the normal operation of disk read and write performance.
Smart Images

Figure CN114936124B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a disk-based IO time consumption monitoring method, system, storage medium and device. Background Art
[0002] During the operation of the server, when the disk IO (data input / output) takes a long time and causes performance degradation, possible reasons include problems with the system kernel, IO scheduling strategy, or disk-related hardware.
[0003] In the system kernel, the disk performance may be poor or unable to read and write normally due to IO task backlog caused by excessive processor usage, insufficient memory, interrupt processing timeout, etc., or energy-saving settings related to the processor, PCIE (peripheral component interconnect express, a high-speed serial computer expansion bus standard), operating system, or kernel bugs (faults), disk-related driver bugs, etc.
[0004] In terms of IO scheduling strategy, since the role of IO scheduling strategy is to manage the request queue of block devices, it determines the order of requests in the queue and the time to dispatch requests to disk devices, in order to reduce the disk addressing time and improve the global throughput. It is mainly divided into predictive IO scheduler, completely fair queuing IO scheduler, deadline IO scheduler, no-operation IO scheduler, etc. For different disk types, using different IO schedulers will achieve different IO performance. For example, the performance of using the deadline IO scheduler for solid-state drives will be higher, while the performance of mechanical hard drives should be better with the completely fair queuing IO scheduler. If an inappropriate IO scheduler is used, the IO performance of the disk will be affected.
[0005] In terms of disk-related hardware, although the capacity and performance of disks are constantly improving with the development of technology, bad sectors of mechanical hard disks and bad blocks of solid-state hard disks are inevitable during the use of disks. Bad sectors of mechanical hard disks are mostly caused by vibration, impact or abnormal power failure. When the hard disk is powered on, the distance between the high-speed disk and the magnetic head is very small. Slight vibration or squeezing may cause damage to the magnetic recording material on the surface of the disk, thereby generating bad sectors. Although solid-state hard disks have no mechanical moving parts and do not have the problem of physical bad sectors, the flash memory particles of solid-state hard disks have the problem of erasure times and bad blocks. Repeated erasure of specific storage units will accelerate the generation of bad blocks. When bad sectors or bad blocks appear on the disk, the data at the corresponding position may be difficult to read and write, and the magnetic head or storage unit may repeatedly retry reading and writing, which will affect the performance of data IO and cause the corresponding disk performance abnormality. And if it is not repaired or isolated in time, as the bad blocks or bad sectors of the disk continue to accumulate and spread, it will have a destructive effect on the disk capacity, and may even cause the disk to be unable to read and write or fail.
[0006] When discovering disk IO anomalies and dealing with disk IO performance issues, system monitoring tools iostat and blktrace are usually used for analysis. The iostat tool cannot distinguish the time consumption of system software and hardware, and cannot be used as an indicator for evaluating hardware performance. Although the blktrace tool can record the timestamps and time consumption percentages of each stage of each IO within the monitored time interval, it can only reflect the time consumption of file system blocks, and cannot reflect the time consumption of reading and writing physical disk sectors. Summary of the invention
[0007] In view of this, the purpose of the present invention is to propose a disk-based IO time consumption monitoring method, system, storage medium and device, so as to monitor the IO time consumption of the disk in a specific and comprehensive manner.
[0008] Based on the above purpose, the present invention provides a disk-based IO time consumption monitoring method, comprising the following steps:
[0009] In response to monitoring that the file system generates an IO request, the overall process of reading and writing data corresponding to the IO request to the disk is monitored by a monitoring program, and the overall process includes a system kernel processing process, an IO scheduler processing process, and a hardware processing process in sequence;
[0010] During the monitoring process, the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process is obtained respectively, and it is determined whether the IO time consumption of each item exceeds the corresponding preset threshold value;
[0011] In response to the time taken by a number of IO items exceeding the corresponding preset threshold, a corresponding alarm message is issued.
[0012] In some embodiments, the method further comprises:
[0013] The overall process is divided into a system kernel processing process, an IO scheduler processing process and a hardware processing process in sequence through the first tracking point function, the second tracking point function, the third tracking point function and the fourth tracking point function.
[0014] In some embodiments, obtaining the IO time consumption of the system kernel processing process, the IO scheduler processing process, and the hardware processing process respectively during the monitoring process includes:
[0015] In response to the system kernel processing process and the IO scheduler processing process processing the disk block of the disk, the first tracking point function, the second tracking point function and the third tracking point function are called in sequence, and the first calling time is recorded respectively;
[0016] Calculate the time difference between the first call time of the first tracing point function and the first call time of the second tracing point function as the IO time consumed by the system kernel processing process;
[0017] Calculating the time difference between the first call time of the second tracing point function and the first call time of the third tracing point function as the IO time consumed by the IO scheduler processing process; and
[0018] In response to the hardware processing process processing the disk sector of the disk, the third tracking point function and the fourth tracking point function are called in sequence, and the second calling time is recorded respectively;
[0019] The time difference between the second calling time of the third tracing point function and the second calling time of the fourth tracing point function is calculated as the IO time consumption of the hardware processing process.
[0020] In some embodiments, the method further comprises:
[0021] In response to obtaining the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process, the name of the disk and the information of the disk block and disk sector are obtained and output to the monitoring result.
[0022] In some embodiments, the method further comprises:
[0023] Set preset thresholds for each IO time consumption based on the latency requirements of the business scenario.
[0024] In some embodiments, the method further comprises:
[0025] Determine the corresponding repair strategy based on the corresponding alarm information.
[0026] In some embodiments, the repair strategy includes upgrading the configuration of the system kernel and / or adjusting the IO scheduler and / or repairing the disk.
[0027] Another aspect of the present invention further provides a disk-based IO time consumption monitoring system, comprising:
[0028] A monitoring module is configured to monitor, in response to monitoring that the file system generates an IO request, the overall process of reading and writing data corresponding to the IO request to the disk through a monitoring program, the overall process sequentially including a system kernel processing process, an IO scheduler processing process, and a hardware processing process;
[0029] An IO time consumption module is configured to obtain the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process respectively during the monitoring process, and to determine whether each IO time consumption exceeds the corresponding preset threshold value; and
[0030] The alarm module is configured to issue corresponding alarm information in response to the time consumption of several IO items exceeding the corresponding preset thresholds.
[0031] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer program instructions, and the computer program instructions implement the above method when executed by a processor.
[0032] According to another aspect of the present invention, a computer device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and the computer program executes the above method when executed by the processor.
[0033] The present invention has at least the following beneficial technical effects:
[0034] The disk-based IO time consumption monitoring method of the present invention performs detailed positioning of the entire process from the file system generating an IO request to the corresponding data reading and writing to the physical disk, thereby monitoring the system kernel processing process, the IO scheduler processing process and the hardware processing process, and determines which process has a problem when the IO time consumption is high by monitoring its IO time consumption, thereby facilitating the provision of a corresponding solution and taking corresponding repair measures as early as possible to avoid causing a greater impact and ensure the normal reading and writing performance of the disk IO. 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 in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A schematic diagram of a disk-based IO time consumption monitoring method provided according to an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of a disk-based IO time consumption monitoring system provided according to an embodiment of the present invention;
[0038] Figure 3 A schematic diagram of a computer-readable storage medium for implementing a disk-based IO time consumption monitoring method according to an embodiment of the present invention;
[0039] Figure 4 The present invention is a schematic diagram of the hardware structure of a computer device that executes a disk-based IO time consumption monitoring method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0041] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are intended to distinguish two non-identical entities or non-identical parameters with the same name. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, other steps or units inherent to a process, method, system, product or device that includes a series of steps or units.
[0042] Based on the above purpose, a first aspect of an embodiment of the present invention provides an embodiment of a disk-based IO time consumption monitoring method. Figure 1 FIG. 2 is a schematic diagram of an embodiment of a disk-based IO time consumption monitoring method provided by the present invention. Figure 1 As shown, the embodiment of the present invention includes the following steps:
[0043] Step S10, in response to monitoring that the file system generates an IO request, the overall process of reading and writing data corresponding to the IO request to the disk is monitored by a monitoring program, and the overall process includes a system kernel processing process, an IO scheduler processing process, and a hardware processing process in sequence;
[0044] Step S20, during the monitoring process, the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process are respectively obtained, and it is determined whether the IO time consumption of each item exceeds the corresponding preset threshold value;
[0045] Step S30: In response to the time taken by a number of IO items exceeding the corresponding preset threshold, a corresponding alarm message is issued.
[0046] In the embodiment of the present invention, IO means data input / output. From the perspective of disk IO related principles, a disk block is the smallest storage unit for reading and writing the file system in the system, and a sector is the smallest storage unit for reading and writing the physical disk. When an IO request is generated from the file system to being written to the physical disk, it will go through multiple processing processes, among which the most important stages are as follows:
[0047] Q-Bio read and write requests are about to be generated (bio is a core data structure of the general block layer in the Linux kernel, which describes the IO operation of the block device and connects the memory buffer with the block device);
[0048] X – split IO request;
[0049] G – allocates and generates IO requests;
[0050] I – IO request enters the IO scheduling queue;
[0051] M – schedule and merge IO requests;
[0052] D-The final IO request is submitted to the driver;
[0053] C – The driver submits the IO request to the hardware to complete;
[0054] The Q to I process is mainly processed by the kernel in the system software layer (i.e., the system kernel processing process); the I to D process is processed by the IO scheduler (i.e., the IO scheduler processing process); and the D to C process is processed by the hardware layer (i.e., the hardware processing process).
[0055] The disk-based IO time consumption monitoring method of the embodiment of the present invention performs detailed positioning of the entire process from the file system generating an IO request to the corresponding data reading and writing to the physical disk, thereby monitoring the system kernel processing process, the IO scheduler processing process and the hardware processing process, and determines which specific process has a problem when the IO time consumption is high by monitoring its IO time consumption, thereby facilitating the provision of corresponding solutions and taking corresponding repair measures as soon as possible to avoid causing greater impact and ensure the normal read and write performance of the disk IO.
[0056] In some embodiments, the method further includes: dividing the overall process into a system kernel processing process, an IO scheduler processing process and a hardware processing process in sequence through a first tracing point function, a second tracing point function, a third tracing point function and a fourth tracing point function.
[0057] In some embodiments, obtaining the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process respectively during the monitoring process includes: in response to the system kernel processing process and the IO scheduler processing process processing the disk block of the disk, calling the first tracking point function, the second tracking point function and the third tracking point function in sequence, and recording the first calling time respectively; calculating the time difference between the first calling time of the first tracking point function and the second tracking point function as the IO time consumption of the system kernel processing process; calculating the time difference between the first calling time of the second tracking point function and the third tracking point function as the IO time consumption of the IO scheduler processing process; and in response to the hardware processing process processing the disk sector of the disk, calling the third tracking point function and the fourth tracking point function in sequence, and recording the second calling time respectively; calculating the time difference between the second calling time of the third tracking point function and the fourth tracking point function as the IO time consumption of the hardware processing process.
[0058] In some embodiments, the method further includes: in response to obtaining the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process, obtaining the name of the disk and the information of the disk block and disk sector, and outputting it to the monitoring result.
[0059] In some embodiments, the method further includes: setting a preset threshold corresponding to each IO time consumption based on the latency requirements of the business scenario.
[0060] In some embodiments, the method further includes: determining a corresponding repair strategy based on the corresponding alarm information.
[0061] In some embodiments, the repair strategy includes upgrading the configuration of the system kernel and / or adjusting the IO scheduler and / or repairing the disk.
[0062] The following is a specific embodiment of the disk-based IO time consumption monitoring method of the present invention:
[0063] 1. Deploy the Systemtap environment (Systemtap is a dynamic method for monitoring and tracking the operation of the running Linux kernel):
[0064] You need to install the following packages corresponding to the kernel version:
[0065] kernel-devel, kernel-debuginfo, kernel-debuginfo-common, gcc and systemtap.
[0066] 2. Use the built-in Systemtap program to write the disk IO time monitoring program IOTimeMonitoring.stp. It monitors the tracking point functions of the four stages Q, I, D, and C of the kernel processing IO requests from the file system generating IO requests to reading and writing physical disks. The four tracking point functions are as follows:
[0067] Q: trace_block_bio_queue (i.e. the first tracing point function);
[0068] I: trace_block_rq_insert (i.e., the second trace point function);
[0069] D: trace_block_rq_issue (i.e. the third trace point function);
[0070] C: trace_block_rq_complete (i.e. the fourth trace point function);
[0071] For the Q to I and I to D system software processing, the time consumed by the disk block is monitored. The monitoring program records the microsecond (us) system timestamp when the Q, I, and D tracking point functions are called each time a disk block is processed. The timestamp is obtained by calling the system function gettimeofday_us(), and the time difference between the two processes of Q to I and I to D is calculated. The two time differences are the time consumed by the two processes of Q to I and I to D.
[0072] For the hardware processing of D to C, the time consumed by the disk sector is monitored. The monitoring program records the microsecond system timestamp when the two tracking point functions D and C are called each time the disk sector is processed, and calculates the time difference of the D to C process. This time difference is the time consumed by the D to C process.
[0073] After obtaining the time consumption of Q to I, I to D and D to C processes, the request queue data structure request_queue is used to parse the disk name, disk block and disk sector information of the current call processing. At the same time, the system function ctime() is called to obtain the current system time, and this information and the time consumption of each IO are output to the monitoring results.
[0074] 3. During the monitoring process, time-consuming thresholds can be set for different business scenarios. When the situation exceeds the threshold, a timeout alarm is issued. For example, for scenarios requiring low latency, such as database applications, the threshold can be set lower. For scenarios that are not very sensitive to latency, the threshold can be set slightly higher to avoid frequent alarms.
[0075] 4. In the monitoring results, the time-consuming problems caused by the system kernel, IO scheduling strategy, or disk-related hardware (bad sectors or bad blocks) can be distinguished through the time-consuming processes of Q to I, I to D, and D to C, so as to take corresponding repair measures as soon as possible (configure and upgrade the kernel, adjust the IO scheduling strategy, upgrade disk-related drivers / firmware, isolate or repair bad blocks and bad sectors, or replace damaged disks, etc.) to avoid causing greater impact and ensure the normal read and write performance of disk IO.
[0076] Specific repair measures can be divided into:
[0077] For system kernel problems: you can try to adjust the energy-saving settings of the processor, PCIE, and operating system, upgrade the kernel patch, etc.
[0078] Regarding the IO scheduling policy issue: you can try to adjust the IO scheduling policy;
[0079] For disk-related hardware issues: you can try to upgrade the disk-related driver / firmware, isolate or repair related bad blocks and bad sectors, or replace the damaged disk, etc.
[0080] 5. Deploy and run the disk IO time consumption monitoring program IOTimeMonitoring.stp, and then display the monitoring results.
[0081] 6. You can compile the deployed disk IO time-consuming monitoring program IOTimeMonitoring.stp to generate an executable module file (such as a ko file). This module file can be put on other machines where the Systemtap environment is not deployed to run, which is convenient for deploying monitoring. You can directly run the module executable file on other machines to start monitoring.
[0082] This embodiment monitors the time consumption of disk blocks and sectors in the entire process from the file system generating IO requests to reading and writing physical disks, obtains the disk block and physical sector numbers with high reading and writing time consumption, sets high time consumption thresholds respectively, and issues an alarm when the situation exceeds the threshold. It can also distinguish whether the high time consumption problem is caused by the system kernel, IO scheduling strategy, or disk-related hardware (bad sectors or bad blocks), so as to take corresponding repair measures as soon as possible to avoid causing greater impact and ensure the normal reading and writing performance of disk IO.
[0083] The second aspect of the embodiment of the present invention also provides a disk-based IO time consumption monitoring system. Figure 2 FIG. 1 is a schematic diagram of an embodiment of a disk-based IO time-consuming monitoring system provided by the present invention. Figure 2 As shown, a disk-based IO time consumption monitoring system includes: a monitoring module 10, configured to respond to monitoring that a file system generates an IO request, and monitor the overall process of reading and writing data corresponding to the IO request to the disk through a monitoring program, the overall process sequentially including a system kernel processing process, an IO scheduler processing process, and a hardware processing process; an IO time consumption module 20, configured to obtain the IO time consumption of the system kernel processing process, the IO scheduler processing process, and the hardware processing process respectively during the monitoring process, and to determine whether each IO time consumption exceeds a corresponding preset threshold value; and an alarm module 30, configured to respond to a number of IO time consumption items exceeding a corresponding preset threshold value, and issue a corresponding alarm message.
[0084] The disk-based IO time consumption monitoring system of the embodiment of the present invention monitors the system kernel processing process, IO scheduler processing process and hardware processing process by performing detailed positioning of the entire process from the file system generating IO requests to the corresponding data reading and writing to the physical disk, and determines which specific process has a problem when the IO time consumption is high by monitoring its IO time consumption, thereby facilitating the provision of corresponding solutions and taking corresponding repair measures as soon as possible to avoid causing greater impact and ensure the normal read and write performance of the disk IO.
[0085] A third aspect of the embodiments of the present invention further provides a computer-readable storage medium. Figure 3 FIG. 1 is a schematic diagram of a computer-readable storage medium for implementing a disk-based IO time consumption monitoring method according to an embodiment of the present invention. Figure 3 As shown, the computer readable storage medium 3 stores computer program instructions 31. When the computer program instructions 31 are executed by the processor, the following steps are implemented:
[0086] In response to monitoring that the file system generates an IO request, the overall process of reading and writing data corresponding to the IO request to the disk is monitored by a monitoring program, and the overall process includes a system kernel processing process, an IO scheduler processing process, and a hardware processing process in sequence;
[0087] During the monitoring process, the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process is obtained respectively, and it is determined whether the IO time consumption of each item exceeds the corresponding preset threshold value;
[0088] In response to the time taken by a number of IO items exceeding the corresponding preset threshold, a corresponding alarm message is issued.
[0089] In some embodiments, the steps further include:
[0090] The overall process is divided into a system kernel processing process, an IO scheduler processing process and a hardware processing process in sequence through the first tracking point function, the second tracking point function, the third tracking point function and the fourth tracking point function.
[0091] In some embodiments, obtaining the IO time consumption of the system kernel processing process, the IO scheduler processing process, and the hardware processing process respectively during the monitoring process includes:
[0092] In response to the system kernel processing process and the IO scheduler processing process processing the disk block of the disk, the first tracking point function, the second tracking point function and the third tracking point function are called in sequence, and the first calling time is recorded respectively;
[0093] Calculate the time difference between the first call time of the first tracing point function and the first call time of the second tracing point function as the IO time consumed by the system kernel processing process;
[0094] Calculating the time difference between the first call time of the second tracing point function and the first call time of the third tracing point function as the IO time consumed by the IO scheduler processing process; and
[0095] In response to the hardware processing process processing the disk sector of the disk, the third tracking point function and the fourth tracking point function are called in sequence, and the second calling time is recorded respectively;
[0096] The time difference between the second calling time of the third tracing point function and the second calling time of the fourth tracing point function is calculated as the IO time consumption of the hardware processing process.
[0097] In some embodiments, the steps further include: in response to obtaining the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process, obtaining the name of the disk and the information of the disk block and disk sector, and outputting it to the monitoring result.
[0098] In some embodiments, the steps further include: setting preset thresholds corresponding to the time consumption of each IO based on the latency requirements of the business scenario.
[0099] In some embodiments, the step further includes: determining a corresponding repair strategy based on the corresponding alarm information.
[0100] In some embodiments, the repair strategy includes upgrading the configuration of the system kernel and / or adjusting the IO scheduler and / or repairing the disk.
[0101] It should be understood that, in the absence of conflict, all the embodiments, features and advantages described above for the disk-based IO time consumption monitoring method according to the present invention are also applicable to the disk-based IO time consumption monitoring system and storage medium according to the present invention.
[0102] A fourth aspect of the embodiments of the present invention further provides a computer device, including: Figure 4 The memory 402 and the processor 401 are shown, and the memory 402 stores a computer program, and when the computer program is executed by the processor 401, the method of any one of the above embodiments is implemented.
[0103] like Figure 4 FIG. 1 is a schematic diagram of the hardware structure of a computer device for executing a disk-based IO time consumption monitoring method provided by the present invention. Figure 4 Taking the computer device shown in FIG. 4 as an example, the computer device includes a processor 401 and a memory 402, and may also include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected via a bus or other means. Figure 4 The example of the bus connection is taken as an example. The input device 403 can receive input digital or character information, and generate key signal input related to user settings and function control of the disk-based IO time consumption monitoring system. The output device 404 can include display devices such as display screens.
[0104] The memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules corresponding to the disk-based IO time-consuming monitoring method in the embodiment of the present application. The memory 402 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created by the use of the disk-based IO time-consuming monitoring method, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0105] The processor 401 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 402, that is, implements the disk-based IO time consumption monitoring method of the above method embodiment.
[0106] Finally, it should be noted that the computer-readable storage medium (e.g., memory) herein may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. As an example and not by way of limitation, a nonvolatile memory may include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. A volatile memory may include a random access memory (RAM), which may act as an external cache memory. As an example and not by way of limitation, RAM may be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
[0107] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0108] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0109] It should be understood that, as used herein, the singular form "a" or "an" is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations of one or more of the items listed in association. The serial numbers of the embodiments disclosed in the above embodiments of the present invention are for description only and do not represent the advantages and disadvantages of the embodiments.
[0110] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A disk-based IO time-consuming monitoring method, It is characterized in that The following steps are involved: In response to monitoring that the file system generates an IO request, the overall process of reading and writing data corresponding to the IO request to the disk is monitored by a monitoring program, wherein the overall process sequentially includes a system kernel processing process, an IO scheduler processing process, and a hardware processing process; During the monitoring process, the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process are respectively obtained, and it is determined whether each IO time consumption exceeds the corresponding preset threshold value; In response to the time taken by several IO items exceeding the corresponding preset threshold, a corresponding alarm message is issued; The overall process is divided into the system kernel processing process, the IO scheduler processing process and the hardware processing process in sequence through a first tracing point function, a second tracing point function, a third tracing point function and a fourth tracing point function; The IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process is respectively obtained during the monitoring process, including: In response to the system kernel processing process and the IO scheduler processing process processing the disk block of the disk, the first tracking point function, the second tracking point function and the third tracking point function are called in sequence, and the first calling time is recorded respectively; Calculating a time difference between a first call time of the first tracing point function and a first call time of the second tracing point function as an IO time consumption of the system kernel processing process; Calculating a time difference between a first call time of the second tracing point function and a first call time of the third tracing point function as an IO time consumption of the IO scheduler processing process; and In response to the hardware processing procedure processing the disk sector of the disk, calling the third tracking point function and the fourth tracking point function in sequence, and recording the second calling time respectively; A time difference between the second calling time of the third tracing point function and the second calling time of the fourth tracing point function is calculated as the IO time consumption of the hardware processing process.
2. The method according to claim 1, It is characterized in that Also includes: In response to obtaining the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process, the name of the disk and the information of the disk block and the disk sector are obtained and output to the monitoring result.
3. The method according to claim 1, It is characterized in that Also includes: The preset thresholds corresponding to the time consumption of each IO are set based on the latency requirements of the business scenario.
4. The method according to claim 1, It is characterized in that Also includes: A corresponding repair strategy is determined based on the corresponding alarm information.
5. The method according to claim 4, It is characterized in that The repair strategy includes upgrading the configuration of the system kernel and / or adjusting the IO scheduler and / or repairing the disk.
6. A disk-based IO time-consuming monitoring system, It is characterized in that include: A monitoring module is configured to monitor, in response to monitoring that a file system generates an IO request, a total process of reading and writing data corresponding to the IO request to a disk through a monitoring program, wherein the total process includes a system kernel processing process, an IO scheduler processing process, and a hardware processing process in sequence; The IO time consumption module is configured to obtain the IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process respectively during the monitoring process, and to determine whether each IO time consumption exceeds the corresponding preset threshold value respectively; as well as An alarm module is configured to issue a corresponding alarm message in response to a number of IO times exceeding a corresponding preset threshold; The overall process is divided into the system kernel processing process, the IO scheduler processing process and the hardware processing process in sequence through the first tracking point function, the second tracking point function, the third tracking point function and the fourth tracking point function; The IO time consumption of the system kernel processing process, the IO scheduler processing process and the hardware processing process is respectively obtained during the monitoring process, including: In response to the system kernel processing process and the IO scheduler processing process processing the disk block of the disk, the first tracking point function, the second tracking point function and the third tracking point function are called in sequence, and the first calling time is recorded respectively; Calculating a time difference between a first call time of the first tracing point function and a first call time of the second tracing point function as an IO time consumption of the system kernel processing process; Calculating a time difference between a first call time of the second tracing point function and a first call time of the third tracing point function as an IO time consumption of the IO scheduler processing process; and In response to the hardware processing procedure processing the disk sector of the disk, calling the third tracking point function and the fourth tracking point function in sequence, and recording the second calling time respectively; A time difference between the second calling time of the third tracing point function and the second calling time of the fourth tracing point function is calculated as the IO time consumption of the hardware processing process.
7. A computer-readable storage medium, It is characterized in that Computer program instructions are stored, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.
8. A computer device comprising a memory and a processor, It is characterized in that The memory stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 5 is performed.
Citation Information
Patent Citations
Method for optimizing system performance by dynamically tracking IO processing path of storage system
CN101616174A
