Method, system, equipment and medium for optimizing performance consistency of solid state disk

文档序号:1815423 发布日期:2021-11-09 浏览:4次 中文

阅读说明:本技术 一种固态硬盘的性能一致性优化方法、系统、设备及介质 (Method, system, equipment and medium for optimizing performance consistency of solid state disk ) 是由 赵金 刘哲 王鑫 张乾坤 于 2021-06-29 设计创作,主要内容包括:本发明公开了一种固态硬盘的性能一致性优化方法、系统、设备及介质,方法包括:获取当前固态硬盘的第一HOST写速度和GC写速度,并基于所述第一HOST写速度和所述GC写速度判断所述固态硬盘的读写压力是否触发预设条件;若是所述读写压力触发预设条件,则获取第二HOST写速度、写放大以及空闲块数量;基于所述第二HOST写速度、所述写放大以及所述空闲块数量,得到所述固态硬盘的优化GC写速度;将所述GC写速度限制为所述优化GC写速度以优化固态硬盘的性能一致性。通过本发明的方案,使固态硬盘提供BLOCK的速度等于消耗BLOCK的速度,实现方式简单且提高了固态硬盘的性能一致性。(The invention discloses a method, a system, equipment and a medium for optimizing the performance consistency of a solid state disk, wherein the method comprises the following steps: acquiring a first HOST write speed and a GC write speed of a current solid state disk, and judging whether the read-write pressure of the solid state disk triggers a preset condition or not based on the first HOST write speed and the GC write speed; if the read-write pressure triggers a preset condition, acquiring a second HOST write speed, write amplification and the number of idle blocks; obtaining an optimized GC writing speed of the solid state disk based on the second HOST writing speed, the write amplification and the idle block number; and limiting the GC writing speed to the optimized GC writing speed so as to optimize the performance consistency of the solid state disk. By the scheme of the invention, the speed of the solid state disk for providing the BLOCK is equal to the speed of the BLOCK for consuming the BLOCK, the implementation mode is simple, and the performance consistency of the solid state disk is improved.)

1. A method for optimizing performance consistency of a solid state disk is characterized by comprising the following steps:

acquiring a first HOST write speed and a GC write speed of a current solid state disk, and judging whether the read-write pressure of the solid state disk triggers a preset condition or not based on the first HOST write speed and the GC write speed;

if the read-write pressure triggers a preset condition, acquiring a second HOST write speed, write amplification and the number of idle blocks;

obtaining an optimized GC writing speed of the solid state disk based on the second HOST writing speed, the write amplification and the idle block number;

limiting the GC write speed to the optimized GC write speed to optimize the performance consistency of the solid state disk.

2. The method of claim 1, wherein the determining whether the read-write pressure of the solid state disk triggers a preset condition based on the first HOST write speed and the GC write speed comprises:

and judging whether the difference between the first HOST write speed and the GC write speed is larger than a threshold value.

3. The method of claim 1, wherein said obtaining a second HOST write speed comprises:

acquiring the second HOST write quantity in unit time through a timer.

4. The method of claim 1, wherein obtaining write amplification comprises:

acquiring historical effective data of a preset threshold;

obtaining effective data ratio based on the effective data;

and obtaining the write amplification based on the effective data ratio.

5. The method of claim 4, wherein deriving the write amplification based on the valid data fraction comprises:

obtaining the write amplification based on the effective data fraction according to the following formula:

WA=(1+1/(1-R)*R)/1

wherein WA is write amplification, and R is effective data ratio.

6. The method of claim 1, wherein deriving the optimized GC write speed for the solid state disk based on the second HOST write speed, the write amplification, and the number of free blocks comprises:

calculating the HOST writing speed, the write amplification and the number of idle blocks according to the following formula to obtain the optimized GC writing speed of the solid state disk:

VGC=VHOST*(WA-1)*(A-Tfree_blk)*B

wherein, VGCFor GC write speed, VHOSTFor HOST write speed, Tfree_blkThe number of idle blocks is, a is a preset constant, and B is a preset constant.

7. The method of claim 1, wherein the obtaining the first HOST write speed and the GC write speed of the current solid state disk comprises:

and acquiring the HOST write quantity and the GC write quantity of the solid state disk in unit time.

8. A system for optimizing performance consistency of a solid state disk is characterized by comprising:

the judging module is configured to acquire a first HOST write speed and a GC write speed of a current solid state disk, and judge whether the read-write pressure of the solid state disk triggers a preset condition or not based on the first HOST write speed and the GC write speed;

an obtaining module configured to obtain a second HOST write speed, write amplification, and a number of idle blocks if the read-write pressure triggers a preset condition;

a processing module configured to obtain an optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification and the number of idle blocks;

a limiting module configured to limit the GC write speed to the optimized GC write speed to optimize performance consistency of the solid state disk.

9. A computer device, comprising:

at least one processor; and

memory storing a computer program operable on the processor, wherein the processor executes the program to perform the steps of the method according to any of claims 1-7.

10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the steps of the method according to any one of claims 1 to 7.

Technical Field

The invention relates to the technical field of solid state disk control, in particular to a method, a system, equipment and a medium for optimizing performance consistency of a solid state disk.

Background

The performance consistency of a Solid State Disk (SSD) refers to the stability of the performance of the Solid State Disk, and simply speaking, the change range of the IOPS/BW cannot be too large. The better the performance consistency, the more stable the user service performance and the better the user experience. Different user data models have different read-write pressures, which requires consistent performance to meet various read-write pressure scenarios. Many factors influencing the consistency of the performance of the solid state disk are included, such as write arbitration policy inside the solid state disk, back-end NAND bandwidth allocation, path control resource allocation, and the like, wherein the most important factor is that the dynamic balance of the SSD performance is achieved by adjusting the ratio of HOST write to GC write inside the firmware of the solid state disk. GC is a background operation that the solid state disk always exists for recovering the FREE BLOCK. In the low-pressure mixed read/write scenario, the user data pressure is small, and if the GC is executed at full speed, the GC write speed is much faster than the HOST write speed, i.e. the speed of supplying BLOCK is faster than the speed of consuming BLOCK, the FREE BLOCK will remain near the high level, which is limited to the swing point of turning on the GC and turning off the GC. In this case, the ratio of GC write to HOST write is not balanced, and the performance consistency of the solid state disk is not good.

The current mainstream control algorithms for controlling the GC write speed and the HOST write speed include a sliding mean filtering algorithm, a PID (proportion integration differentiation) adjusting algorithm and the like, but the realization mode is more complicated and the actual effect is poor.

Disclosure of Invention

In view of this, the present invention provides a method, a system, a computer device, and a computer readable medium for optimizing performance consistency of a solid state disk, in which a HOST write speed is used to limit a GC write speed so that a speed of providing a BLOCK by the solid state disk is equal to a speed of consuming the BLOCK, so that the implementation manner is simple, and the performance consistency of the solid state disk is improved.

Based on the above object, an aspect of the embodiments of the present invention provides a method for optimizing performance consistency of a solid state disk, which specifically includes the following steps:

acquiring a first HOST write speed and a GC write speed of a current solid state disk, and judging whether the read-write pressure of the solid state disk triggers a preset condition or not based on the first HOST write speed and the GC write speed;

if the read-write pressure triggers a preset condition, acquiring a second HOST write speed, write amplification and the number of idle blocks;

obtaining an optimized GC writing speed of the solid state disk based on the second HOST writing speed, the write amplification and the idle block number;

limiting the GC write speed to the optimized GC write speed to optimize the performance consistency of the solid state disk.

In some embodiments, the determining whether the read-write pressure of the solid state disk triggers a preset condition based on the first HOST write speed and the GC write speed includes:

and judging whether the difference between the first HOST write speed and the GC write speed is larger than a threshold value.

In some embodiments, said obtaining a second HOST write speed comprises:

acquiring the second HOST write quantity in unit time through a timer.

In some embodiments, the obtaining write amplification comprises:

acquiring historical effective data of a preset threshold;

obtaining effective data ratio based on the effective data;

and obtaining the write amplification based on the effective data ratio.

In some embodiments, the obtaining the write amplification based on the valid data fraction includes:

obtaining the write amplification based on the effective data fraction according to the following formula:

WA=(1+1/(1-R)*R)/1

wherein WA is write amplification, and R is effective data ratio.

In some embodiments, the deriving the optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification, and the number of free blocks includes:

calculating the HOST writing speed, the write amplification and the number of idle blocks according to the following formula to obtain the optimized GC writing speed of the solid state disk:

VGC=VHOST*(WA-1)*(A-Tfree_blk)*B

wherein, VGCFor GC write speed, VHOSTFor HOST write speed, Tfree_blkThe number of idle blocks is, a is a preset constant, and B is a preset constant.

In some embodiments, the obtaining the first HOST write speed and the GC write speed of the current solid state disk includes:

and acquiring the HOST write quantity and the GC write quantity of the solid state disk in unit time.

In another aspect of the embodiments of the present invention, a system for optimizing performance consistency of a solid state disk is further provided, where the system includes:

the judging module is configured to acquire a first HOST write speed and a GC write speed of a current solid state disk, and judge whether the read-write pressure of the solid state disk triggers a preset condition or not based on the first HOST write speed and the GC write speed;

an obtaining module configured to obtain a second HOST write speed, write amplification, and a number of idle blocks if the read-write pressure triggers a preset condition;

a processing module configured to obtain an optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification and the number of idle blocks;

a limiting module configured to limit the GC write speed to the optimized GC write speed to optimize performance consistency of the solid state disk.

In some embodiments, the determining whether the read-write pressure of the solid state disk triggers a preset condition based on the first HOST write speed and the GC write speed includes:

and judging whether the difference between the first HOST write speed and the GC write speed is larger than a threshold value.

In some embodiments, said obtaining a second HOST write speed comprises:

acquiring the second HOST write quantity in unit time through a timer.

In some embodiments, the obtaining write amplification comprises:

acquiring historical effective data of a preset threshold;

obtaining effective data ratio based on the effective data;

and obtaining the write amplification based on the effective data ratio.

In some embodiments, the obtaining the write amplification based on the valid data fraction includes:

obtaining the write amplification based on the effective data fraction according to the following formula:

WA=(1+1/(1-R)*R)/1

wherein WA is write amplification, and R is effective data ratio.

In some embodiments, the deriving the optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification, and the number of free blocks includes:

calculating the HOST writing speed, the write amplification and the number of idle blocks according to the following formula to obtain the optimized GC writing speed of the solid state disk:

VGC=VHOST*(WA-1)*(A-Tfree_blk)*B

wherein, VGCFor GC write speed, VHOSTFor HOST write speed, Tfree_blkThe number of idle blocks is, a is a preset constant, and B is a preset constant.

In some embodiments, the obtaining the first HOST write speed and the GC write speed of the current solid state disk includes:

and acquiring the HOST write quantity and the GC write quantity of the solid state disk in unit time.

In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing a computer program executable on the processor, the computer program when executed by the processor implementing the steps of the method:

acquiring a first HOST write speed and a GC write speed of a current solid state disk, and judging whether the read-write pressure of the solid state disk triggers a preset condition or not based on the first HOST write speed and the GC write speed;

if the read-write pressure triggers a preset condition, acquiring a second HOST write speed, write amplification and the number of idle blocks;

obtaining an optimized GC writing speed of the solid state disk based on the second HOST writing speed, the write amplification and the idle block number;

limiting the GC write speed to the optimized GC write speed to optimize the performance consistency of the solid state disk.

In some embodiments, the determining whether the read-write pressure of the solid state disk triggers a preset condition based on the first HOST write speed and the GC write speed includes:

and judging whether the difference between the first HOST write speed and the GC write speed is larger than a threshold value.

In some embodiments, said obtaining a second HOST write speed comprises:

acquiring the second HOST write quantity in unit time through a timer.

In some embodiments, the obtaining write amplification comprises:

acquiring historical effective data of a preset threshold;

obtaining effective data ratio based on the effective data;

and obtaining the write amplification based on the effective data ratio.

In some embodiments, the obtaining the write amplification based on the valid data fraction includes:

obtaining the write amplification based on the effective data fraction according to the following formula:

WA=(1+1/(1-R)*R)/1

wherein WA is write amplification, and R is effective data ratio.

In some embodiments, the deriving the optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification, and the number of free blocks includes:

calculating the HOST writing speed, the write amplification and the number of idle blocks according to the following formula to obtain the optimized GC writing speed of the solid state disk:

VGC=VHOST*(WA-1)*(A-Tfree_blk)*B

wherein, VGCFor GC write speed, VHOSTFor HOST write speed, Tfree_blkThe number of idle blocks is, a is a preset constant, and B is a preset constant.

In some embodiments, the obtaining the first HOST write speed and the GC write speed of the current solid state disk includes:

and acquiring the HOST write quantity and the GC write quantity of the solid state disk in unit time.

In another aspect of the embodiments of the present invention, a computer-readable storage medium is further provided, in which a computer program for implementing the following method steps when executed by a processor is stored:

acquiring a first HOST write speed and a GC write speed of a current solid state disk, and judging whether the read-write pressure of the solid state disk triggers a preset condition or not based on the first HOST write speed and the GC write speed;

if the read-write pressure triggers a preset condition, acquiring a second HOST write speed, write amplification and the number of idle blocks;

obtaining an optimized GC writing speed of the solid state disk based on the second HOST writing speed, the write amplification and the idle block number;

limiting the GC write speed to the optimized GC write speed to optimize the performance consistency of the solid state disk.

In some embodiments, the determining whether the read-write pressure of the solid state disk triggers a preset condition based on the first HOST write speed and the GC write speed includes:

and judging whether the difference between the first HOST write speed and the GC write speed is larger than a threshold value.

In some embodiments, said obtaining a second HOST write speed comprises:

acquiring the second HOST write quantity in unit time through a timer.

In some embodiments, the obtaining write amplification comprises:

acquiring historical effective data of a preset threshold;

obtaining effective data ratio based on the effective data;

and obtaining the write amplification based on the effective data ratio.

In some embodiments, the obtaining the write amplification based on the valid data fraction includes:

obtaining the write amplification based on the effective data fraction according to the following formula:

WA=(1+1/(1-R)*R)/1

wherein WA is write amplification, and R is effective data ratio.

In some embodiments, the deriving the optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification, and the number of free blocks includes:

calculating the HOST writing speed, the write amplification and the number of idle blocks according to the following formula to obtain the optimized GC writing speed of the solid state disk:

VGC=VHOST*(WA-1)*(A-Tfree_blk)*B

wherein, VGCFor GC write speed, VHOSTFor HOST write speed, Tfree_blkThe number of idle blocks is, a is a preset constant, and B is a preset constant.

In some embodiments, the obtaining the first HOST write speed and the GC write speed of the current solid state disk includes:

and acquiring the HOST write quantity and the GC write quantity of the solid state disk in unit time.

The invention has the following beneficial technical effects: according to the method, the system, the computer device and the computer readable medium for optimizing the performance consistency of the solid state disk, provided by the embodiment of the invention, whether the read-write pressure of the solid state disk triggers a preset condition or not is judged by acquiring the first HOST write speed and the GC write speed of the current solid state disk and based on the first HOST write speed and the GC write speed; if the read-write pressure triggers a preset condition, acquiring a second HOST write speed, write amplification and the number of idle blocks; obtaining an optimized GC writing speed of the solid state disk based on the second HOST writing speed, the write amplification and the idle block number; and limiting the GC writing speed to the optimized GC writing speed, so that the speed of providing the BLOCK by the solid state disk is equal to the speed of consuming the BLOCK, the implementation mode is simple, and the performance consistency of the solid state disk is improved.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.

Fig. 1 is a block diagram of an embodiment of a method for optimizing performance consistency of a solid state disk according to the present invention;

fig. 2 is a schematic diagram of an embodiment of a system for optimizing performance consistency of a solid state disk according to the present invention;

FIG. 3 is a schematic structural diagram of an embodiment of a computer device provided in the present invention;

fig. 4 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.

It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.

Based on the above purpose, a first aspect of the embodiments of the present invention provides an embodiment of a method for optimizing performance consistency of a solid state disk. As shown in fig. 1, it includes the following steps:

step S101, acquiring a first HOST write speed and a GC write speed of a current solid state disk, and judging whether the read-write pressure of the solid state disk triggers a preset condition or not based on the first HOST write speed and the GC write speed;

step S103, if the read-write pressure triggers a preset condition, acquiring a second HOST write speed, write amplification and the number of idle blocks;

step S105, obtaining an optimized GC writing speed of the solid state disk based on the second HOST writing speed, the write amplification and the idle block number;

and S107, limiting the GC writing speed to the optimized GC writing speed so as to optimize the performance consistency of the solid state disk.

Specifically, by acquiring a first HOST write speed and a GC write speed, determining whether a difference between the first HOST write speed and the GC write speed is greater than a threshold value, and if so, determining that the read-write pressure of the solid state disk is low; acquiring a second HOST writing speed, writing amplification and the number of idle blocks; obtaining the optimized GC writing speed of the solid state disk through the second HOST writing speed, the write amplification and the number of idle blocks; and controlling the GC writing speed to be optimized so as to optimize the performance consistency of the solid state disk.

According to the method for optimizing the performance consistency of the solid state disk, provided by the embodiment of the invention, under the condition that the first HOST write speed and the GC write speed of the current solid state disk trigger the preset conditions, the second HOST write speed, the write amplification and the number of idle BLOCKs are obtained, the optimized GC write speed of the solid state disk is obtained based on the second HOST write speed, the write amplification and the number of idle BLOCKs, the speed of the solid state disk for providing BLOCK is equal to the speed of consuming BLOCK, the implementation mode is simple, and the performance consistency of the solid state disk is improved.

In some embodiments, the determining whether the read-write pressure of the solid state disk triggers a preset condition based on the first HOST write speed and the GC write speed includes:

and judging whether the difference between the first HOST write speed and the GC write speed is larger than a threshold value.

In some embodiments, said obtaining a second HOST write speed comprises:

acquiring the second HOST write quantity in unit time through a timer.

In some embodiments, the obtaining write amplification comprises:

acquiring historical effective data of a preset threshold;

obtaining effective data ratio based on the effective data;

and obtaining the write amplification based on the effective data ratio.

In some embodiments, the obtaining the write amplification based on the valid data fraction includes:

obtaining the write amplification based on the effective data fraction according to the following formula:

WA=(1+1/(1-R)*R)/1

wherein WA is write amplification, and R is effective data ratio.

According to the embodiments of the above embodiments, the number of valid data of 1000 blocks recovered in a history time is counted, an average value V of the number of valid data is calculated, and then a ratio of valid data is calculated as R ═ V/S (S is the number of 4k of blocks), a ratio of invalid data is 1-R, the recovery efficiency is 1/(1-R), the number of GC writes is 1/(1-R) × R, and WA is (1+1/(1-R) × 1.

In some embodiments, the deriving the optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification, and the number of free blocks includes:

calculating the HOST writing speed, the write amplification and the number of idle blocks according to the following formula to obtain the optimized GC writing speed of the solid state disk:

VGC=VHOST*(WA-1)*(A-Tfree_blk)*B

wherein, VGCFor GC write speed, VHOSTFor HOST write speed, Tfree_blkThe number of idle blocks is, a is a preset constant, and B is a preset constant.

Note that (a-free _ blk) × B is a feedback factor having a fine adjustment function, and the feedback factor is in a functional relationship with free _ blk, and the lower free _ blk, the lower the GC write speed is, the higher the GC write speed needs to be.

In some embodiments, the obtaining the first HOST write speed and the GC write speed of the current solid state disk includes:

and acquiring the HOST write quantity and the GC write quantity of the solid state disk in unit time.

Specifically, the HOST write quantity and the GC write quantity of the solid state disk in unit time can be acquired through a timer to obtain the first HOST write speed and the GC write speed of the current solid state disk.

Several embodiments of the invention are further illustrated below with reference to specific examples.

The solid state disk calculates WA according to the effective data proportion of the recovered BLOCK in the historical time, and starts a timer; the number of HOST write processing in the timing scanning 1S is H, and in order to control the granularity to be fine, the number of 4k of HOST write in 5ms can be scanned in a timing mode; calculating the number of GC writes in 1S as G ═ H (WA-1) × (a-free block) × B by WA and the number of HOST write processes in 1S as H, assuming that H is 1, WA is 3, a is 36, and when B is 1.05, G is 12.6; the writing quantity of G GC is processed in 1S at a fixed time, and in order to control the fineness of granularity, the writing quantity of 4k of Gc in 5ms can be controlled at a fixed time, so that the optimized GC writing speed and the HOST writing speed are determined, the BLOCK speed provided by the solid state disk is equal to the consumed BLOCK speed, the implementation method is simple, and the performance consistency of the solid state disk realized by the method is good.

Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 2, an embodiment of the present invention further provides a system for optimizing performance consistency of a solid state disk, where the system includes:

a determining module 110, where the determining module 110 is configured to obtain a first HOST write speed and a GC write speed of a current solid state disk, and determine whether a read-write pressure of the solid state disk triggers a preset condition based on the first HOST write speed and the GC write speed;

an obtaining module 120, where the obtaining module 120 is configured to obtain a second HOST write speed, write amplification, and a number of idle blocks if the read-write pressure triggers a preset condition;

a processing module 130, wherein the processing module 130 is configured to obtain an optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification and the number of idle blocks;

a limiting module 140, the limiting module 140 configured to limit the GC write speed to the optimized GC write speed to optimize performance consistency of the solid state disk.

In some embodiments, the determining whether the read-write pressure of the solid state disk triggers a preset condition based on the first HOST write speed and the GC write speed includes:

and judging whether the difference between the first HOST write speed and the GC write speed is larger than a threshold value.

In some embodiments, said obtaining a second HOST write speed comprises:

acquiring the second HOST write quantity in unit time through a timer.

In some embodiments, the obtaining write amplification comprises:

acquiring historical effective data of a preset threshold;

obtaining effective data ratio based on the effective data;

and obtaining the write amplification based on the effective data ratio.

In some embodiments, the obtaining the write amplification based on the valid data fraction includes:

obtaining the write amplification based on the effective data fraction according to the following formula:

WA=(1+1/(1-R)*R)/1

wherein WA is write amplification, and R is effective data ratio.

In some embodiments, the deriving the optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification, and the number of free blocks includes:

calculating the HOST writing speed, the write amplification and the number of idle blocks according to the following formula to obtain the optimized GC writing speed of the solid state disk:

VGC=VHOST*(WA-1)*(A-Tfree_blk)*B

wherein, VGCFor GC write speed, VHOSTFor HOST write speed, Tfree_blkThe number of idle blocks is, a is a preset constant, and B is a preset constant.

In some embodiments, the obtaining the first HOST write speed and the GC write speed of the current solid state disk includes:

and acquiring the HOST write quantity and the GC write quantity of the solid state disk in unit time.

Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 3, an embodiment of the present invention further provides a computer device 20, where the computer device 20 includes a processor 210 and a memory 220, the memory 220 stores a computer program 221 executable on the processor, and the processor 210 executes the program to perform the following steps of the method for optimizing the performance consistency of the solid state disk:

acquiring a first HOST write speed and a GC write speed of a current solid state disk, and judging whether the read-write pressure of the solid state disk triggers a preset condition or not based on the first HOST write speed and the GC write speed;

if the read-write pressure triggers a preset condition, acquiring a second HOST write speed, write amplification and the number of idle blocks;

obtaining an optimized GC writing speed of the solid state disk based on the second HOST writing speed, the write amplification and the idle block number;

limiting the GC write speed to the optimized GC write speed to optimize the performance consistency of the solid state disk.

In some embodiments, the determining whether the read-write pressure of the solid state disk triggers a preset condition based on the first HOST write speed and the GC write speed includes:

and judging whether the difference between the first HOST write speed and the GC write speed is larger than a threshold value.

In some embodiments, said obtaining a second HOST write speed comprises:

acquiring the second HOST write quantity in unit time through a timer.

In some embodiments, the obtaining write amplification comprises:

acquiring historical effective data of a preset threshold;

obtaining effective data ratio based on the effective data;

and obtaining the write amplification based on the effective data ratio.

In some embodiments, the obtaining the write amplification based on the valid data fraction includes:

obtaining the write amplification based on the effective data fraction according to the following formula:

WA=(1+1/(1-R)*R)/1

wherein WA is write amplification, and R is effective data ratio.

In some embodiments, the deriving the optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification, and the number of free blocks includes:

calculating the HOST writing speed, the write amplification and the number of idle blocks according to the following formula to obtain the optimized GC writing speed of the solid state disk:

VGC=VHOST*(WA-1)*(A-Tfree_blk)*B

wherein,VGCFor GC write speed, VHOSTFor HOST write speed, Tfree_blkThe number of idle blocks is, a is a preset constant, and B is a preset constant.

In some embodiments, the obtaining the first HOST write speed and the GC write speed of the current solid state disk includes:

and acquiring the HOST write quantity and the GC write quantity of the solid state disk in unit time.

Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 4, an embodiment of the present invention further provides a computer-readable storage medium 30, the computer-readable storage medium 30 storing a computer program 310 which, when executed by a processor, performs the following method:

acquiring a first HOST write speed and a GC write speed of a current solid state disk, and judging whether the read-write pressure of the solid state disk triggers a preset condition or not based on the first HOST write speed and the GC write speed;

if the read-write pressure triggers a preset condition, acquiring a second HOST write speed, write amplification and the number of idle blocks;

obtaining an optimized GC writing speed of the solid state disk based on the second HOST writing speed, the write amplification and the idle block number;

limiting the GC write speed to the optimized GC write speed to optimize the performance consistency of the solid state disk.

In some embodiments, the determining whether the read-write pressure of the solid state disk triggers a preset condition based on the first HOST write speed and the GC write speed includes:

and judging whether the difference between the first HOST write speed and the GC write speed is larger than a threshold value.

In some embodiments, said obtaining a second HOST write speed comprises:

acquiring the second HOST write quantity in unit time through a timer.

In some embodiments, the obtaining write amplification comprises:

acquiring historical effective data of a preset threshold;

obtaining effective data ratio based on the effective data;

and obtaining the write amplification based on the effective data ratio.

In some embodiments, the obtaining the write amplification based on the valid data fraction includes:

obtaining the write amplification based on the effective data fraction according to the following formula:

WA=(1+1/(1-R)*R)/1

wherein WA is write amplification, and R is effective data ratio.

In some embodiments, the deriving the optimized GC write speed of the solid state disk based on the second HOST write speed, the write amplification, and the number of free blocks includes:

calculating the HOST writing speed, the write amplification and the number of idle blocks according to the following formula to obtain the optimized GC writing speed of the solid state disk:

VGC=VHOST*(WA-1)*(A-Tfree_blk)*B

wherein, VGCFor GC write speed, VHOSTFor HOST write speed, Tfree_blkThe number of idle blocks is, a is a preset constant, and B is a preset constant.

In some embodiments, the obtaining the first HOST write speed and the GC write speed of the current solid state disk includes:

and acquiring the HOST write quantity and the GC write quantity of the solid state disk in unit time.

Finally, it should be noted that, as will be understood by those skilled in the art, all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.

The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.

It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.

The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.

It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.

Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种独立冗余磁盘阵列的初始化方法、系统、设备及介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类