Method and device for adjusting IO access bandwidth for disk file system IO reading and writing

By obtaining write operation status information in the disk file system and dynamically adjusting IO access bandwidth, the Write Stall problem caused by write operations is solved, the performance of the disk file system is optimized, and the normal progress of read and write operations is ensured.

CN117742612BActive Publication Date: 2024-10-11ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311864574.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2024-10-11
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

In disk file systems, write operations often cause Write Stall, occupying excessive storage resources, causing delays and blocking in read and write operations.

Method used

By obtaining the status information of write operations in the disk file system, adjust the IO access bandwidth, and dynamically adjust the ratio of IO write bandwidth and IO read bandwidth to optimize write pauses and ensure the normal progress of read and write operations.

Benefits of technology

Effectively avoid or reduce Write Stall, improve the performance of the disk file system, ensure the normal progress of read and write operations, and improve system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117742612B_ABST
    Figure CN117742612B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide an IO access bandwidth adjustment method and device for disk file system IO reading and writing. In this method, the write operation status information of the disk file system when the data access device performs read and write operations in parallel can be obtained; in response to the write operation status information indicating that the IO access bandwidth of the data access device needs to be adjusted, the IO access bandwidth adjustment strategy is determined according to the write operation status information, the IO access bandwidth includes the IO write bandwidth and the IO read bandwidth, and the IO access bandwidth adjustment strategy is used to indicate the IO write bandwidth adjustment strategy; wherein, if the IO write bandwidth occupies more, the IO read bandwidth occupies less, and if the IO write bandwidth occupies less, the IO read bandwidth occupies more; and the IO access bandwidth of the data access device is adjusted according to the IO access bandwidth adjustment strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of database technology, and in particular, to a method and device for adjusting IO access bandwidth for disk file system IO reading and writing. Background Art

[0002] In a disk file system, such as an LSM-tree structured disk file system, both read and write operations require IO bandwidth. Among them, write operations such as flush operations and merge operations often require excessive storage resources, resulting in write stalls in the disk file system. Therefore, how to avoid or solve the write stall problem is an urgent problem to be solved. Summary of the invention

[0003] In view of the above, the embodiments of this specification provide a method and device for adjusting IO access bandwidth for disk file system IO reading and writing. In the embodiments of this specification, the IO access bandwidth is adjusted by writing operation status information to optimize write pauses, thereby ensuring normal reading and writing operations.

[0004] According to one aspect of an embodiment of the present specification, a method for adjusting IO access bandwidth for IO reading and writing of a disk file system is provided, comprising: obtaining write operation status information when a disk file system is read and written in parallel by a data access device, the write operation status information comprising write pause information; in response to the write operation status information indicating that the IO access bandwidth of the data access device needs to be adjusted, determining an IO access bandwidth adjustment strategy according to the write operation status information, the IO access bandwidth comprising an IO write bandwidth and an IO read bandwidth, the IO access bandwidth adjustment strategy being used to indicate an IO write bandwidth adjustment strategy; wherein, if the IO write bandwidth occupies more, the IO read bandwidth occupies less, and if the IO write bandwidth occupies less, the IO read bandwidth occupies more; and adjusting the IO access bandwidth of the data access device according to the IO access bandwidth adjustment strategy.

[0005] According to another aspect of an embodiment of the present specification, there is also provided an IO access bandwidth adjustment device for IO reading and writing of a disk file system, comprising: an information acquisition unit, which acquires write operation status information when a disk file system is read and written in parallel by a data access device, wherein the write operation status information comprises write pause information; a strategy determination unit, which determines an IO access bandwidth adjustment strategy according to the write operation status information in response to an indication by the write operation status information that the IO access bandwidth of the data access device needs to be adjusted, wherein the IO access bandwidth comprises an IO write bandwidth and an IO read bandwidth, and the IO access bandwidth adjustment strategy is used to indicate an IO write bandwidth adjustment strategy; wherein, if the IO write bandwidth occupies more, the IO read bandwidth occupies less, and if the IO write bandwidth occupies less, the IO read bandwidth occupies more; and a bandwidth adjustment unit, which adjusts the IO access bandwidth of the data access device according to the IO access bandwidth adjustment strategy.

[0006] According to another aspect of an embodiment of this specification, an electronic device is also provided, comprising: at least one processor, a memory coupled to the at least one processor, and a computer program stored on the memory, wherein the at least one processor executes the computer program to implement an IO access bandwidth adjustment method for disk file system IO reading and writing as described in any of the above. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] A further understanding of the nature and advantages of the embodiments of the present specification can be achieved by referring to the following drawings. In the drawings, similar components or features may have the same reference numerals.

[0008] Figure 1 A schematic diagram showing an example of an LSM-tree according to an embodiment of the present specification.

[0009] Figure 2 A flowchart of an example of a method for adjusting IO access bandwidth for disk file system IO reading and writing according to an embodiment of this specification is shown.

[0010] Figure 3 A schematic diagram showing an example of determining an IO access bandwidth adjustment strategy provided according to an embodiment of this specification.

[0011] Figure 4 A block diagram of an example of an IO access bandwidth adjustment device for disk file system IO reading and writing according to an embodiment of this specification is shown.

[0012] Figure 5 A block diagram of an electronic device for implementing an IO access bandwidth adjustment method according to an embodiment of this specification is shown. DETAILED DESCRIPTION

[0013] The subject matter described herein will be discussed below with reference to example implementations. It should be understood that the discussion of these implementations is only to enable those skilled in the art to better understand and implement the subject matter described herein, and is not a limitation of the scope of protection, applicability or examples set forth in the claims. The functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the embodiments of this specification. Various processes or components may be omitted, substituted or added to each example as needed. In addition, the features described relative to some examples may also be combined in other examples.

[0014] As used herein, the term "including" and its variations represent open terms, meaning "including but not limited to". The term "based on" means "based at least in part on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other definitions may be included below, whether explicit or implicit. Unless the context clearly indicates otherwise, the definition of a term is consistent throughout the specification.

[0015] In a disk file system, such as an LSM-tree structured disk file system, both read and write operations require IO bandwidth. Among them, write operations such as flush operations and merge operations often require excessive storage resources, resulting in write stalls in the disk file system. Therefore, how to avoid or solve the write stall problem is an urgent problem to be solved.

[0016] In view of the above, the embodiments of this specification provide an IO access bandwidth adjustment method and device for disk file system IO reading and writing. In the IO access bandwidth adjustment method, the write operation status information of the disk file system when the data access device performs read and write operations in parallel is obtained, and the write operation status information includes write pause information; in response to the write operation status information indicating that the IO access bandwidth of the data access device needs to be adjusted, the IO access bandwidth adjustment strategy is determined according to the write operation status information, the IO access bandwidth includes the IO write bandwidth and IO read bandwidth used by the read and write operations of the data access device, and the IO access bandwidth adjustment strategy is used to indicate the adjustment strategy of the IO write bandwidth; and the IO access bandwidth of the data access device is adjusted according to the IO access bandwidth adjustment strategy. In the embodiments of this specification, the IO access bandwidth is adjusted by writing the operation status information to optimize the write pause, thereby ensuring normal read and write operations.

[0017] The following describes in detail the IO access bandwidth adjustment method and device for disk file system IO reading and writing provided by the embodiments of this specification in conjunction with the accompanying drawings.

[0018] In the embodiments of this specification, the data access device can implement IO access to the disk file system through the IO interface, including read operations and write operations. The data access device can include devices such as computers, and the disk file system is a peripheral device. Both read operations and write operations need to occupy the bandwidth of the data access device, and the read operation and the write operation can share the bandwidth of the data access device. Based on this, the write operation can affect the read operation. For example, if the bandwidth occupied by the write operation is high, the bandwidth occupied by the read operation is low. Therefore, the read operation can be affected by controlling the write bandwidth of the write operation, for example, avoiding read delays, etc.

[0019] In one example, the disk file system may adopt a hierarchical storage structure, that is, the disk file system includes multiple data storage layers, each data storage layer has stored data, and each data storage layer is connected step by step, and the data in each data storage layer can be merged to the next layer for storage. The merge operation between each data storage layer is a write operation, which requires a certain amount of write bandwidth. In one example, the disk file system may include RocksDB, GeaBase, etc.

[0020] In one example, the disk file system may adopt a storage structure of LSM-tree (Log Structured Merge Tree). Figure 1 FIG. 2 shows a schematic diagram of an example of an LSM-tree according to an embodiment of the present specification. Figure 1 As shown, the memory in the data access device includes a tree structure, which can adopt an ordered data structure such as a sorted tree, a skip list or a TreeMap, so that it can be written sequentially from the memory to the disk file system. When the data access device performs a write operation on the disk file system, the data written to the disk file system is first written to the memory, and then flushed from the memory to the disk file system for storage. Specifically, when the data is written to the disk file system, the data is first written to the ordered data structure (MemTable) of the memory. When the data in the MemTable reaches a specified threshold, it can be converted into a read-only data structure (Immutable MemTable), and a new MemTable will be generated for subsequent data to continue to be written. Then, the data of the Immutable MemTable can be flushed (Flush) according to the strategy, and the Immutable MemTable can be flushed into an ordered storage file (SSTable) and stored in the first layer of the disk file system, that is, the first data storage layer.

[0021] The disk file system may include multiple data storage layers: the first data storage layer, the second data storage layer, ... the Nth data storage layer, which may be represented by Level 0, Level 1, ..., Level N, respectively. It can be considered that the top layer in the disk file system is the first data storage layer, which is used to connect to the memory and receive data written from the memory to the disk file system. In the following, Level 0 is used to represent the first data storage layer, and Level N is used to represent the Nth data storage layer for illustration.

[0022] The storage space of each level increases in order from Level 0 to Level N. For example, the storage space of Level 0 is 10MB, the storage space of Level 1 is 100MB, and the storage space of Level N is 1000MB. Each level can merge the data in the current data storage layer to the next adjacent data storage layer. Each data storage layer can be set with a merge threshold. When the data storage volume in each data storage layer reaches the corresponding merge threshold, the merge operation can be triggered to merge the data in the data storage layer to the next data storage layer.

[0023] In the embodiments of this specification, the data access device can perform read and write operations on the disk file system. Among them, the write operation may include a flush operation, a merge operation, etc. In addition, in the write operation, the data can be first written to the write-ahead log (WAL) in the disk file system, and then written to the MemTable in the memory. WAL can play the role of backing up data. When a crash occurs when the data is written to the memory, the data in the memory can be restored according to WAL. WAL corresponds to a MemTable. When the corresponding MemTable is destroyed after being dropped to the disk, a new WAL is generated.

[0024] In the read operation, the data can be read in the order from memory to disk file system. In the disk file system, the data can also be read in the order of levels, for example, from Level 0, Level 1 to Level N. Specifically, the MemTable in the memory can be read first. If there is no data, the Immutable MemTable in the memory can be read. If there is no data, the data in the disk file system can be read in the order from Level 0, Level 1 to Level N until the data to be read is found.

[0025] The embodiments of this specification are described using LSM-tree as an example. It should be noted that the embodiments of this specification can also be applied to other storage structures.

[0026] Figure 2 A flowchart of an example 200 of a method for adjusting IO access bandwidth for disk file system IO reading and writing according to an embodiment of this specification is shown.

[0027] like Figure 2 As shown, at 210, write operation status information may be obtained when a data access device performs read and write operations in parallel on a disk file system.

[0028] In an embodiment of the present specification, a data access device can perform read and write operations on a disk file system in parallel, and the IO write bandwidth occupied by the write operation and the IO read bandwidth occupied by the read operation can share the IO access bandwidth of the data access device. When the IO write bandwidth increases, the IO read bandwidth will decrease accordingly; when the IO write bandwidth decreases, the IO read bandwidth will increase accordingly. The bandwidth increase of the IO write bandwidth (or IO read bandwidth) can be equal to the bandwidth decrease of the IO read bandwidth (or IO write bandwidth).

[0029] In the embodiments of the present specification, the write operation status information may include write stall information, which may be used to indicate whether a write stall occurs. When a write stall occurs, it indicates that the IO write bandwidth is insufficient and the pressure on the disk file system is too high. The write stall may lead to actively restricting the write operation initiated by the data access device or stopping the write operation.

[0030] In one example, the write pause may be determined based on at least one of the following judgment conditions: the number of MemTables to be written to the disk file system reaches a first threshold, the storage data scale of the first data storage layer (L0 layer) reaches a second threshold, and the data scale of other data storage layers other than the first data storage layer to be merged reaches a third threshold. The merge operation tasks to be executed include merge operation tasks to be executed in all data storage layers in the disk file system, and the first data storage layer is located at the top of the hierarchical structure of the disk file system.

[0031] In this example, the data size in each data storage layer can be expressed as data volume or file number. Usually, the size of each file is the same, such as 64M. Therefore, the data volume in bytes and the file number in pieces can be converted to each other.

[0032] In one example, the write operation status information may also include write operation task quantity information, which is used to indicate the number of write operation tasks. The write operation tasks may include pending write operation tasks and executing write operation tasks, and the write operation tasks may include merge operations and flush operations (flush) of data from memory to disk file system, etc.

[0033] In one example, in addition to obtaining write operation status information, read operation status information may also be obtained. The read operation status information may include read delay information, which may be used to indicate whether there is a read delay. The read delay may be the delay caused by read operations such as seek, get, and next. The greater the read delay, the greater the load pressure of the disk file system. Therefore, the read delay may be used as an indicator to characterize the load pressure of the disk file system.

[0034] In one example, the p99 latency may be used to represent the read latency, so that the data access device may obtain the p99 latency as the read latency when performing an I / O read operation.

[0035] In one example, the write pause state and the number of write operation tasks and the read operation state in the write operation state can be monitored by a monitoring module in the disk file system, so that the write operation state information and the read operation state information can be obtained based on the monitored state. For example, in RocksDB, the write pause state and the number of write operation tasks and the read operation state can be monitored through RocksDB_stat_level.

[0036] In one example, an execution cycle may be set for adjusting the IO access bandwidth, and the IO access bandwidth may be adjusted according to the execution cycle. The bandwidth allocation operation may be performed in each execution cycle, so that the bandwidth allocation conditions of different execution cycles may be different. Each execution cycle may be set to be greater than the effective time required for writing data to the disk file system and less than the monitoring output cycle of the disk file system.

[0037] The effective time refers to the time required for data to take effect after being written to the disk file system. If the data is read again during the effective time when being written to the disk file system, the writing of the data may fail. In an example, the effective time required for data to be written to the disk file system may be 100ms. The monitoring output cycle for the disk file system is a customizable cycle for monitoring the entire disk file system. For example, the p99 latency can be monitored, and the monitoring data of the monitoring output cycle is used to present to the user. For example, the monitoring output cycle can be set to 5s, where s represents seconds.

[0038] For example, the execution cycle is within a valid interval that is greater than the effective duration of 100 ms and less than the monitoring output cycle of 5 s, so the execution cycle can be set to 200 ms.

[0039] In the above example, the write operation status information of the last execution cycle in the disk file system can be obtained. Specifically, at the end of each execution cycle, the bandwidth allocation operation for the next execution cycle can be started, and the next execution cycle is the current execution cycle of the bandwidth allocation operation, so that the write operation status information of the last execution cycle can be obtained to calculate the bandwidth adjustment amount of the current execution cycle.

[0040] When the write operation status information and the read operation status information need to be obtained, the write operation status information and the read operation status information of the previous execution cycle may be obtained.

[0041] At 220 , in response to the write operation status information indicating that the IO access bandwidth of the data access device needs to be adjusted, an IO access bandwidth adjustment strategy may be determined according to the write operation status information.

[0042] In an embodiment of the present specification, when the write pause information included in the write operation status information indicates the existence of a write pause, it can be determined that the IO access bandwidth of the data access device needs to be adjusted. In the case where the write operation status information also includes information on the number of write operation tasks, when the number of write operation tasks indicated by the information on the number of write operation tasks in the write operation status information is greater than a first predetermined threshold, it can be determined that the IO access bandwidth of the data access device needs to be adjusted. Among them, the first predetermined threshold can be customized. For example, when the first predetermined threshold is 0, it means that as long as there is a write operation task, it can be determined that the IO access bandwidth of the data access device needs to be adjusted. When the first predetermined threshold is 1, when the number of write operation tasks is greater than 1, it can trigger the adjustment of the IO access bandwidth of the data access device.

[0043] IO access bandwidth includes IO write bandwidth and IO read bandwidth, and IO write bandwidth and IO read bandwidth constitute IO access bandwidth. In the embodiment of this specification, the data access device can perform read and write operations on the disk file system, and the read and write operations compete for the use of IO write bandwidth and IO read bandwidth in the IO access bandwidth.

[0044] For the adjustment method of IO access bandwidth, you can adjust the proportion of IO write bandwidth and IO read bandwidth in IO access bandwidth, and adjust the bandwidth of IO write bandwidth and IO read bandwidth by adjusting the proportion. In addition, you can also adjust the bandwidth of IO write bandwidth or IO read bandwidth. When IO write bandwidth (IO read bandwidth) decreases, IO read bandwidth (IO write bandwidth) will increase accordingly.

[0045] The determined IO access bandwidth adjustment policy can be used to indicate the adjustment policy of the IO write bandwidth, for example, to indicate that the IO write bandwidth increases, decreases, or remains unchanged. When there is a write pause, in one example, the determined IO access bandwidth adjustment policy can indicate that the IO write bandwidth increases to optimize or even eliminate the write pause. In another example, when the IO write bandwidth has reached the maximum value allowed and the IO write bandwidth can no longer be increased, the determined IO access bandwidth adjustment policy can indicate that the current IO write bandwidth remains unchanged.

[0046] In one example, for the adjustment policy of IO access bandwidth, a bandwidth adjustment range may be set, the maximum value of the bandwidth adjustment range is less than the IO access bandwidth, and the minimum value is greater than a specified threshold, and the specified threshold may be a value greater than or equal to 0. The maximum value and the minimum value of the bandwidth adjustment range are used to limit the upper and lower limits of the IO write bandwidth and the IO read bandwidth.

[0047] For example, the IO write bandwidth can be taken as an object, and the proportion of the IO access bandwidth can be adjusted to determine the IO write bandwidth. For example, 20% of the IO access bandwidth is set as the minimum value of the IO write bandwidth adjustment range, and 80% of the IO access bandwidth is set as the maximum value of the IO write bandwidth adjustment range. Thus, the IO write bandwidth can be adjusted within the range of 20% to 80% of the IO access bandwidth.

[0048] In this example, by setting the bandwidth adjustment range and limiting the upper and lower limits of the adjustment, it is possible to avoid allocating the entire IO access bandwidth to one party, thereby causing the other party to have no IO bandwidth and be unable to perform corresponding operations.

[0049] In one example, in response to the write operation status information indicating the presence of a write pause, the IO bandwidth adjustment policy may be determined as a first adjustment policy, where the first adjustment policy is used to indicate that the IO write bandwidth is adjusted to a first predetermined bandwidth that is not lower than the current IO write bandwidth.

[0050] In one example, when the current IO write bandwidth is less than the maximum value of the adjustable range for the IO write bandwidth, the adjusted first predetermined bandwidth indicated by the first adjustment strategy is higher than the current IO write bandwidth, that is, the IO write bandwidth is increased on the basis of the current IO write bandwidth. By increasing the IO write bandwidth, write pauses are reduced or eliminated.

[0051] In one example, the first predetermined bandwidth adjusted by the determined first adjustment strategy may be the maximum value of the bandwidth adjustment range, so that the IO write bandwidth increases to the upper limit of the adjustable range, so that the IO write bandwidth reaches the maximum. For example, the bandwidth adjustment range for the IO access bandwidth is [10%, 80%], which means greater than or equal to 10% and less than or equal to 80%, and the ratio in the bandwidth adjustment range represents the proportion of the IO write bandwidth in the IO access bandwidth. The larger the ratio in the bandwidth adjustment range, the larger the IO write bandwidth. In response to the write operation status information indicating the presence of a write pause, the determined first adjustment strategy may indicate that the IO write bandwidth is adjusted to 80%.

[0052] When the current IO write bandwidth reaches the maximum value of the adjustable range for the IO write bandwidth, the current IO write bandwidth may be kept unchanged, and the first predetermined bandwidth indicated by the first adjustment strategy at this time is the current IO write bandwidth.

[0053] In one example, the write operation status information includes write pause information and write operation task quantity information. In response to the write operation status information indicating that there is no write pause and the number of write operation tasks exceeds a first predetermined threshold, the IO bandwidth adjustment strategy can be determined as a second adjustment strategy, and the second adjustment strategy is used to indicate that the IO write bandwidth is adjusted to a second predetermined bandwidth.

[0054] In this example, the first predetermined threshold can be customized. In one example, when the first predetermined threshold is 0, in response to the write operation status information indicating that there is no write pause and the number of write operation tasks exceeds 0, that is, as long as there is a write operation task, the second adjustment strategy can be determined.

[0055] The second predetermined bandwidth may not be higher than the first predetermined bandwidth. In one example, the adjusted second predetermined bandwidth may be equal to the first predetermined bandwidth. For example, the second predetermined bandwidth and the first predetermined bandwidth are both maximum values ​​within the adjustable range for the IO write bandwidth. That is, in response to the write operation status information indicating that there is no write pause and the number of write operation tasks exceeds the first predetermined threshold, the IO write bandwidth in the IO access bandwidth can be adjusted to the maximum. In another example, the second predetermined bandwidth is lower than the first predetermined bandwidth.

[0056] In addition, the second predetermined bandwidth indicated by the second adjustment strategy may not be lower than the current IO write bandwidth. In one example, when the current IO write bandwidth is less than the maximum value of the adjustable range for the IO write bandwidth, it indicates that the IO write bandwidth can be further increased, so that the IO write bandwidth is increased on the basis of the current IO write bandwidth, and the second predetermined bandwidth may be higher than the current IO write bandwidth. By increasing the IO write bandwidth, write pauses caused by write operations can be avoided.

[0057] In one example, when the current IO write bandwidth reaches the maximum value of the adjustable range for the IO write bandwidth, the current IO write bandwidth may be kept unchanged, and the second predetermined bandwidth indicated by the second adjustment policy at this time is the current IO write bandwidth.

[0058] In one example, the second adjustment strategy may include multiple second predetermined bandwidths, and the IO write bandwidth indicated by each second predetermined bandwidth is different. Thus, in response to the write operation status information indicating that there is no write pause and the number of write operation tasks exceeds the first predetermined threshold, the IO bandwidth adjustment strategy can be determined as the second adjustment strategy according to the number of write operation tasks. Different numbers of write operation tasks lead to different second adjustment strategies, and different second predetermined bandwidths indicated by different second adjustment strategies are also different.

[0059] In this example, the IO write bandwidth indicated by each second predetermined bandwidth is proportional to the number of write operation tasks, that is, the greater the number of write operation tasks, the greater the IO write bandwidth indicated by the determined second predetermined bandwidth.

[0060] In one example, the number of write operation tasks may be divided into gear intervals. The number values ​​may be divided continuously in order from small to large to obtain multiple number gear intervals. Each number gear interval includes at least one number value, each number value belongs to a number gear interval, and each number gear interval includes different number values. For example, number values ​​0 and 1 belong to the first number gear interval, number values ​​2 to 8 belong to the second number gear interval, and number values ​​greater than 8 belong to the third number gear interval.

[0061] In addition, the bandwidth adjustment range of the IO access bandwidth can also be divided into gears to obtain multiple different bandwidth gears, each bandwidth gear corresponds to a gear bandwidth adjustment value, and the gear bandwidth adjustment value can be expressed by the bandwidth value of the IO write bandwidth, and can also be expressed by the ratio value of the IO access bandwidth. The gear bandwidth adjustment values ​​corresponding to the multiple bandwidth gears are all within the bandwidth adjustment range. For example, the bandwidth adjustment range is from 10% to 80% of the IO access bandwidth. It can be divided into 4 gears, and the gear value corresponding to the first bandwidth gear as the minimum bandwidth can be 10%, the gear value corresponding to the second bandwidth gear can be 25%, the gear value corresponding to the third bandwidth gear can be 50%, and the gear value corresponding to the fourth bandwidth gear as the maximum bandwidth can be 80%.

[0062] In this example, each number gear interval for the number of write operation tasks can have a corresponding relationship with the bandwidth gear for the bandwidth to be adjusted, and each number gear interval can correspond to a bandwidth gear. Thus, the second adjustment strategy can be determined based on the corresponding relationship and the number of existing write operation tasks. Specifically, after determining the number of existing write operation tasks, the number gear interval to which the number belongs can be determined, and then the bandwidth gear corresponding to the number gear interval can be determined based on the corresponding relationship, and the second adjustment strategy can be determined based on the gear bandwidth adjustment value corresponding to the bandwidth gear.

[0063] In one example, each number gear interval for the number of write operation tasks can correspond to a bandwidth gear for the IO access bandwidth. When the number of write operation tasks belongs to the maximum number gear interval, the maximum number gear interval corresponds to the bandwidth gear of the maximum IO write bandwidth, so that it can be determined that the second predetermined bandwidth indicated by the second adjustment strategy is the maximum adjustable IO write bandwidth.

[0064] In another example, each number gear interval can correspond to other bandwidth gears in the bandwidth gear except the bandwidth gear with the largest IO write bandwidth. When the number of write operation tasks belongs to the largest number gear interval, the largest number gear interval corresponds to the second largest bandwidth gear of the IO write bandwidth, so that it can be determined that the second predetermined bandwidth indicated by the second adjustment strategy is the IO write bandwidth corresponding to the second largest gear bandwidth adjustment value.

[0065] In one example, a write operation task may include multiple different types of operation tasks, such as a flush operation and a merge operation. Different types of operation tasks may occupy different bandwidths. A weight for representing the bandwidth ratio required for each type of operation task may be set. The larger the weight corresponding to the operation task, the larger the bandwidth required for the operation task.

[0066] In this example, after determining the existing write operation tasks, the number of write operation tasks in the embodiment of this specification can be determined according to the actual number and weight of each write operation task. For example, the sum of the actual number of write operation tasks and the corresponding weight multiplied together can be used as the number of write operation tasks.

[0067] In one example, in response to the write operation status information indicating that there is no write pause and the write operation task data does not exceed the first predetermined threshold, the IO access bandwidth may not be adjusted.

[0068] In one example, when obtaining write operation status information and read operation status information when a disk file system is read and written in parallel by a data access device, read latency information included in the read operation status information may be used as one of the factors for determining an IO access bandwidth adjustment strategy.

[0069] Specifically, in response to the write operation status information indicating that there is no write pause and the write operation task data does not exceed the first predetermined threshold value, and the read operation status information indicating that there is a read delay, the IO bandwidth adjustment strategy can be determined as a third adjustment strategy, and the third adjustment strategy can be used to indicate that the IO write bandwidth is adjusted to a third predetermined bandwidth, and the third predetermined bandwidth is lower than the current IO write bandwidth. By reducing the IO write bandwidth, the IO read bandwidth is correspondingly increased to optimize the read delay.

[0070] In one example, a read latency threshold for read latency may be set. When the read latency reaches the read latency threshold, a third adjustment strategy may be implemented to increase the IO read bandwidth. When the read latency does not reach the read latency threshold, the current IO read bandwidth may be kept unchanged.

[0071] In one example, the read latency threshold may include a plurality of different sub-thresholds, each of which may correspond to a bandwidth gear, and the rules for bandwidth gear division in this example may be different from the gear division rules for the bandwidth adjustment range in the above example. For example, a sub-interval may be divided in the bandwidth adjustment range as the bandwidth interval for gear division in this example, and the sub-interval is within the bandwidth adjustment range and is located within an interval within the bandwidth adjustment range indicating a relatively small IO write bandwidth, for example, the sub-interval is in the range of 10% to 20% of the IO access bandwidth that characterizes the IO write bandwidth. Then, the bandwidth interval may be divided into gears to ensure that the range of the increase in the IO read bandwidth will not affect the write operation, let alone cause a write pause.

[0072] In one example, the write operation in the disk file system also includes a delete operation. When there is an operation delay when the data access device performs a delete operation on the disk file system, an IO access bandwidth adjustment strategy can be determined to increase the IO write bandwidth. The increase in IO write bandwidth can allow the delete operation to be performed smoothly, reducing or eliminating the operation delay.

[0073] Figure 3 A schematic diagram of an example 300 of determining an IO access bandwidth adjustment strategy provided according to an embodiment of this specification is shown.

[0074] like Figure 3 As shown, first, it can be determined whether there is a write pause, and if so, a first adjustment strategy can be determined. If not, it can continue to determine whether the number of write operation tasks exceeds a first predetermined threshold.

[0075] If the number of write operation tasks exceeds the first predetermined threshold, a second adjustment strategy may be determined. If it does not exceed the first predetermined threshold, it may be determined whether there is a read delay. If there is a read delay, a third adjustment strategy may be determined. If there is no read delay, the IO access bandwidth may not be adjusted.

[0076] Back to Figure 2 At 230, the IO access bandwidth of the data access device may be adjusted according to the IO access bandwidth adjustment policy.

[0077] In one example, in the storage structure of LSM-tree, the write operation task may include a flush operation task and a merge operation task. The merge operation task is used to merge the data in each data storage layer and store it in the next data storage layer to release the storage space of the data storage layer. The merge operation task can be determined based on the amount of storage data in the data storage layer in the disk file system. In the disk file system, the merge operation task of each data storage layer may be only related to the amount of storage data in the data storage layer, and thus only determined based on the amount of storage data in the data storage layer.

[0078] For example, a corresponding upper threshold value may be set for each data storage layer. When the amount of stored data in the data storage layer reaches the upper threshold value, a merge task may be triggered. In one example, a corresponding lower threshold value may also be set. When there is a merge operation task in the data storage layer, and the amount of stored data in the data storage layer reaches the lower threshold value after the merge operation, the merge operation task that has not been executed may be deleted, and the merge operation may be stopped.

[0079] In one example, in a disk file system, data may be stored in each data storage layer, and the storage space of each data storage layer increases in order from top to bottom, such as Figure 1 Therefore, in one case, the amount of stored data in each data storage layer increases from top to bottom, so that the stored data in each data storage layer can form a hierarchical storage data tree.

[0080] The tree shape of the hierarchical storage data tree can change with the amount of stored data in each data storage layer. For example, when the amount of stored data in each data storage layer increases from top to bottom, the tree shape presented by the hierarchical storage data tree gradually increases from the top of the tree to the bottom.

[0081] The tree perfection of the hierarchical storage data tree can characterize the state of the tree of the hierarchical storage data tree. The tree perfection can be determined based on the relative difference between the amount of storage data in each data storage layer. For example, if the difference between the amount of storage data in two adjacent data storage layers is within a specified difference range, it can be determined that the two data storage layers belong to a perfect tree structure that constitutes a part of the perfect tree.

[0082] In one example, a corresponding task triggering threshold may be set for each data storage layer, and the task triggering threshold is used to trigger a merge operation task. When the amount of stored data in a data storage layer reaches the task triggering threshold, a merge operation task may be triggered for the data storage layer to merge the stored data in the data storage layer into the next data storage layer, thereby reducing the amount of stored data in the data storage layer to make the tree shape perfect.

[0083] In this example, the dynamically adjusted task triggering threshold may be adjusted based on the tree perfection of the hierarchical storage data tree of the disk file system.

[0084] For each data storage layer, when the amount of stored data in the data storage layer is too large, the difference in the amount of stored data between the data storage layer and the next adjacent data storage layer is small, resulting in an imperfect tree shape of the hierarchical storage data tree. In this case, when the amount of stored data in the data storage layer has not reached the current task triggering threshold, the task triggering threshold can be reduced to be lower than the current amount of stored data to trigger the execution of the merge operation task.

[0085] In another example, the number of merge operation tasks of the data storage layer can also be adjusted based on the tree perfection. For each data storage layer, when the amount of stored data in the data storage layer reaches the task triggering threshold, on the basis of triggering the merge operation task, the number of merge operation tasks can be further adjusted according to the tree perfection.

[0086] In this example, for each data storage layer, the more the amount of storage data in the data storage layer exceeds the task trigger threshold, the more imperfect the tree shape caused by the storage data of the data storage layer. Therefore, the number of merge operation tasks for the data storage layer can be increased to reduce the amount of storage data in the data storage layer through merge operation tasks.

[0087] Figure 4 A block diagram of an example of an IO access bandwidth adjustment device 400 for disk file system IO reading and writing according to an embodiment of this specification is shown.

[0088] like Figure 4 As shown, the IO access bandwidth adjustment device 400 includes: an information acquisition unit 410 , a policy determination unit 420 and a bandwidth adjustment unit 430 .

[0089] The information acquisition unit 410 may be configured to acquire write operation status information when the disk file system is read and written in parallel by the data access device, and the write operation status information includes write pause information.

[0090] The strategy determination unit 420 can be configured to determine the IO access bandwidth adjustment strategy according to the write operation status information in response to the indication of the need to adjust the IO access bandwidth of the data access device in the write operation status information, the IO access bandwidth includes the IO write bandwidth and the IO read bandwidth, and the IO access bandwidth adjustment strategy is used to indicate the IO write bandwidth adjustment strategy; wherein, if the IO write bandwidth occupies more, the IO read bandwidth occupies less, and if the IO write bandwidth occupies less, the IO read bandwidth occupies more.

[0091] The bandwidth adjustment unit 430 may be configured to adjust the IO access bandwidth of the data access device according to the IO access bandwidth adjustment policy.

[0092] In one example, the policy determination unit 420 can be configured to: in response to the write operation status information indicating the presence of a write pause, determine the IO bandwidth adjustment policy as a first adjustment policy, the first adjustment policy being used to indicate that the IO write bandwidth is adjusted to a first predetermined bandwidth, and the first predetermined bandwidth is not lower than the current IO write bandwidth.

[0093] In one example, the write operation status information also includes information on the number of write operation tasks, and the strategy determination unit 420 can also be configured to: in response to the write operation status information indicating that there is no write pause and the number of write operation tasks exceeds a first predetermined threshold, determine the IO bandwidth adjustment strategy as a second adjustment strategy, and the second adjustment strategy is used to indicate that the IO write bandwidth is adjusted to a second predetermined bandwidth, and the second predetermined bandwidth is not higher than the first predetermined bandwidth.

[0094] In one example, the information acquisition unit 410 may be configured to: acquire write operation status information and read operation status information when the disk file system is read and written by the data access device in parallel, and the read operation status information includes read latency information. The strategy determination unit 420 may also be configured to: in response to the write operation status information indicating that there is no write pause and the write operation task data does not exceed the first predetermined threshold and the read operation status information indicating that there is a read latency, determine the IO bandwidth adjustment strategy as a third adjustment strategy, the third adjustment strategy is used to indicate that the IO write bandwidth is adjusted to a third predetermined bandwidth, and the third predetermined bandwidth is lower than the current IO write bandwidth.

[0095] Reference above Figures 1 to 4 , an embodiment of an IO access bandwidth adjustment method and device for disk file system IO reading and writing according to an embodiment of this specification is described.

[0096] The IO access bandwidth adjustment device for disk file system IO reading and writing in the embodiment of this specification can be implemented by hardware, or by software or a combination of hardware and software. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the device where it is located reading the corresponding computer program instructions in the memory into the memory and running it. In the embodiment of this specification, the IO access bandwidth adjustment device for disk file system IO reading and writing can be implemented by electronic equipment, for example.

[0097] Figure 5 A block diagram of an electronic device 500 for implementing an IO access bandwidth adjustment method according to an embodiment of this specification is shown.

[0098] like Figure 5 As shown, the electronic device 500 may include at least one processor 510, a memory (e.g., a non-volatile memory) 520, a storage 530, and a communication interface 540, and the at least one processor 510, the storage 520, the storage 530, and the communication interface 540 are connected together via a bus 550. At least one processor 510 executes at least one computer-readable instruction stored or encoded in the memory (i.e., the above-mentioned element implemented in the form of software).

[0099] In one embodiment, computer executable instructions are stored in a memory, which, when executed, cause at least one processor 510 to: obtain write operation status information when a disk file system is executed by a data access device in parallel to perform read and write operations, the write operation status information including write pause information; in response to the write operation status information indicating that the IO access bandwidth of the data access device needs to be adjusted, determine an IO access bandwidth adjustment strategy according to the write operation status information, the IO access bandwidth including the IO write bandwidth and the IO read bandwidth, and the IO access bandwidth adjustment strategy is used to indicate the IO write bandwidth adjustment strategy; wherein, if the IO write bandwidth occupies more, the IO read bandwidth occupies less, and if the IO write bandwidth occupies less, the IO read bandwidth occupies more; and adjust the IO access bandwidth of the data access device according to the IO access bandwidth adjustment strategy.

[0100] It should be understood that the computer executable instructions stored in the memory, when executed, cause at least one processor 510 to perform the above combined operations in various embodiments of the present specification. Figure 1-4 Describes the various operations and functions.

[0101] According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (i.e., the above-mentioned elements implemented in the form of software), which, when executed by a machine, causes the machine to perform the above-mentioned combination of various embodiments of this specification. Figure 1-4 Describes the various operations and functions.

[0102] Specifically, a system or device equipped with a readable storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer or processor of the system or device can read and execute instructions stored in the readable storage medium.

[0103] In this case, the program code itself read from the machine-readable medium can realize the function of any one of the above-mentioned embodiments, and thus the machine-readable code and the machine-readable storage medium storing the machine-readable code constitute a part of the present invention.

[0104] The computer program code required for the operation of each part of this specification can be written in any one or more programming languages, including object-oriented programming languages, such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB, NET and Python, conventional procedural programming languages ​​such as C language, Visual Basic 2003, Perl, COBOL 2002, PHP and ABAP, dynamic programming languages ​​such as Python, Ruby and Groovy, or other programming languages. The program code can be run on the user's computer, or run on the user's computer as an independent software package, or run partly on the user's computer and another part on the remote computer, or all on the remote computer or server. In the latter case, the remote computer can be connected to the user's computer through any network form, such as a local area network (LAN) or a wide area network (WAN), or connected to an external computer (e.g., via the Internet), or in a cloud computing environment, or used as a service, such as software as a service (SaaS).

[0105] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or a cloud via a communication network.

[0106] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0107] Not all steps and units in the above-mentioned processes and system structure diagrams are necessary, and some steps or units can be ignored according to actual needs. The execution order of each step is not fixed and can be determined according to needs. The device structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.

[0108] The term "exemplary" as used throughout this specification means "serving as an example, instance, or illustration" and does not imply "preferred" or "advantageous" over other embodiments. The detailed description includes specific details for the purpose of providing an understanding of the described techniques. However, the techniques may be implemented without these specific details. In some instances, in order to avoid obscuring the concepts of the described embodiments, well-known structures and devices are shown in block diagram form.

[0109] The optional implementation modes of the embodiments of the present specification are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present specification are not limited to the specific details in the above implementation modes. Within the technical concept of the embodiments of the present specification, various simple modifications can be made to the technical solutions of the embodiments of the present specification, and these simple modifications all belong to the protection scope of the embodiments of the present specification.

[0110] The above description of the contents of this specification is provided to enable any person of ordinary skill in the art to implement or use the contents of this specification. Various modifications to the contents of this specification will be apparent to those of ordinary skill in the art, and the general principles defined herein may be applied to other variations without departing from the scope of protection of the contents of this specification. Therefore, the contents of this specification are not limited to the examples and designs described herein, but are consistent with the widest range of principles and novel features disclosed herein.

Claims

1. A method for adjusting IO access bandwidth for disk file system IO reading and writing, include: Acquire write operation status information when the disk file system is executed by the data access device in parallel for reading and writing operation tasks, wherein the write operation status information includes write pause information and write operation task quantity information; In response to the write operation status information indicating that the IO access bandwidth of the data access device needs to be adjusted, determining an IO access bandwidth adjustment strategy according to the write operation status information, the IO access bandwidth including an IO write bandwidth and an IO read bandwidth, the IO access bandwidth adjustment strategy being used to indicate an adjustment strategy for the IO write bandwidth, the read / write operation tasks competing for the use of the IO write bandwidth and the IO read bandwidth in the IO access bandwidth; as well as Adjust the IO access bandwidth of the data access device according to the IO access bandwidth adjustment strategy, Wherein, determining the IO access bandwidth adjustment strategy according to the write operation status information includes: In response to the write operation status information indicating that there is a write pause, determining the IO access bandwidth adjustment strategy as a first adjustment strategy, wherein the first adjustment strategy is used to indicate that the IO write bandwidth is adjusted to a first predetermined bandwidth, and the first predetermined bandwidth is not lower than the current IO write bandwidth, In response to the write operation status information indicating that there is no write pause and the number of write operation tasks exceeds a first predetermined threshold, the IO access bandwidth adjustment strategy is determined as a second adjustment strategy, where the second adjustment strategy is used to indicate that the IO write bandwidth is adjusted to a second predetermined bandwidth, and the second predetermined bandwidth is not higher than the first predetermined bandwidth, Among them, the disk file system adopts the storage structure of LSM-tree, the write operation task includes a flush operation task and a data storage layer merge operation task, and the task triggering threshold of the merge operation task is adjusted based on the tree perfection of the layered storage data tree of the disk file system.

2. The IO access bandwidth adjustment method according to claim 1, in, The write operation status information obtained when the disk file system is read and written by the data access device in parallel includes: Acquire write operation status information and read operation status information when the disk file system is read and written by the data access device in parallel, wherein the read operation status information includes read delay information, Determining the IO access bandwidth adjustment strategy according to the write operation status information also includes: In response to the write operation status information indicating that there is no write pause and the number of write operation tasks does not exceed a first predetermined threshold, and the read operation status information indicating that there is a read delay, the IO access bandwidth adjustment strategy is determined as a third adjustment strategy, and the third adjustment strategy is used to indicate that the IO write bandwidth is adjusted to a third predetermined bandwidth, and the third predetermined bandwidth is lower than the current IO write bandwidth.

3. The IO access bandwidth adjustment method according to claim 1 or 2, in, The write pause indicated by the write pause information is determined based on at least one of the following judgment conditions: the number of MemTables to be written to the disk file system reaches a first threshold, the scale of stored data in the first data storage layer reaches a second threshold, and the scale of data to be merged in other data storage layers except the first data storage layer reaches a third threshold; wherein, the first data storage layer is located at the topmost layer of the hierarchical structure of the disk file system.

4. The IO access bandwidth adjustment method according to claim 3, in, The merge operation task is determined based on the amount of storage data in the data storage tier in the disk file system.

5. The IO access bandwidth adjustment method according to claim 1, in, The number of the merge operation tasks is adjusted based on the tree perfection.

6. The IO access bandwidth adjustment method according to claim 2, in, The monitoring module in the disk file system monitors the write pause status, the number of write operation tasks and the read delay status.

7. An IO access bandwidth adjustment device for disk file system IO reading and writing, include: An information acquisition unit, which acquires write operation status information when the disk file system is executed by the data access device in parallel for reading and writing operation tasks, wherein the write operation status information includes write pause information and information on the number of write operation tasks; a strategy determination unit, in response to the write operation status information indicating that the IO access bandwidth of the data access device needs to be adjusted, determining an IO access bandwidth adjustment strategy according to the write operation status information, the IO access bandwidth including an IO write bandwidth and an IO read bandwidth, the IO access bandwidth adjustment strategy being used to indicate an adjustment strategy for the IO write bandwidth, the read / write operation tasks competing for use of the IO write bandwidth and the IO read bandwidth in the IO access bandwidth; and a bandwidth adjustment unit, adapted to adjust the IO access bandwidth of the data access device according to the IO access bandwidth adjustment strategy; Wherein, the strategy determination unit is configured as follows: In response to the write operation status information indicating that there is a write pause, determining the IO access bandwidth adjustment strategy as a first adjustment strategy, wherein the first adjustment strategy is used to indicate that the IO write bandwidth is adjusted to a first predetermined bandwidth, and the first predetermined bandwidth is not lower than the current IO write bandwidth, In response to the write operation status information indicating that there is no write pause and the number of write operation tasks exceeds a first predetermined threshold, the IO access bandwidth adjustment strategy is determined as a second adjustment strategy, where the second adjustment strategy is used to indicate that the IO write bandwidth is adjusted to a second predetermined bandwidth, and the second predetermined bandwidth is not higher than the first predetermined bandwidth, Among them, the disk file system adopts the storage structure of LSM-tree, the write operation task includes a flush operation task and a data storage layer merge operation task, and the task triggering threshold of the merge operation task is adjusted based on the tree perfection of the layered storage data tree of the disk file system.

8. The IO access bandwidth adjustment device according to claim 7, in, The information acquisition unit is configured as follows: Acquire write operation status information and read operation status information when the disk file system is read and written by the data access device in parallel, wherein the read operation status information includes read delay information, The strategy determination unit is further configured to: In response to the write operation status information indicating that there is no write pause and the number of write operation tasks does not exceed a first predetermined threshold, and the read operation status information indicating that there is a read delay, the IO access bandwidth adjustment strategy is determined as a third adjustment strategy, and the third adjustment strategy is used to indicate that the IO write bandwidth is adjusted to a third predetermined bandwidth, and the third predetermined bandwidth is lower than the current IO write bandwidth.

9. An electronic device, include: At least one processor, a memory coupled to the at least one processor, and a computer program stored in the memory, wherein the at least one processor executes the computer program to implement the IO access bandwidth adjustment method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and apparatus for controlling reading and writing of storage device

    CN108762665A

  • A flow control method and device for data migration bandwidth of a solid state hard disk

    CN109032503A

  • Write strategy adjustment method for cache, cache device and computing equipment

    CN114297100A

  • Device and method for detection and processing of stalled data request

    US20080114909A1

  • Dynamic memory bandwidth allocation

    US20120195192A1