CN103729313A - Method and device for controlling input and output flow of SSD cache - Google Patents

Method and device for controlling input and output flow of SSD cache Download PDF

Info

Publication number
CN103729313A
CN103729313A CN201210383733.9A CN201210383733A CN103729313A CN 103729313 A CN103729313 A CN 103729313A CN 201210383733 A CN201210383733 A CN 201210383733A CN 103729313 A CN103729313 A CN 103729313A
Authority
CN
China
Prior art keywords
ssd
buffer memory
empties
buffer storage
speed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201210383733.9A
Other languages
Chinese (zh)
Other versions
CN103729313B (en
Inventor
裴金干
刘虹越
王术
王旭光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
SUZHOU EJITEC Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SUZHOU EJITEC Co Ltd filed Critical SUZHOU EJITEC Co Ltd
Priority to CN201210383733.9A priority Critical patent/CN103729313B/en
Publication of CN103729313A publication Critical patent/CN103729313A/en
Application granted granted Critical
Publication of CN103729313B publication Critical patent/CN103729313B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention provides a method and device for controlling input and outlet flow of an SSD cache. The method comprises the steps that disk data of reading and writing processes or threads of a disk are intercepted, and the disk data are cached to the space of an SSD cache device to be used as cache data; whether the cache data are wiped to an external objective disk through a cache wiping thread is detected; cache wiping processing is judged and conducted; a scaling factor is generated through calculation, the cache data wiping speed of the SSD cache device is adjusted according to the scaling factor, and SSD cache flow is controlled until the cache utilization rate of the SSD cache device is lower than a preset second preset ratio. According to the method and device, IO flow entering in the SSD cache is dynamically controlled according to the IO flow of the external disk, and SSD space and performance are maximally used for meeting the demand of users.

Description

Iostream amount control method and the device of SSD buffer memory
Technical field
The present invention relates to Computer Storage control technology field, particularly relate to a kind of using SSD(solid state hard disc) as input and output (IO) flow control methods and the SSD buffer storage of the SSD buffer memory of buffer memory.
Background technology
The IO(Input/Output of legacy memory (as disk) at present, input and output) speed obviously becomes memory property bottleneck, and with SSD(Solid State Disk, solid state hard disc) as storer, make the IO speed of storer have obvious lifting, but because the price of SSD is relatively high, cannot in whole storer, all install and use, therefore in prior art, setting it as buffer memory (Cache) uses, namely SSD carrys out buffered data as one deck buffer memory (Cache) between internal memory (memory) and hard disk (external memory storage), to improve IO bandwidth and response speed, be called SSD buffer memory (SSD Cache).
In the SSD caching method of realizing in the prior art, need to solve a problem, the in the situation that of large pressure IO, the space of SSD buffer memory will be consumed very soon, at this moment must start flush mechanism (emptying caching mechanism), the data of buffer memory are write back to destination disc, because disk I/O speed is considerably slower than the IO speed of SSD, with respect to buffer memory (Cache), the IO speed flowing into is much larger than the IO speed flowing out, can cause buffer memory (Cache) space depleted, finally occur the severe situations such as denial of service.
Therefore, how to control SSD buffer memory flow and become problem in the urgent need to address.
Summary of the invention
In order to solve problems of the prior art, the invention provides a kind of input and output (IO) flow control methods and device of SSD buffer memory, it dynamically controls according to the IO flow of external disk the IO flow that enters SSD buffer memory, and the maximized SSD of utilization space and performance are met consumers' demand.
For realizing the iostream amount control method of a kind of SSD buffer memory that the object of the invention provides, comprise the steps:
Step S100, the data in magnetic disk of intercepting and capturing disk read-write process or thread, is cached in SSD buffer storage space data in magnetic disk as data cached;
Whether step S200, detect in SSD buffer storage and by buffer memory, to empty thread and empty outside destination disc by data cached; If so, enter step S500; Otherwise enter step S300;
Step S300, the usage space of the solid state hard disc that statistics is used as buffer memory, obtains SSD buffer memory utilization rate, and when SSD buffer memory utilization rate exceedes the first pre-set ratio, enters step S400;
Step S400, starts buffer memory and empties thread, by buffer memory, empties thread, and the data cached speed that empties of answering by predefined reference factor pair, by the data cached destination disc that empties in SSD buffer storage;
Step S500, calculates and generates scale factor, and according to scale factor, SSD buffer storage is carried out to the data cached speed adjustment that empties, to the flow control of SSD buffer memory, until the buffer memory utilization rate of SSD buffer storage is lower than predefined the second pre-set ratio.
More preferably, as an embodiment, described step S200 comprises the steps:
Step S210, judges whether that data cached in SSD buffer storage emptied to thread by buffer memory empties outside destination disc;
Step S220, empties outside destination disc if judgement does not empty thread by data cached in SSD buffer storage by buffer memory, enters step S300, monitors it and whether reaches buffer memory and empty thread entry condition and notify and start buffer memory and empty thread; Otherwise jump to step S500, monitoring buffer memory empties speed.
More preferably, as an embodiment, described step S500 comprises the steps:
Step S510, by in the data cached process that is written to destination disc, cumulative statistics writes the data cached byte length of writing IO of SSD buffer storage, it is the IO inflow velocity of SSD buffer storage, and accumulative total is write out SSD Cache Statistics flush byte length, be the data cached speed that empties in SSD buffer memory disk, calculate the scale factor generating in SSD buffer storage;
Step S520, the compared proportions factor and the reference factor, adjust buffer memory according to comparative result and empty speed, empties speed, by the data cached destination disc that empties in SSD buffer storage with new buffer memory;
Step 530, writes back to the data in SSD buffer memory after destination disc, continues the each of record statistics SSD buffer storage and writes the byte length writing out, and discharge corresponding SSD buffer storage space, and statistics obtains the buffer memory utilization rate of SSD buffer storage;
Step S540, judges that whether the buffer memory utilization rate of SSD buffer storage is lower than the second pre-set ratio; If so, finishing buffer memory empties thread and returns; Otherwise, return to step S510, loop flow control.
More preferably, as an embodiment, in described step S520, according to comparative result, adjust buffer memory and empty speed, comprise the steps:
Step S521, if proportional factor r atio is more than or equal to reference factor R efRatio, shows that inflow velocity is more than or equal to flush speed, according to the value of proportional factor r atio, adjusts flush speed, makes inflow velocity be less than or equal to flush speed, i.e. vi≤vf;
Step S522, if proportional factor r atio is less than reference factor R efRatio, shows that inflow velocity is less than flush speed, and flush speed v f is constant.
More preferably, as an embodiment, described predefined the first pre-set ratio is 70%~90%;
Described predefined the second pre-set ratio is 20%~30%.
More preferably, as an embodiment, wherein, in described step S510, described according to the byte length of writing IO of cumulative statistics and flush byte length, calculate proportional factor r atio and be:
If inflow velocity is vi, flush speed is vf, reference factor R efRatio:
Ratio=(vi/vf)*RefRatio;
Wherein, in described step S521, if proportional factor r atio is greater than reference factor R efRatio, flush speed v f=vi*(ratio/RefRatio);
Wherein, in described step S522, if proportional factor r atio is less than reference factor R efRatio, flush speed v f remains unchanged.
For realizing the object of the invention, also provide a kind of SSD buffer storage, comprise as being connected to the solid-state hard disk SSD as buffer memory on external disk, also comprise buffer control device;
Described buffer control device, comprises intercepting and capturing module, detection module, and statistical module, empties processing module, calculates and adjusts control module;
Wherein:
Described intercepting and capturing module, for intercepting and capturing the data in magnetic disk of disk read-write process or thread, is cached in solid-state hard disk SSD data in magnetic disk as data cached;
Described detection module, empties thread for detection of whether by buffer memory and empties outside destination disc by data cached; If so, forwarding calculating adjustment control module to processes; Otherwise forwarding statistical module to processes;
Described statistical module, for adding up the usage space of solid state hard disc, obtains SSD buffer memory utilization rate, and when SSD buffer memory utilization rate exceedes the first pre-set ratio, enters and empty processing module;
The described processing module that empties, empties thread for starting buffer memory, by buffer memory, empties thread, and the data cached speed that empties of answering by predefined reference factor pair, by the data cached destination disc that empties in SSD buffer storage;
Control module is adjusted in described calculating, be used for calculating generation scale factor, and according to scale factor, SSD buffer storage is carried out to the data cached speed adjustment that empties, to the flow control of SSD buffer memory, until the buffer memory utilization rate of SSD buffer storage is lower than predefined the second pre-set ratio.
More preferably, as an embodiment, described detection module comprises judgement submodule, and submodule is processed in judgement, wherein:
Described judgement submodule, for judging whether that SSD buffer storage data cached emptied to thread by buffer memory empties outside destination disc;
Submodule is processed in described judgement, if solid state hard disc data cached do not emptied to thread by buffer memory for judgement, empty outside destination disc, forward statistical module to, monitor its whether reach buffer memory empty thread entry condition and notify start buffer memory empty thread; Otherwise jump to calculate, adjust control module, monitoring buffer memory empties speed.
More preferably, as an embodiment, control module is adjusted in described calculating, comprises calculating sub module, relatively adjusts submodule, discharges submodule, and judgement finishes submodule;
Wherein:
Described calculating sub module, for by the data cached process that is written to destination disc, cumulative statistics writes the data cached byte length of writing IO of SSD buffer storage, it is the IO inflow velocity of SSD buffer storage, and accumulative total is write out SSD Cache Statistics flush byte length, be the data cached speed that empties in SSD buffer memory disk, calculate the scale factor generating in SSD buffer storage;
The described submodule of relatively adjusting, for the compared proportions factor and the reference factor, adjusts buffer memory according to comparative result and empties speed, empties speed, by the data cached destination disc that empties in SSD buffer storage with new buffer memory;
Described release submodule, for the data of SSD buffer memory are write back to after destination disc, continue the each of record statistics SSD buffer storage and write the byte length writing out, and discharge corresponding SSD buffer storage space, statistics obtains the buffer memory utilization rate of SSD buffer storage;
Described judgement finishes submodule, for the buffer memory utilization rate that judges SSD buffer storage whether lower than the second pre-set ratio; If so, finishing buffer memory empties thread and returns; Otherwise, return to calculating sub module, loop flow control.
The invention has the beneficial effects as follows:
Input and output (IO) flow control methods and the device of SSD buffer memory of the present invention, it is according to the IO flow of external disk, dynamically control the IO flow that enters SSD buffer memory, it can realize the accurate control of flow between multiple threads, and according to SSD buffer memory free space, automatically adjust the scale factor of control, according to current resource situation, as much as possible meet user and write inbound traffics request, the maximized SSD of utilization space and performance are met consumers' demand.
Accompanying drawing explanation
Below in conjunction with concrete drawings and the specific embodiments, the present invention is further elaborated.
Fig. 1 is input and output (IO) the flow control methods process flow diagram of the SSD buffer memory of the embodiment of the present invention;
Fig. 2 is embodiment of the present invention SSD buffer storage structural representation.
Embodiment
In order to solve problems of the prior art, to IO, provide better service quality, in the embodiment of the present invention, by service condition and the flush(in monitoring SSD buffer memory (SSD Cache) device space, empty buffer memory) speed, dynamically adjust inflow and outflow IO speed.
The physical space of the SSD buffer storage using as buffer memory is limited, write certain data cached after, this SSD buffer storage space can be fallen by slow consumption, clearance spaces reduces gradually, if do not do any processing, when clearance spaces is zero, just can not do caching process to write request.Therefore, need to monitor and adjust SSD buffer storage space, and by data cached (taking spatial cache) flush of buffer memory in destination disc, in this process, the variation in SSD buffer storage space depends on the write request speed (inflow velocity) that enters and the speed (rate of outflow) of flush, controlled in order to accomplish SSD buffer storage space, just need to control the inflow and outflow speed of SSD buffer storage.
In the embodiment of the present invention, when carrying out the monitoring of SSD buffer storage, consider following 3 kinds of situations: be 1) that SSD buffer storage space is enough, do not need to control SSD buffer storage inflow and outflow IO speed; 2) be that SSD buffer storage space is about to be exhausted, for guaranteeing that flowing into IO speed is less than or equal to the IO speed that flows out, need dynamically to adjust SSD buffer storage inflow and outflow IO speed; 3) having the inflow and outflow of read-write IO(SSD buffer storage to exist simultaneously) in the situation that, guaranteeing under the correct prerequisite of processing of read-write IO, by the data flush of SSD buffer storage to destination disc, guarantee to finish within the limited time.
As a kind of embodiment, as shown in Figure 1, input and output (IO) flow control methods of a kind of SSD buffer memory of the embodiment of the present invention, comprises the steps:
Step S100, the data in magnetic disk of intercepting and capturing disk read-write process or thread, is cached in SSD buffer storage space data in magnetic disk as data cached;
Computer user can utilize multiple processes of user's state or thread by known kernel system API(Application Programming Interface, application programming interface) carry out read-write cache data, and because read-write destination disc speed is relatively slow, therefore can accelerate (uf<us) storage by SSD buffer memory (cache) device space.
Normally, by core A PI, intercept and capture the read-write requests of described multiple processes or thread, can by slow disk, change its destination address into solid state hard disc (SSD) that speed is used as buffer memory (cache), be to carry out buffer memory in SSD buffer storage space, data in magnetic disk is cached in SSD buffer storage space as data cached;
Whether step S200, detect in SSD buffer storage and by buffer memory, to empty thread (flush thread) and empty outside destination disc by data cached; If so, enter step S500; Otherwise enter step S300;
Preferably, as a kind of embodiment, described step S200 comprises the steps:
Step S210, judges whether that data cached in SSD buffer storage emptied to thread (flush thread) by buffer memory empties outside destination disc;
It is a kind of prior art that buffer memory empties thread (flush thread), therefore, in embodiments of the present invention, describes in detail no longer one by one.
Data cached the emptying (flush) occurring in SSD buffer storage includes but not limited to 1 to the situation of outside destination disc) SSD buffer storage insufficient space; 2) user operates to control and starts buffer memory and empty thread to empty (flush) data cached; 3) user preset condition meets, and computer memory system starts buffer memory and empties thread and empty etc.
Step S220, if judgement does not empty thread by data cached in SSD buffer storage by buffer memory and empties (flush) to outside destination disc, enter step S300, the buffer memory of monitoring in its SSD buffer storage that whether reaches the embodiment of the present invention empties thread (flush thread) entry condition and notifies startup buffer memory to empty thread; Otherwise jump to step S500, monitoring buffer memory empties speed.
If SSD buffer storage does not empty thread by buffer memory and empties (flush), this SSD buffer storage does not also need to carry out flow control, but along with the carrying out of continuous buffer memory input and output (IO), the not usage space of SSD buffer storage is slowly occupied, in order to carry out flow control, enter step S300 and continue monitoring.
Step S300, the usage space of the solid state hard disc (SSD) that statistics is used as buffer memory (cache), draw the data cached space of buffer memory and the not ratio of usage space in SSD spatial cache, obtain it and use number percent, it is SSD buffer memory utilization rate, and when SSD buffer memory utilization rate exceedes the first pre-set ratio, enter step S400;
As a kind of embodiment, preferably, predefined the first pre-set ratio is 70%~90%, when SSD buffer memory utilization rate is more than or equal to 70%~90% in step S300, jumps to step S400, starts flush thread; Otherwise circle statistics is usage space.
More preferably, as a kind of embodiment, according to the ratio of the clearance spaces of spatial cache, whether exceed the first pre-set ratio 80%, determine whether to start flush thread, if the i.e. clearance spaces less than 20% of SSD buffer storage, be SSD buffer memory utilization rate while being more than or equal to 80%, notice starts flush thread, enters step S400.
As a kind of embodiment, in monitor procedure, flush thread waits is set, check controlled condition (detect and whether be more than or equal to pre-set ratio), once satisfy condition, notify this flush thread to start.
Step S400, start buffer memory and empty thread (flush thread), by buffer memory, empty thread (flush thread), by the data cached speed (flush) that empties corresponding to predefined reference factor R efRatio, data cached the emptying (flush) in SSD buffer storage arrived to destination disc;
Wherein, as a kind of embodiment, described reference factor R efRatio is default unsigned int constant, and this reference factor R efRatio obtains based on experience value, when it empties corresponding flush speed, read-write is controlled in dynamic balance state.
Step S500, calculate and generate proportional factor r atio, and according to proportional factor r atio, SSD buffer storage is carried out to the data cached speed adjustment that empties, to the flow control of SSD buffer memory, until the buffer memory utilization rate of SSD buffer storage is lower than predefined the second pre-set ratio.
Preferably, predefined the second pre-set ratio is 20%~30%, and when in step S500, SSD buffer memory utilization rate is less than or equal to 20%~30%, result flush thread also returns; Otherwise loop traffic monitoring.
Preferably, as a kind of embodiment, described step S500 comprises the steps:
Step S510, by in the data cached process that is written to destination disc, cumulative statistics writes the data cached byte length of writing IO of SSD buffer storage, it is the IO inflow velocity of SSD buffer storage, and accumulative total is write out SSD Cache Statistics flush byte length, be the data cached speed (flush speed) that empties in SSD buffer memory disk, calculate the scale factor generating in SSD buffer storage;
In the embodiment of the present invention, byte length correspondence writes writes out (IO) transmission bandwidth (speed), by statistics byte length, has also just added up to write and has write out (IO) bandwidth (speed).
In the read/writing control method of the embodiment of the present invention, preferably, as a kind of embodiment, in step S510, according to the byte length of writing IO of cumulative statistics, i.e. the IO inflow velocity of SSD buffer storage, and flush byte length, be the flush speed in SSD buffer memory disk, calculate adjustment proportional factor ratio.
As a kind of embodiment, according to the byte length of writing IO of cumulative statistics and flush byte length, calculate proportional factor r atio:
If inflow velocity is vi, flush speed is vf: and vi/vf=ratio/RefRatio, that is:
Ratio=(vi/vf)*RefRatio。
Due to when starting to carry out traffic monitoring, the rate of outflow can be greater than inflow velocity, and therefore, scale factor is less than reference factor R efRatio.
Step S520, compared proportions factor ratio and reference factor R efRatio, adjust buffer memory according to comparative result and empty speed, empties speed, by the data cached destination disc that empties in SSD buffer storage with new buffer memory.
Preferably, as a kind of embodiment, described step S520 adjusts buffer memory according to comparative result and empties speed, comprises the steps:
Step S521, if proportional factor r atio is more than or equal to reference factor R efRatio, show that inflow velocity (writing IO to SSD buffer storage) is more than or equal to flush speed (flush goes out SSD buffer storage to destination disc), therefore, according to the value of proportional factor r atio, adjust flush speed, make inflow velocity be less than or equal to flush speed, i.e. vi<=vf;
As a kind of embodiment, if proportional factor r atio is greater than reference factor R efRatio, flush speed v f=vi*(ratio/RefRatio), replace original flush speed, continue the data cached destination disc that empties in SSD buffer storage.
Step S522, if proportional factor r atio is less than reference factor R efRatio, show that inflow velocity (writing IO to SSD buffer storage) is less than flush speed (flush goes out SSD buffer storage to destination disc), the free space of SSD buffer storage can bear the pressure that inflow velocity vi is fast brought than flush speed, and flush speed v f is constant.
In the embodiment of the present invention, preferably, if proportional factor r atio is less than reference factor R efRatio, vf remains unchanged, and it is constant that buffer memory empties speed v f, continues the data cached destination disc that empties in SSD buffer storage.
In the embodiment of the present invention, by controlling buffer memory, empty speed v f, thereby effectively empty data cached in SSD buffer storage, until the buffer memory utilization rate of SSD buffer storage is lower than the second pre-set ratio.
Step 530, data in SSD buffer memory are write back to after destination disc, continue the each of record statistics SSD buffer storage and write the byte length that writes out (IO), and discharge corresponding SSD buffer memory (cache) device space, statistics obtains the buffer memory utilization rate of SSD buffer storage;
Step S540, judges that whether the buffer memory utilization rate of SSD buffer storage is lower than the second pre-set ratio; If so, finish flush thread and return; Otherwise, return to step S510, loop flow control.
As a kind of embodiment, can finish flush thread and return by Write IO API, complete the flow control of this SSD buffer storage.
Correspondingly, based on same inventive concept, the embodiment of the present invention also provides a kind of SSD buffer storage.The principle of dealing with problems due to this device and the similar process of aforementioned a kind of SSD cache flow amount control method, therefore, the enforcement of this device can be passed through preceding method specific implementation, repeats part and repeats no more.
As shown in Figure 2, a kind of SSD buffer storage of the embodiment of the present invention, comprises as being connected to the solid state hard disc as buffer memory (SSD) 100 on external disk, also comprises buffer control device 200.
Described buffer control device 200, comprises and intercepts and captures module 210, detection module 220, and statistical module 230, empties processing module 240, calculates and adjusts control module 250;
Wherein:
Described intercepting and capturing module 210, for intercepting and capturing the data in magnetic disk of disk read-write process or thread, is cached in solid-state hard disk SSD data in magnetic disk as data cached;
Described detection module 220, empties thread (flush thread) for detection of whether by buffer memory and empties outside destination disc by data cached; If so, forwarding calculating adjustment control module to processes; Otherwise forwarding statistical module to processes;
Described statistical module 230, for adding up the usage space of solid state hard disc (SSD), obtains SSD buffer memory utilization rate, and when SSD buffer memory utilization rate exceedes the first pre-set ratio, enters and empty processing module;
The described processing module 240 that empties, be used for starting buffer memory and empty thread (flush thread), by buffer memory, empty thread (flush thread), by the data cached speed (flush) that empties corresponding to predefined reference factor R efRatio, data cached the emptying (flush) in SSD buffer storage arrived to destination disc;
Control module 250 is adjusted in described calculating, be used for calculating generation proportional factor r atio, and according to proportional factor r atio, SSD buffer storage is carried out to the data cached speed adjustment that empties, to the flow control of SSD buffer memory, until the buffer memory utilization rate of SSD buffer storage is lower than predefined the second pre-set ratio.
Preferably, as a kind of embodiment, described detection module 220 comprises and judges submodule 221, and submodule 222 is processed in judgement, wherein:
Described judgement submodule 221, for judging whether that SSD buffer storage data cached emptied to thread (flush thread) by buffer memory empties outside destination disc;
Submodule 222 is processed in described judgement, if solid state hard disc data cached do not emptied to thread by buffer memory for judgement, empty (flush) to outside destination disc, forward statistical module to, monitor its whether reach buffer memory empty thread (flush thread) entry condition and notify start buffer memory empty thread; Otherwise jump to calculate, adjust control module, monitoring buffer memory empties speed.
Preferably, as a kind of embodiment, described predefined the first pre-set ratio is 70%~90%, and more preferably, described the first pre-set ratio is 80%.Described predefined the second pre-set ratio is 20%~30%.
Preferably, as a kind of embodiment, control module 250 is adjusted in described calculating, comprises calculating sub module 251, relatively adjusts submodule 252, discharges submodule 253, and judgement finishes submodule 254, wherein:
Described calculating sub module 251, for by the data cached process that is written to destination disc, cumulative statistics writes the data cached byte length of writing IO of SSD buffer storage, it is the IO inflow velocity of SSD buffer storage, and accumulative total is write out SSD Cache Statistics flush byte length, be the data cached speed (flush speed) that empties in SSD buffer memory disk, calculate the scale factor generating in SSD buffer storage;
More preferably, as a kind of embodiment, according to the byte length of writing IO of cumulative statistics and flush byte length, calculate proportional factor r atio:
If inflow velocity is vi, flush speed is vf: and vi/vf=ratio/RefRatio, that is:
Ratio=(vi/vf)*RefRatio。
The described submodule 252 of relatively adjusting, for compared proportions factor ratio and reference factor R efRatio, adjusts buffer memory according to comparative result and empties speed, empties speed, by the data cached destination disc that empties in SSD buffer storage with new buffer memory.
If proportional factor r atio is more than or equal to reference factor R efRatio, show that inflow velocity (writing IO to SSD buffer storage) is more than or equal to flush speed (flush goes out SSD buffer storage to destination disc), therefore, according to the value of proportional factor r atio, adjust flush speed, make inflow velocity be less than or equal to flush speed, i.e. vi<=vf;
As a kind of embodiment, if proportional factor r atio is greater than reference factor R efRatio, flush speed v f=vi*(ratio/RefRatio), replace original flush speed, continue the data cached destination disc that empties in SSD buffer storage.
If proportional factor r atio is less than reference factor R efRatio, show that inflow velocity (writing IO to SSD buffer storage) is less than flush speed (flush goes out SSD buffer storage to destination disc), the free space of SSD buffer storage can bear the pressure that inflow velocity vi is fast brought than flush speed, and flush speed is constant.
In the embodiment of the present invention, preferably, if proportional factor r atio is less than reference factor R efRatio, vf remains unchanged, and it is constant that buffer memory empties speed, by the data cached destination disc that empties in SSD buffer storage.
Described release submodule 253, for the data of SSD buffer memory are write back to after destination disc, continue each byte length that writes out (IO) that writes of record statistics SSD buffer storage, and discharging corresponding SSD buffer memory (cache) device space, statistics obtains the buffer memory utilization rate of SSD buffer storage;
Described judgement finishes submodule 254, for the buffer memory utilization rate that judges SSD buffer storage whether lower than the second pre-set ratio; If so, finish flush thread and return; Otherwise, return to calculating sub module, loop flow control.
Input and output (IO) flow control methods and the device of the SSD buffer memory of the embodiment of the present invention, it is according to the IO flow of external disk, dynamically control the IO flow that enters SSD buffer memory, it can realize the accurate control of flow between multiple threads, and according to SSD buffer memory free space, automatically adjust the scale factor of control, according to current resource situation, as much as possible meet user and write inbound traffics request, the maximized SSD of utilization space and performance are met consumers' demand.
Finally, it should be noted that, in this patent document, the relational terms such as first, second grade is only for an entity or operation are separated with another entity or operational zone, and not necessarily requires or imply and between these entities or operation, have any relation or sequentially.And, in this patent document, term " comprises ", " comprising " or its any other variant, it is intended to contain but not exclusive inclusion, thereby make to comprise process, method, article or the equipment of a series of key elements, not only comprise these key elements, but also comprise and clearly not listing and other key elements that those skilled in the art can know, or be also included as the known requisite key element of these processes, method, article or equipment.
The above embodiment has only expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.

Claims (10)

1. an iostream amount control method for SSD buffer memory, is characterized in that, comprises the steps:
Step S100, the data in magnetic disk of intercepting and capturing disk read-write process or thread, is cached in SSD buffer storage space data in magnetic disk as data cached;
Whether step S200, detect in SSD buffer storage and by buffer memory, to empty thread and empty outside destination disc by data cached; If so, enter step S500; Otherwise enter step S300;
Step S300, the usage space of the solid state hard disc that statistics is used as buffer memory, obtains SSD buffer memory utilization rate, and when SSD buffer memory utilization rate exceedes the first pre-set ratio, enters step S400;
Step S400, starts buffer memory and empties thread, by buffer memory, empties thread, and the data cached speed that empties of answering by predefined reference factor pair, by the data cached destination disc that empties in SSD buffer storage;
Step S500, calculates and generates scale factor, and according to scale factor, SSD buffer storage is carried out to the data cached speed adjustment that empties, to the flow control of SSD buffer memory, until the buffer memory utilization rate of SSD buffer storage is lower than predefined the second pre-set ratio.
2. the iostream amount control method of SSD buffer memory according to claim 1, is characterized in that, described step S200 comprises the steps:
Step S210, judges whether that data cached in SSD buffer storage emptied to thread by buffer memory empties outside destination disc;
Step S220, empties outside destination disc if judgement does not empty thread by data cached in SSD buffer storage by buffer memory, enters step S300, monitors it and whether reaches buffer memory and empty thread entry condition and notify and start buffer memory and empty thread; Otherwise jump to step S500, monitoring buffer memory empties speed.
3. the iostream amount control method of SSD buffer memory according to claim 1, is characterized in that, described step S500 comprises the steps:
Step S510, by in the data cached process that is written to destination disc, cumulative statistics writes the data cached byte length of writing IO of SSD buffer storage, it is the IO inflow velocity of SSD buffer storage, and accumulative total is write out SSD Cache Statistics flush byte length, be the data cached speed that empties in SSD buffer memory disk, calculate the scale factor generating in SSD buffer storage;
Step S520, the compared proportions factor and the reference factor, adjust buffer memory according to comparative result and empty speed, empties speed, by the data cached destination disc that empties in SSD buffer storage with new buffer memory;
Step 530, writes back to the data in SSD buffer memory after destination disc, continues the each of record statistics SSD buffer storage and writes the byte length writing out, and discharge corresponding SSD buffer storage space, and statistics obtains the buffer memory utilization rate of SSD buffer storage;
Step S540, judges that whether the buffer memory utilization rate of SSD buffer storage is lower than the second pre-set ratio; If so, finishing buffer memory empties thread and returns; Otherwise, return to step S510, loop flow control.
4. the iostream amount control method of SSD buffer memory according to claim 3, is characterized in that, in described step S520, adjusts buffer memory empty speed according to comparative result, comprises the steps:
Step S521, if proportional factor r atio is more than or equal to reference factor R efRatio, shows that inflow velocity is more than or equal to flush speed, according to the value of proportional factor r atio, adjusts flush speed, makes inflow velocity be less than or equal to flush speed, i.e. vi≤vf;
Step S522, if proportional factor r atio is less than reference factor R efRatio, shows that inflow velocity is less than flush speed, and flush speed v f is constant.
5. the iostream amount control method of SSD buffer memory according to claim 1, is characterized in that:
Described predefined the first pre-set ratio is 70%~90%;
Described predefined the second pre-set ratio is 20%~30%.
6. the iostream amount control method of SSD buffer memory according to claim 4, is characterized in that:
Wherein, in described step S510, described according to the byte length of writing IO of cumulative statistics and flush byte length, calculate proportional factor r atio and be:
If inflow velocity is vi, flush speed is vf, reference factor R efRatio:
Ratio=(vi/vf)*RefRatio;
Wherein, in described step S521, if proportional factor r atio is greater than reference factor R efRatio, flush speed v f=vi*(ratio/RefRatio);
Wherein, in described step S522, if proportional factor r atio is less than reference factor R efRatio, flush speed v f remains unchanged.
7. a SSD buffer storage, comprises as being connected to the solid-state hard disk SSD as buffer memory on external disk, it is characterized in that, also comprises buffer control device;
Described buffer control device, comprises intercepting and capturing module, detection module, and statistical module, empties processing module, calculates and adjusts control module;
Wherein:
Described intercepting and capturing module, for intercepting and capturing the data in magnetic disk of disk read-write process or thread, is cached in solid-state hard disk SSD data in magnetic disk as data cached;
Described detection module, empties thread for detection of whether by buffer memory and empties outside destination disc by data cached; If so, forwarding calculating adjustment control module to processes; Otherwise forwarding statistical module to processes;
Described statistical module, for adding up the usage space of solid state hard disc, obtains SSD buffer memory utilization rate, and when SSD buffer memory utilization rate exceedes the first pre-set ratio, enters and empty processing module;
The described processing module that empties, empties thread for starting buffer memory, by buffer memory, empties thread, and the data cached speed that empties of answering by predefined reference factor pair, by the data cached destination disc that empties in SSD buffer storage;
Control module is adjusted in described calculating, be used for calculating generation scale factor, and according to scale factor, SSD buffer storage is carried out to the data cached speed adjustment that empties, to the flow control of SSD buffer memory, until the buffer memory utilization rate of SSD buffer storage is lower than predefined the second pre-set ratio.
8. SSD buffer storage according to claim 7, is characterized in that, described detection module comprises judgement submodule, and submodule is processed in judgement, wherein:
Described judgement submodule, for judging whether that SSD buffer storage data cached emptied to thread by buffer memory empties outside destination disc;
Submodule is processed in described judgement, if solid state hard disc data cached do not emptied to thread by buffer memory for judgement, empty outside destination disc, forward statistical module to, monitor its whether reach buffer memory empty thread entry condition and notify start buffer memory empty thread; Otherwise jump to calculate, adjust control module, monitoring buffer memory empties speed.
9. SSD buffer storage according to claim 7, is characterized in that, control module is adjusted in described calculating, comprises calculating sub module, relatively adjusts submodule, discharges submodule, and judgement finishes submodule;
Wherein:
Described calculating sub module, for by the data cached process that is written to destination disc, cumulative statistics writes the data cached byte length of writing IO of SSD buffer storage, it is the IO inflow velocity of SSD buffer storage, and accumulative total is write out SSD Cache Statistics flush byte length, be the data cached speed that empties in SSD buffer memory disk, calculate the scale factor generating in SSD buffer storage;
The described submodule of relatively adjusting, for the compared proportions factor and the reference factor, adjusts buffer memory according to comparative result and empties speed, empties speed, by the data cached destination disc that empties in SSD buffer storage with new buffer memory;
Described release submodule, for the data of SSD buffer memory are write back to after destination disc, continue the each of record statistics SSD buffer storage and write the byte length writing out, and discharge corresponding SSD buffer storage space, statistics obtains the buffer memory utilization rate of SSD buffer storage;
Described judgement finishes submodule, for the buffer memory utilization rate that judges SSD buffer storage whether lower than the second pre-set ratio; If so, finishing buffer memory empties thread and returns; Otherwise, return to calculating sub module, loop flow control.
10. SSD buffer storage according to claim 7, is characterized in that, described predefined the first pre-set ratio is 70%~90%; Described predefined the second pre-set ratio is 20%~30%.
CN201210383733.9A 2012-10-11 2012-10-11 The iostream amount control method of SSD caching and device Active CN103729313B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210383733.9A CN103729313B (en) 2012-10-11 2012-10-11 The iostream amount control method of SSD caching and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210383733.9A CN103729313B (en) 2012-10-11 2012-10-11 The iostream amount control method of SSD caching and device

Publications (2)

Publication Number Publication Date
CN103729313A true CN103729313A (en) 2014-04-16
CN103729313B CN103729313B (en) 2016-08-17

Family

ID=50453393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210383733.9A Active CN103729313B (en) 2012-10-11 2012-10-11 The iostream amount control method of SSD caching and device

Country Status (1)

Country Link
CN (1) CN103729313B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260138A (en) * 2015-09-30 2016-01-20 福州瑞芯微电子股份有限公司 Read/write control system and method
CN107544755A (en) * 2017-08-02 2018-01-05 新华三云计算技术有限公司 The control method and device of a kind of reading and writing data
CN107728939A (en) * 2017-09-26 2018-02-23 郑州云海信息技术有限公司 I O scheduling method, apparatus, equipment and storage medium based on Linux
CN107832008A (en) * 2017-10-25 2018-03-23 记忆科技(深圳)有限公司 A kind of method of raising SSD write performance uniformity
CN108763107A (en) * 2018-06-04 2018-11-06 平安科技(深圳)有限公司 Write disk flow control method, device, electronic equipment and storage medium in backstage
CN110119251A (en) * 2019-05-14 2019-08-13 北京杰思安全科技有限公司 A kind of buffer control method and system based on disk big flow
CN111107017A (en) * 2019-12-06 2020-05-05 苏州浪潮智能科技有限公司 Method, equipment and storage medium for processing switch message congestion
WO2021082720A1 (en) * 2019-10-31 2021-05-06 华为技术有限公司 Data processing method and apparatus
CN114442935A (en) * 2021-12-29 2022-05-06 天翼云科技有限公司 Method and device for scrubbing data, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1427582A (en) * 2001-12-19 2003-07-02 华为技术有限公司 Method of controlling Ethernet data flow quantity on synchronous numerical system transmission net
CN1758633A (en) * 2004-10-10 2006-04-12 中兴通讯股份有限公司 Method for controlling communication flow of network management system
CN101459605A (en) * 2008-12-31 2009-06-17 成都市华为赛门铁克科技有限公司 Method and device for flow control
CN102546376A (en) * 2010-12-27 2012-07-04 扬智电子科技(上海)有限公司 Half-duplex mode-based flow control method and network communication device adopting same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1427582A (en) * 2001-12-19 2003-07-02 华为技术有限公司 Method of controlling Ethernet data flow quantity on synchronous numerical system transmission net
CN1758633A (en) * 2004-10-10 2006-04-12 中兴通讯股份有限公司 Method for controlling communication flow of network management system
CN101459605A (en) * 2008-12-31 2009-06-17 成都市华为赛门铁克科技有限公司 Method and device for flow control
CN102546376A (en) * 2010-12-27 2012-07-04 扬智电子科技(上海)有限公司 Half-duplex mode-based flow control method and network communication device adopting same

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260138A (en) * 2015-09-30 2016-01-20 福州瑞芯微电子股份有限公司 Read/write control system and method
CN107544755A (en) * 2017-08-02 2018-01-05 新华三云计算技术有限公司 The control method and device of a kind of reading and writing data
CN107544755B (en) * 2017-08-02 2020-10-13 新华三云计算技术有限公司 Data read-write control method and device
CN107728939A (en) * 2017-09-26 2018-02-23 郑州云海信息技术有限公司 I O scheduling method, apparatus, equipment and storage medium based on Linux
CN107832008A (en) * 2017-10-25 2018-03-23 记忆科技(深圳)有限公司 A kind of method of raising SSD write performance uniformity
WO2019232994A1 (en) * 2018-06-04 2019-12-12 平安科技(深圳)有限公司 Flow control method and apparatus for writing in disk in background, and electronic device and storage medium
CN108763107A (en) * 2018-06-04 2018-11-06 平安科技(深圳)有限公司 Write disk flow control method, device, electronic equipment and storage medium in backstage
CN108763107B (en) * 2018-06-04 2022-03-01 平安科技(深圳)有限公司 Background disc writing flow control method and device, electronic equipment and storage medium
CN110119251A (en) * 2019-05-14 2019-08-13 北京杰思安全科技有限公司 A kind of buffer control method and system based on disk big flow
CN110119251B (en) * 2019-05-14 2023-01-03 北京杰思安全科技有限公司 Buffer control method and system based on disk large flow
WO2021082720A1 (en) * 2019-10-31 2021-05-06 华为技术有限公司 Data processing method and apparatus
CN111107017A (en) * 2019-12-06 2020-05-05 苏州浪潮智能科技有限公司 Method, equipment and storage medium for processing switch message congestion
CN114442935A (en) * 2021-12-29 2022-05-06 天翼云科技有限公司 Method and device for scrubbing data, electronic equipment and storage medium
CN114442935B (en) * 2021-12-29 2023-08-04 天翼云科技有限公司 Method and device for brushing dirty data, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN103729313B (en) 2016-08-17

Similar Documents

Publication Publication Date Title
CN103729313A (en) Method and device for controlling input and output flow of SSD cache
US8918536B1 (en) Method and apparatus for optimizing computer network usage to prevent congestion
CN110417677B (en) QoS control method based on Ceph distributed storage Osd end data Recovery
JP6480642B2 (en) Stochastic bandwidth adjustment
US8898674B2 (en) Memory databus utilization management system and computer program product
US20170277460A1 (en) Power-reducing memory subsystem having a system cache and local resource management
CN109558071A (en) The reactive power management of non-volatile memory controller
US9235517B2 (en) Implementing dynamic cache enabling and disabling based upon workload
CN110275670B (en) Method and device for controlling data flow in storage device, storage device and storage medium
US20120290789A1 (en) Preferentially accelerating applications in a multi-tenant storage system via utility driven data caching
AU2016359128A1 (en) A method to enforce proportional bandwidth allocations for quality of service
US7660964B2 (en) Windowing external block translations
KR102264544B1 (en) Method for filtering cached input/output data based on data generation/consumption
CN110912922A (en) Image transmission method and device, electronic equipment and storage medium
CN114020209A (en) Client service speed limiting method, device, equipment and storage medium
CN110569203B (en) Input control method and device and storage equipment
US11044167B2 (en) Intraday resource management system
CN101840313B (en) LUN mirror image processing method and equipment
US20050038971A1 (en) Adjustment of free storage capacity for improved usage
CN107832008A (en) A kind of method of raising SSD write performance uniformity
EP4339788A1 (en) Performance and power balanced cache partial power down policy
US20170277461A1 (en) Power-reducing memory subsystem having a system cache and local resource management
US20240095168A1 (en) Dynamic Cache Resource Allocation for Quality of Service and System Power Reduction
Zhang et al. Achieving completion time guarantees in an opportunistic data migration scheme
AU2004203468B2 (en) Optimisation of Memory Usage

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20160701

Address after: 215000 Suzhou Industrial Park, Jiangsu Province, if the waterway is No. 388, E750 room

Applicant after: SUZHOU ACQUITRONIX INFORMATION TECHNOLOGY CO., LTD.

Address before: Suzhou City, Jiangsu Province, Suzhou Industrial Park, 215021 Street No. 218 Nano Technology Park building A4 room 505

Applicant before: Suzhou Ejitec Co., Ltd.

C14 Grant of patent or utility model
GR01 Patent grant
CB03 Change of inventor or designer information

Inventor after: Wu Huaqiang

Inventor after: Gao Bin

Inventor after: Pang Yachuan

Inventor after: Qian He

Inventor before: Pei Jingan

Inventor before: Liu Hongyue

Inventor before: Wang Shu

Inventor before: Wang Xuguang

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20170810

Address after: 100084 Beijing City, Haidian District Tsinghua Yuan

Patentee after: Tsinghua University

Address before: 215000 Suzhou Industrial Park, Jiangsu Province, if the waterway is No. 388, E750 room

Patentee before: SUZHOU ACQUITRONIX INFORMATION TECHNOLOGY CO., LTD.