Bandwidth prediction method and device based on solid state disk, equipment and medium
By obtaining the write amplification factor and reserved space of the solid-state drive and using a prediction model to accurately evaluate the IO bandwidth capability of the solid-state drive, the problem of being unable to evaluate IO bandwidth is solved, and the performance and data writing efficiency of the solid-state drive are optimized.
Patent Information
- Application Number
- CN202410465154.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-17
- Publication Date
- 2025-10-24
AI Technical Summary
In actual application scenarios, it is impossible to accurately assess the IO bandwidth capabilities of solid-state drives, resulting in the inability of storage software flow control to provide timely feedback, which in turn causes extremely high latency issues in online services.
By obtaining the write amplification factor and reserved space of the solid-state drive, calculating the bandwidth reduction ratio, and using the prediction model to predict the write amplification factor of the next time window, and then calculating the write bandwidth of the next time window, an accurate assessment of the SSD IO bandwidth capability can be achieved.
It achieves accurate assessment of the write bandwidth of solid-state drives, avoids increased write latency and long-tail problems, and optimizes the performance and data writing efficiency of solid-state drives.
Smart Images

Figure CN120832070A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, in particular to a bandwidth prediction method and device based on solid state disk, equipment and medium. BACKGROUND
[0002] At present, single machine storage and distributed storage face an important problem, that is, how to evaluate the IO bandwidth capacity of the solid state disk in the actual application scenario. Due to the existence of the garbage collection mechanism in the solid state disk, there is a great difference between the actual processing bandwidth and the nominal bandwidth in different write modes. Therefore, the write command processing capacity of the solid state disk cannot be accurately measured. This further leads to the fact that the traffic control of the storage software cannot be fed back in time. When the bandwidth decreases, the long tail problem of the write command will become uncontrollable, thereby causing the problem of ultra-high latency of online business. SUMMARY
[0003] Therefore, the embodiments of the present disclosure provide a bandwidth prediction method and device based on solid state disk, equipment and medium to solve the problem that the IO bandwidth capacity of the solid state disk cannot be accurately evaluated in the actual application scenario.
[0004] In a first aspect, the embodiments of the present disclosure provide a bandwidth prediction method based on solid state disk, which comprises:
[0005] obtaining a first write amplification factor of the solid state disk in a current time window;
[0006] calculating a bandwidth reduction ratio based on the first write amplification factor and an original write amplification factor, wherein the original write amplification factor is calculated according to the minimum reserved space of the solid state disk;
[0007] predicting a second write amplification factor of a next time window;
[0008] calculating a second write bandwidth of the next time window based on the first write bandwidth of the current time window, the bandwidth reduction ratio and the second write amplification factor.
[0009] The present disclosure can accurately evaluate the IO bandwidth capacity of the solid state disk by extracting the parameters of the solid state disk in the current time window and estimating the write bandwidth of the next time window, so as to better avoid the problems of increased write latency and long tail that may occur under the write bandwidth fluctuation of the solid state disk, and further optimize the performance and data write efficiency of the solid state disk.
[0010] In a second aspect, the embodiments of the present disclosure provide a bandwidth prediction device based on solid state disk, which comprises:
[0011] The acquisition module is configured to acquire a first write amplification factor of the solid state disk in a current time window.
[0012] The first calculation module is configured to calculate a bandwidth reduction ratio based on the first write amplification factor and an original write amplification factor, wherein the original write amplification factor is calculated according to a minimum reserved space of the solid state disk.
[0013] The prediction module is configured to predict a second write amplification factor of a next time window.
[0014] The second calculation module is configured to calculate a second write bandwidth of the next time window based on a first write bandwidth of the current time window, the bandwidth reduction ratio, and the second write amplification factor.
[0015] In a third aspect, an embodiment of the present disclosure provides a computer device, including a memory and a processor, which are communicatively connected with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the method in the first aspect or any of the corresponding implementation manners thereof.
[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the method in the first aspect or any of the corresponding implementation manners thereof. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the specific embodiments or the related art of the present disclosure, the drawings needed to be used in the specific embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present disclosure, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0018] Figure 1 is a flowchart of a bandwidth prediction method based on a solid state disk according to some embodiments of the present disclosure;
[0019] Figure 2 is a flowchart of a bandwidth prediction method based on a solid state disk according to some embodiments of the present disclosure;
[0020] Figure 3 is a structural block diagram of a bandwidth prediction device based on a solid state disk according to an embodiment of the present disclosure;
[0021] Figure 4 is a hardware structure schematic diagram of a computer device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] To make the purposes, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are some but not all of the embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present disclosure.
[0023] According to the embodiments of the present disclosure, a solid state disk based bandwidth prediction method, device, equipment and medium are provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.
[0024] In the present embodiment, a solid state disk based bandwidth prediction method is provided, Figure 1 is a flowchart of a solid state disk based bandwidth prediction method according to the embodiments of the present disclosure, as Figure 1 shown, the flow includes the following steps:
[0025] Step S101, obtaining a first write amplification factor of a solid state disk in a current time window.
[0026] In an embodiment of the present disclosure, first, a time window is set according to a preset time length. The time range in which the first write amplification factor of the solid state disk is desired to be obtained can be several seconds to several minutes. The write operation of the solid state disk is monitored. Commands such as "iostat" or "blktrace" can be used. For Windows system, the "Performance Monitor" tool can be used. All write requests in the current time window are filtered out from the monitored write operation. According to the time stamp or other related information, the write requests belonging to the current time window are extracted. For the write requests in the current time window, the write amplification factor is calculated, which is recorded as the first write amplification factor. The write amplification factor can be calculated by dividing the actual written data amount by the data amount submitted by the application.
[0027] Step S102, calculating a bandwidth reduction ratio based on the first write amplification factor and an original write amplification factor, wherein the original write amplification factor is calculated according to the minimum reserved space of the solid state disk.
[0028] In one embodiment of the present disclosure, the original write amplification factor is calculated according to the minimum reserved space of the solid state disk. The original write amplification factor can be calculated by dividing the actual amount of data written by the amount of data submitted by the application. The first write amplification factor and the original write amplification factor are compared to calculate the bandwidth reduction ratio. The bandwidth reduction ratio can be calculated by the following formula:
[0029] Bandwidth reduction ratio rate = (1 - first write amplification factor / original write amplification factor) x 100%.
[0030] Through the above steps, the bandwidth reduction ratio can be calculated according to the first write amplification factor and the original write amplification factor. The bandwidth reduction ratio reflects the degree of change in the bandwidth efficiency of the solid state disk from the initial state to the current state. A higher bandwidth reduction ratio indicates that the performance of the solid state disk has decreased significantly, and a lower bandwidth reduction ratio indicates that the performance of the solid state disk is relatively stable. These information can be used to evaluate the performance fluctuation of the solid state disk and optimize the performance of the storage system.
[0031] Step S103, predicting the second write amplification factor of the next time window.
[0032] In one embodiment of the present disclosure, the second write amplification factor of the next time window is predicted, specifically including the following steps: collecting write amplification factor data of previous time windows, analyzing historical data to determine the trend of write amplification factor. Statistical methods or time series analysis techniques can be used to identify any significant patterns or trends. According to the trend and pattern of historical data, a suitable prediction model is used to predict the write amplification factor of the next time window. The prediction model can be a simple linear regression model, a moving average model, an exponential smoothing model, etc. The historical data is input into the model using the determined prediction model, and the second write amplification factor waf of the next time window is predicted according to the output of the model. It should be noted that when predicting the write amplification factor, possible influencing factors such as load changes, hard disk health status, write mode changes, etc. should also be considered. These factors may cause changes in the write amplification factor, so they should be considered in the prediction model.
[0033] Step S104, calculating the second write bandwidth of the next time window based on the first write bandwidth of the current time window, the bandwidth reduction ratio, and the second write amplification factor.
[0034] In one embodiment of the present disclosure, the second write bandwidth of the next time window is calculated based on the first write bandwidth of the current time window, the bandwidth reduction ratio and the second write amplification factor, including: calculating the product between the first write bandwidth and the reduction ratio; calculating the second ratio between the product and the second write amplification factor, and taking the second ratio as the second write bandwidth of the next time window. Wherein the product between the first write bandwidth and the reduction ratio is B original The calculation formula of the second write bandwidth is as follows:
[0035]
[0036] The present disclosure can understand the influence degree of the write operation on the actual write speed under the current load by obtaining the first write amplification factor of the current time window. By comparing the first write amplification factor with the original write amplification factor calculated based on the minimum reserved space of the solid state disk, the bandwidth reduction ratio can be calculated. The bandwidth reduction ratio represents the influence degree of the use of the reserved space on the write bandwidth during the write data process. According to this ratio, the write bandwidth capability of the solid state disk under the current load can be more accurately evaluated. According to the obtained first write amplification factor and other related information, the second write amplification factor of the next time window can be predicted. In combination with the above information, the second write bandwidth of the next time window can be calculated based on the first write bandwidth of the current time window and the predicted second write amplification factor by using relevant algorithms and calculation formulas. In this way, the write bandwidth capability of the solid state disk in the next time window can be more accurately predicted. The technical scheme of the present disclosure can more comprehensively consider the characteristics and load conditions of the solid state disk, and can accurately evaluate the IO bandwidth capability of the solid state disk. In this way, the performance and applicable scenarios of the solid state disk can be better understood, and more reliable basis can be provided for system design and optimization.
[0037] Figure 2 FIG. 1 is a flowchart of a bandwidth prediction method based on a solid state disk according to an embodiment of the present disclosure, as shown in FIG. 1, the flow includes the following steps: Figure 2
[0038] Step S201, obtaining the first write amplification factor of the solid state disk in the current time window.
[0039] In one embodiment of the present disclosure, obtaining the first write amplification factor of the solid state disk in the current time window includes the following steps A1-A3:
[0040] Step a1, obtaining the reserved space of the current time window.
[0041] The current over-provisioning (OP) of the time window can be obtained through the spare value in SMART (Self-Monitoring, Analysis and Reporting Technology) or other extended SMART. SMART is a technology used to monitor and report the status of hard drives. It collects sensor data and indicators inside the hard drive to predict the health and failure risk of the hard drive. The spare value in SMART is a parameter in SMART attributes, usually representing the number of spare sectors remaining on the hard drive. Spare sectors are additional space used to replace damaged or unavailable sectors. Changes in the spare value can provide information about the health and availability of the hard drive. In addition to the spare value, SMART contains many other attributes and parameters, such as temperature, read / write error rate, disk rotation speed, etc. These attributes can be used to determine the working state and performance of the hard drive.
[0042] To obtain the current over-provisioning, specific SMART tools or software can be used to read the SMART data on the hard drive. These tools or software can connect to the hard drive and read its SMART attributes. When reading the SMART data, the spare value or other appropriate extended SMART parameters can be viewed to obtain information about the over-provisioning of the hard drive. This will help to assess the performance and health status of the hard drive, and identify potential problems or risks.
[0043] Step a2, calculate the sum value between the over-provisioning and the preset value.
[0044] Step a3, calculate the first ratio value between the sum value and the over-provisioning, and take the first ratio value as the first write amplification factor.
[0045] The specific calculation formula of the first write amplification factor is as follows: waf1 is the first write amplification factor, op1 is the over-provisioning of the current time window, and the preset value is 1.
[0046] Step S202, calculate the bandwidth reduction ratio based on the first write amplification factor and the original write amplification factor, wherein the original write amplification factor is calculated according to the minimum over-provisioning of the solid state disk.
[0047] The calculation formula of the original write amplification factor is as follows: waf2 is the original write amplification factor, and op2 is the minimum over-provisioning. The calculation formula of the bandwidth reduction ratio is as follows:
[0048] Step S203, predicting the second write amplification factor of the next time window.
[0049] In one embodiment of the present disclosure, the second write amplification factor of the next time window is predicted, including: obtaining the weight of the current time window, and predicting the second write amplification factor of the next time window based on the weight of the first write amplification factor and the weight.
[0050] wherein the specific calculation formula is In the formula, waf is the write amplification factor of the next time window, p(i) is the weight of the i-th time window, and waf(i) is the write amplification factor of the i-th time window. By obtaining the weight of the current time window, the write amplification factor in the current time window can be measured more finely. The weight can be calculated according to different factors, such as load, state of the flash memory chip, characteristics of the write request, etc. By considering these factors and assigning corresponding weights, the actual situation of the write amplification factor in the current time window can be better reflected.
[0051] Step S204, calculating the second write bandwidth of the next time window based on the first write bandwidth of the current time window, the bandwidth reduction ratio, and the second write amplification factor.
[0052] The present disclosure can understand the available space capacity of the solid state disk when processing the write operation by extracting the reserved space of the solid state disk. When the reserved space is small or has been used a lot, the write bandwidth can be limited, thereby causing the increase of the write latency and the decrease of the performance. By determining the write amplification parameter in the solid state disk, the data write efficiency of the solid state disk when processing the write operation can be understood. If the write amplification is high, the write bandwidth can be limited, causing the increase of the write latency and the decrease of the performance. By the two key parameters of the reserved space and the write amplification, the actual write bandwidth in the disk can be more accurately estimated. This helps the host to take corresponding strategies to avoid the increase of the write latency and the long tail problem when considering the factors of the write bandwidth fluctuation of the solid state disk. For example, the strategy and scheduling algorithm of the write operation can be adjusted, and the ordering and merging of the IO request can be optimized to maximize the use of the write bandwidth of the solid state disk and reduce the influence of the write latency and the performance decrease. In summary, by extracting the key parameters of the reserved space and the write amplification in the disk and estimating the actual write bandwidth in the disk, the increase of the write latency and the long tail problem that can occur under the write bandwidth fluctuation of the solid state disk can be better avoided, and the performance and data write efficiency of the solid state disk can be further optimized.
[0053] In one embodiment of the present disclosure, after the second write bandwidth of the next time window is calculated based on the first write bandwidth of the current time window, the bandwidth reduction ratio, and the second write amplification factor, the method further includes:
[0054] The second write bandwidth is compared with the preset bandwidth to obtain a comparison result; if the second write bandwidth is higher than the preset bandwidth, the IO request parameter of each IO request is increased to the first parameter value within the next time window; or if the second write bandwidth is lower than the preset bandwidth, the IO request parameter of each IO request is reduced to the second parameter value within the next time window, where the IO request parameter includes IO depth and total capacity.
[0055] Specifically, comparing the predicted write bandwidth for the next time window with the preset bandwidth yields the following comparison results: If the write bandwidth for the next time window is higher than the preset bandwidth, it indicates that the SSD's IO request parameters are set too low and cannot meet the expected write speed. To improve system efficiency, the IO request parameters for each IO request in the next time window can be increased to the first parameter value. This may include increasing the IO depth and total capacity to allow more data to be processed simultaneously.
[0056] If the write bandwidth of the next time window is lower than the preset bandwidth, it means that the current IO request parameters are set too high, resulting in the SSD being unable to achieve the expected write speed in the next time window. In order to adapt to the actual situation of the system, the IO request parameters of each IO request can be reduced to the second parameter value in the next time window. This may include reducing the IO depth and total capacity to reduce the load pressure on the system. By dynamically adjusting the IO request parameters, the SSD can be optimized according to the predicted write bandwidth to achieve better performance and efficiency. This dynamic adjustment strategy ensures that the system can maintain stable performance in different time windows while avoiding excessive or insufficient resource utilization.
[0057] In one embodiment of the present disclosure, after calculating the second write bandwidth of the next time window based on the first write bandwidth of the current time window, the bandwidth reduction ratio, and the second write amplification factor, the method further includes the following steps:
[0058] Step b1: Detect the actual write bandwidth in the next time window.
[0059] Within the current time window, record the start and end times of each write operation and calculate the total amount of data written. Divide the total amount of data by the duration of the time window to calculate the actual write bandwidth. For example, the write bandwidth can be calculated by dividing the total amount of data by the duration of the time window (in bytes / second).
[0060] Step b2: If the actual write bandwidth reaches the second write bandwidth, obtain the upper limit of the number of write commands in the next time window.
[0061] The obtaining of the upper limit of the number of write commands in the next time window comprises: obtaining an average size of the write commands; and calculating the upper limit of the number of write commands based on the second write bandwidth and the average size.
[0062] Specifically, in the current time window, the data amount of each write command is recorded, and the average size of all write commands is calculated. The average size can be obtained by accumulating the data amount of each write command and dividing by the total number of write commands. The second write bandwidth is compared with the average size to determine the upper limit of the number of write commands. This upper limit can be adjusted according to actual conditions. If the second write bandwidth is high, the upper limit of the number of write commands can be increased; if the second write bandwidth is low, the upper limit of the number of write commands can be reduced. The algorithm for calculating the upper limit of the number of write commands can be designed according to actual needs and constraints. The following is an example algorithm:
[0063] Suppose the second write bandwidth is B2 (unit: byte / s), and the average write command size is S (unit: byte). Let the upper limit of the number of write commands in the next time window to be controlled be C (integer). The upper limit of the number of write commands C can be calculated by the following formula: C = floor(B2 / S) where the floor() function returns the largest integer not greater than the given parameter. The upper limit of the number of write commands C obtained by calculation can control the number of write commands sent in the next time window to adapt to the preset write bandwidth and the capacity of the solid state disk resources.
[0064] Step b3, if the number of write commands in the next time window reaches the upper limit of the number of write commands, stop sending write commands.
[0065] When the number of write commands in the next time window reaches the upper limit of the number of write commands, the sending of write commands needs to be stopped to avoid exceeding the processing capacity and capacity of system resources. The sending of write commands can be stopped in the following ways:
[0066] In the next time window, count each sent write command to count the number of write commands. Compare the actual number of write commands with the preset upper limit of the number of write commands. If the actual number of write commands exceeds the upper limit of the number of write commands, further write command sending needs to be stopped. When the actual number of write commands reaches or exceeds the upper limit of the number of write commands, new write commands need to be stopped. This can be achieved by controlling the generation and sending logic of write commands, such as stopping the sending of write commands through conditional judgment or control signals. Stopping the sending of write commands is to protect the system from the risk of overload and resource depletion. At the same time, the parameters of write commands need to be reevaluated and adjusted in the next time window to better adapt to the actual situation and resource usage of the system. This can ensure that the system operates within a controllable range and provides stable performance and reliable data write operations.
[0067] A solid state disk based bandwidth prediction device is also provided in the embodiments, which is used to implement the above embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and contemplated.
[0068] The embodiments provide a solid state disk based bandwidth prediction device, as shown in the accompanying drawings, comprising: Figure 3
[0069] The obtaining module 31 is configured to obtain a first write amplification factor of the solid state disk in a current time window.
[0070] The first calculating module 32 is configured to calculate a bandwidth reduction ratio based on the first write amplification factor and an original write amplification factor, wherein the original write amplification factor is calculated according to a minimum reserved space of the solid state disk.
[0071] The prediction module 33 is configured to predict a second write amplification factor of a next time window.
[0072] The second calculating module 34 is configured to calculate a second write bandwidth of the next time window based on a first write bandwidth of the current time window, the bandwidth reduction ratio and the second write amplification factor.
[0073] In one embodiment of the present disclosure, the obtaining module is configured to obtain a reserved space of the current time window; calculate a sum value between the reserved space and a preset value; calculate a first ratio value between the sum value and the reserved space, and take the first ratio value as the first write amplification factor.
[0074] In one embodiment of the present disclosure, the prediction module is configured to obtain a weight corresponding to the current time window; predict the second write amplification factor of the next time window based on the first write amplification factor and the weight.
[0075] In one embodiment of the present disclosure, the second calculating module is configured to calculate a product between the first write bandwidth and the reduction ratio; calculate a second ratio value between the product and the second write amplification factor, and take the second ratio value as the second write bandwidth of the next time window.
[0076] In one embodiment of the present disclosure, the device further comprises a parameter updating module configured to obtain a comparison result by comparing the second write bandwidth with a preset bandwidth; if the second write bandwidth is higher than the preset bandwidth, increase an IO request parameter of each IO request to a first parameter value in the next time window; or, if the second write bandwidth is lower than the preset bandwidth, decrease the IO request parameter of each IO request to a second parameter value in the next time window, the IO request parameter comprising an IO depth and a total capacity.
[0077] In one embodiment of the present disclosure, the apparatus further includes: a control module including:
[0078] A detection unit, configured to detect an actual write bandwidth within a next time window;
[0079] an acquiring unit, configured to acquire an upper limit on the number of write commands in a next time window if the actual write bandwidth reaches the second write bandwidth;
[0080] The processing unit is configured to stop sending write commands if the number of write commands in the next time window reaches an upper limit of the number of write commands.
[0081] In one embodiment of the present disclosure, the acquiring unit is configured to acquire an average size of write commands; and calculate an upper limit on the number of write commands based on the second write bandwidth and the average size.
[0082] See also Figure 4 , Figure 4 is a structural diagram of a computer device provided by an optional embodiment of the present disclosure, such as Figure 4 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0083] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0084] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0085] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system and applications required by at least one function. The data storage area can store data created by the computer device according to the presentation of a small program landing page, and the like. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some optional embodiments, the memory 20 can optionally include a memory disposed remotely relative to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0086] The memory 20 can include a volatile memory, such as a random access memory, and can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state disk. The memory 20 can also include a combination of the above-mentioned kinds of memories.
[0087] The computer device also includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0088] The embodiments of the present disclosure also provide a computer readable storage medium. The method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or recorded in a storage medium, or implemented as computer code originally stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state disk, and the like. Further, the storage medium can also include a combination of the above-mentioned kinds of memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.
[0089] Although the embodiments of the present disclosure are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present disclosure, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A method for predicting bandwidth based on a solid state drive, characterized by, The method comprises: obtaining a first write amplification factor of a solid state disk in a current time window; calculating a bandwidth reduction ratio based on the first write amplification factor and an original write amplification factor, wherein the original write amplification factor is calculated according to a minimum reserved space of the solid state disk; predicting a second write amplification factor of a next time window; calculating a second write bandwidth of the next time window based on a first write bandwidth of the current time window, the bandwidth reduction ratio and the second write amplification factor.
2. The method of claim 1, wherein, The method comprises: obtaining a first write amplification factor of a solid state disk in a current time window; calculating a first ratio between the sum value and the reserved space, and taking the first ratio as the first write amplification factor. The method comprises:
3. The method of claim 1, wherein, obtaining a first write amplification factor of a solid state disk in a current time window; calculating a first ratio between the sum value and the reserved space, and taking the first ratio as the first write amplification factor. The method comprises:
4. The method of claim 1, wherein, calculating a second ratio between the product and the second write amplification factor, and taking the second ratio as the second write bandwidth of the next time window. After calculating the second write bandwidth of the next time window based on the first write bandwidth of the current time window, the bandwidth reduction ratio and the second write amplification factor, the method further comprises: comparing the second write bandwidth with a preset bandwidth to obtain a comparison result; 5. The method of claim 1, wherein, if the second write bandwidth is higher than the preset bandwidth, increasing an IO request parameter of each IO request to a first parameter value in the next time window; or, if the second write bandwidth is lower than the preset bandwidth, decreasing the IO request parameter of each IO request to a second parameter value in the next time window, the IO request parameter comprising an IO depth and a total capacity. After calculating the second write bandwidth of the next time window based on the first write bandwidth of the current time window, the bandwidth reduction ratio and the second write amplification factor, the method further comprises: detecting an actual write bandwidth in the next time window; 6. The method of claim 1, wherein, if the actual write bandwidth reaches the second write bandwidth, obtaining a write command number upper limit of the next time window; if a write command number in the next time window reaches the write command number upper limit, stopping sending a write command. The method comprises: obtaining an average size of a write command; 7. The method of claim 6, wherein, calculating the write command number upper limit based on the second write bandwidth and the average size. The device comprises: an obtaining module, configured to obtain a first write amplification factor of a solid state disk in a current time window; 8. A bandwidth prediction apparatus based on a solid state drive, characterized by, The first calculation module is configured to calculate a bandwidth reduction ratio based on the first write amplification factor and an original write amplification factor, wherein the original write amplification factor is calculated according to a minimum reserved space of the solid state disk; The prediction module is configured to predict a second write amplification factor of a next time window; The second calculation module is configured to calculate a second write bandwidth of the next time window based on the first write bandwidth of the current time window, the bandwidth reduction ratio and the second write amplification factor.
9. A computer device, comprising: The method comprises the following steps: A memory and a processor are connected in communication with each other, and the memory stores computer instructions; the processor executes the computer instructions to perform the method in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer instructions are stored on the computer readable storage medium, and the computer instructions are used to make the computer execute the method in any one of claims 1 to 7.