Embodiment
Further specify the technical scheme of the embodiment of the invention below in conjunction with the drawings and specific embodiments, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Fig. 1 is method embodiment one process flow diagram of copies data provided by the invention, and the method for embodiment of the invention copies data is meant from disk to the buffer area copy data.That is to say that after copies data, disk and buffer area are all preserved the data that are copied.As shown in Figure 1, present embodiment comprises:
Step 11: when the access frequency of buffer area is no more than the high-frequency threshold value,, determine copying speed to the buffer area copies data according to the access frequency of buffer area, the rate of load condensate of disk and the rate of load condensate of buffer area.
The access frequency of buffer area, IO (input and output) number in expression access cache district accounts for the ratio of total IO number, is also referred to as the hit rate of buffer area.Total IO number is the summation of reading the IO number of buffer area and reading the IO number of disk.Before the buffer area copies data, judge whether the access frequency of buffer area is lower than the high-frequency threshold value from disk (for example traditional mechanical disk).If, then determine copying speed according to the visit load of the visit load of disk and buffer area, with according to this copying speed to the buffer area copies data.The access frequency of buffer area is no more than the high-frequency threshold value, and the hot spot data of expression buffer area is few, and utilization factor is not high, for the utilization factor that further improves buffer area can be from disk copies data to buffer area.
Step 12: according to copying speed, from disk to the buffer area copies data.
Further, as shown in Figure 2, when the access frequency of buffer area surpassed the high-frequency threshold value, the method for copies data was as follows:
Step 21: when the access frequency of buffer area surpasses the high-frequency threshold value, determine whether the rate of load condensate of disk and the rate of load condensate of buffer area all do not surpass the first rate of load condensate threshold values.
The access frequency of buffer area surpasses the high-frequency threshold value, and the expression buffer area has been stored more hot spot data, and the utilization factor of buffer area is higher, follow-up need be according to the rate of load condensate decision of disk and buffer area whether from disk to the buffer area copies data.
Step 22: when the rate of load condensate of the rate of load condensate of disk and buffer area all surpasses the first rate of load condensate threshold values, determine copying speed to described buffer area copies data according to system's maximum bandwidth.
If the rate of load condensate of the rate of load condensate of disk and buffer area wherein any one is higher than the first rate of load condensate threshold values, show that buffer area and disk all are in busy state, do not carry out the operation of copies data for not influencing system performance.Rate of load condensate represents that promptly the IO of disk or buffer area handles busy extent, and rate of load condensate is high more, and the processing of expression disc is busy more.
The method of present embodiment copies data when the buffer area copies data, is determined copy opportunity according to the access frequency in current cache district from disk.And determine copying speed according to the visit rate of load condensate of disk and the visit rate of load condensate of buffer area.Thereby making does not influence regular traffic when the buffer area copies data, help improving the overall performance of storage system.
Fig. 3 is method embodiment three process flow diagrams of copies data provided by the invention, and the storage medium of buffer area can be SSD in the present embodiment, and disk can be HDD conventional disc drivers such as (Hard Disk Drive).As shown in Figure 3, present embodiment comprises:
Step 31: user's scene is set so that different maximum copying speed M, the maximum bandwidth N of system to be set.
Step 32: whether the access frequency of judging SSD surpasses the high-frequency threshold value.If do not surpass execution in step 33, if surpass then execution in step 36.
Step 33; Whether the access frequency of judging SSD surpasses the low frequency threshold value.If surpass then execution in step 34, if do not surpass execution in step 35.
The access frequency of SSD does not surpass the high-frequency threshold value, and the hot spot data of expression buffer area is few, can be from HDD to the SDD copies data.But when the access frequency of SSD surpassed the low frequency threshold value, the hot spot data of storage that shows SDD was very few and approach idle condition, for the effect of performance SDD needs in time copy hot spot data from disk to buffer area.When the access frequency of SSD surpasses the low frequency threshold value but surpasses the high-frequency threshold values, the processing that shows SDD has been in certain busy condition, need consider the load of SDD and the load of HDD from HDD to the speed of SDD copies data, thereby avoid influence the entire system performance.
Step 34; When the access frequency of SSD surpasses the low frequency threshold value, determine to be: M * (1-β), and copies data from the copying speed of HDD when the SSD copies data.
Wherein, β is the mxm. in the maximum load rate of the maximum load rate of HDD and SDD, the maximum copying speed of M for allowing.During copies data service feature being had certain influence, with less than the speed copies data of M the time, is acceptable to the influence of service feature.
Step 35: when the access frequency of SSD surpasses the low frequency threshold value, determine to be: 10% * N, and copies data from the copying speed of HDD when the SSD copies data.
Wherein, N is system's maximum bandwidth, and little when machine-readable, N is the bandwidth of maximum IOPS correspondence; Bulk is when machine-readable, and N is a maximum bandwidth.IOPS (I/Os per second): i.e. per second input and output number of times.The IO frequency of the system that refers to treatable maximum in the unit interval.
Step 36: when the access frequency of SSD surpasses the high-frequency threshold value, judge whether the rate of load condensate of HDD and the rate of load condensate of SDD all do not surpass the first rate of load condensate threshold values.If execution in step 37, otherwise execution in step 38.
The first rate of load condensate threshold values can be 95%.When the access frequency of SDD surpassed the high-frequency threshold values, if wherein any one is more than or equal to 95% for first rate of load condensate of the rate of load condensate of HDD and SDD, it was busy then to be considered as system, not copies data.
Step 37: when the rate of load condensate of the rate of load condensate of HDD and SDD all surpasses the first rate of load condensate threshold values, determine to be: 10% * N, and copies data from the copying speed of HDD when the SSD copies data.N value herein is identical with N value in the step 35.
When the access frequency of SDD surpasses the high-frequency threshold values, if the rate of load condensate of the rate of load condensate of HDD and SDD does not all surpass the first rate of load condensate threshold values, but show the copy of HDD and SDD deal with data, determine that copying speed is 10% * N.
Step 38; When the rate of load condensate that surpasses the first rate of load condensate threshold values or SDD in the rate of load condensate of HDD overloads the rate threshold values, copies data not.
The method of present embodiment copies data, according to the different user scene setting different maximum copying speed M and the maximum bandwidth N of system.When the access frequency of SDD surpasses the high-frequency threshold values, and the rate of load condensate of the rate of load condensate of HDD and SDD is when all surpassing the first rate of load condensate threshold values, to the buffer area copies data, otherwise copies data not.In addition, when the access frequency of SDD surpasses the high-frequency threshold values and surpasses the low frequency threshold values, determine speed when the SDD copies data according to system's maximum bandwidth.When the access frequency of SDD surpasses the low frequency threshold values, determine speed when the SDD copies data according to the maximum copying speed that allows.Because the access speed when the present invention dynamically adjusts copies data according to the access frequency of SSD does not influence other business of system, and has improved the utilization factor of SSD Cache.
Fig. 4 is method embodiment one process flow diagram of reading of data provided by the invention, and as shown in Figure 4, present embodiment comprises:
Step 41: after receiving read request, judge the data that whether store described read request visit in the buffer area.
Step 42: when in buffer area, storing the data of read request visit,, determine from buffer area or disk, to read the data of described read request visit according to the rate of load condensate of disk and the balanced rate of visit of buffer area.
Can not only store hot spot data among the SSD, when copies data in SDD, need suitably one piece of data not copied in SDD according to actual read number according to business characteristic, system like this both can read from SSD during reading of data, can read from HDD again.
The method of present embodiment reading of data, when buffer area stores the data of read request visit, according to the rate of load condensate of described mechanical hard disk and the balanced rate of visit of described buffer area, determine from disk still is buffer area, to read the data of described read request visit, make the visit of system not exclusively depend on the performance of buffer area, reach the purpose of buffer area and disk access equilibrium, improved the overall performance of storage system.
Fig. 5 is method embodiment two process flow diagrams of reading of data provided by the invention, and the storage medium of buffer area is SSD in the present embodiment, and disk is HDD.As shown in Figure 5, present embodiment comprises:
Step 51: user's scene is set so that the balanced rate of different visits, the second rate of load condensate threshold value and balanced rate threshold value to be set.
Step 52: whether the data of read request visit are in SSD.In the time of not in SSD, execution in step 53, otherwise execution in step 54.
Step 53: reading of data from HDD.
The data of read request visit not in SSD, reading of data from HDD.
Step 54: the data of read request visit judge whether the HDD rate of load condensate reaches the second rate of load condensate threshold value in SSD.If reach execution in step 55, otherwise execution in step 56.
Step 55: the data that from SSD, read the read request visit.
The HDD rate of load condensate reaches the second rate of load condensate threshold value, and the visit capacity of expression HDD is bigger, has reached the processing limit of HDD.When the HDD rate of load condensate reaches the second rate of load condensate threshold value, from SSD, read the data of read request visit.Can be by the busy extent of HDD, for example the IO of HDD postpones situation, determines the second rate of load condensate threshold values.
When step 56:HDD rate of load condensate does not reach the second rate of load condensate threshold value, judge whether the balanced rate of visit of SSD reaches balanced rate threshold value.Reach balanced rate threshold value, then execution in step 53; Otherwise execution in step 55.
Whether the balanced rate of visit (ratio of data volume that reads from SSD and the data volume that reads from HDD) of judging SSD reaches balanced rate threshold value.Quantity, the performance of each SSD and the performance setting of HDD of the SSD that balanced rate threshold value comprises according to SSD Cache.For example, there are m SSD and n HDD in system, and the performance of each SSD is P, and the performance of each HDD is Q.The SSD group total load that can support is m * P so, and it is n * Q that HDD organizes the total load that can support.Balanced rate threshold value is exactly the ratio of m * P and n * Q.
When the balanced rate of the visit of SSD reached balanced rate threshold value, the visit capacity of expression SDD was bigger, has reached the processing limit of HDD, reads the data of read request visit from HDD.When the balanced rate of the visit of SSD does not reach balanced rate threshold value, from SSD, read the data of read request visit.
Different business scenarios needs different visit balance policies.For SSD owing to have short access delay characteristic, make its with machine-readable performance than high many of traditional magnetic disk, but its bandwidth and traditional magnetic disk to compare advantage little.So based on machine-readable when professional, as internet, applications, SSD visits large percentage, and to read in bulk be main when professional, and as the IPTV business, HDD visits large percentage.
The method of present embodiment reading of data when storing the data of read request visit among the SDD, is HDD when having reached processing limit if the rate of load condensate of HDD has reached capacity, and direct reading of data from SDD is to alleviate the visit load of HDD; If the rate of load condensate of HDD does not reach capacity, and the balanced rate of the visit of the SDD visit capacity that to surpass balanced rate threshold values be SDD is when too much, and reading of data from HDD is to alleviate the visit load of SDD; If the rate of load condensate of HDD does not reach capacity, and the balanced rate of the visit of the SDD visit capacity that also to surpass balanced rate threshold values be SDD more after a little while, and reading of data from SDD is to improve access speed.Therefore, make that SDD and HDD can obtain utilizing simultaneously, reached the balanced purpose of visit, the overall performance of storage system has been brought into play in maximization.
Fig. 6 is the structural representation of the device embodiment one of copies data provided by the invention.As shown in Figure 6, present embodiment comprises: the first speed determination module 61 and copy module 62 and frequency judge module 63.
Frequency judge module 63 is used to judge whether the access frequency of buffer area surpasses the high-frequency threshold value.
The first speed determination module 61, be used for when frequency judge module 63 determines that the access frequency of buffer area is no more than the high-frequency threshold value, according to the access frequency of buffer area, the rate of load condensate of disk and the rate of load condensate of buffer area, determine copying speed to the buffer area copies data;
Copy module 62 is used for the copying speed determined according to the first speed determination module 61, from disk to the buffer area copies data.
Further, as shown in Figure 7, the device of copies data also comprises: rate of load condensate judge module 64 and second speed determination module 65.
Rate of load condensate judge module 64 is used for when frequency judge module 63 determines that the access frequency of buffer area surpasses the high-frequency threshold value, judges whether the rate of load condensate of disk and the rate of load condensate of buffer area all do not surpass the first rate of load condensate threshold values;
Second speed determination module 65 is used for when rate of load condensate judge module 64 determines that the rate of load condensate of the rate of load condensate of disks and buffer area all surpasses the first rate of load condensate threshold values, determines copying speed to the buffer area copies data according to system's maximum bandwidth.
The working mechanism of above-mentioned each module does not repeat them here referring to describing among Fig. 1 and the corresponding embodiment of Fig. 2.
The device of present embodiment copies data when the buffer area copies data, is determined copy opportunity according to the access frequency in current cache district from disk.And determine copying speed according to the visit load of the visit load of disk and buffer area.Thereby making does not influence regular traffic when the buffer area copies data, help improving the overall performance of storage system.
Fig. 8 is the structural representation of the device embodiment three of copies data provided by the invention.As shown in Figure 8, the first speed determination module 61 comprises: the first speed determining unit 611 and second speed determining unit 612.
The first speed determining unit 611, be used for when frequency judge module 63 determines that the access frequency of buffer area surpasses the low frequency threshold value, according to the maximum copying speed of maximal value and system in the maximum load rate of the maximum load rate of disk and buffer area, determine copying speed to the buffer area copies data.
Second speed determining unit 612 is used for when frequency judge module 63 determines that the access frequency of buffer area is no more than the low frequency threshold value, according to the definite copying speed to the buffer area copies data of system's maximum bandwidth.
The working mechanism of above-mentioned each module does not repeat them here referring to describing among the corresponding embodiment of Fig. 3.
The device of present embodiment copies data, when the access frequency of buffer area surpasses the high-frequency threshold values, and the rate of load condensate of the rate of load condensate of disk and buffer area is when all surpassing the first rate of load condensate threshold values, to the buffer area copying speed, otherwise copies data not.In addition, when the access frequency of buffer area surpasses the high-frequency threshold values and surpasses the low frequency threshold values, determine speed when the buffer area copies data according to system's maximum bandwidth.When the access frequency of buffer area surpasses the low frequency threshold values, determine speed when the buffer area copies data according to the maximum copying speed that allows.Because the access speed the when embodiment of the invention is dynamically adjusted copies data according to the access frequency of SSD does not influence other business of system, and has improved the utilization factor of SSD Cache.
Fig. 9 is the structural representation of the device embodiment one of reading of data provided by the invention.As shown in Figure 9, present embodiment comprises: judge module 91 and read module 92.
Judge module 91 after being used to receive the read request of visit disk, is judged the data that whether store the read request visit in the buffer area.
Read module 92 is used for when judge module 91 determines that buffer area stores the data of read request visit, according to the rate of load condensate of disk and the balanced rate of visit of buffer area, determines to read the data of read request visit from buffer area or disk.
The working mechanism of above-mentioned each module does not repeat them here referring to describing among the corresponding embodiment of Fig. 4.
The device of present embodiment reading of data, when buffer area stores the data of read request visit, according to the rate of load condensate of mechanical hard disk and the balanced rate of visit of buffer area, determine from disk still is buffer area, to read the data of read request visit, make the visit of system not exclusively depend on the performance of buffer area, reach the purpose of buffer area and disk access equilibrium, improved the overall performance of storage system.
Figure 10 is the structural representation of the device embodiment two of reading of data provided by the invention.As shown in figure 10, read module 92 comprises: first judging unit 921, reading unit 922 and second judging unit 923.
First judging unit 921 is used to judge whether the rate of load condensate of disk reaches the second rate of load condensate threshold value.
Reading unit 922 is used for reading the data of read request visit from buffer area when first judging unit 921 determines that the rate of load condensate of disk reaches the second rate of load condensate threshold value.
Second judging unit 923 is used for when first judging unit 921 determines that the rate of load condensate of disk does not reach the second rate of load condensate threshold value, judges whether the balanced rate of visit of buffer area reaches balanced rate threshold value; The balanced rate of the visit of buffer area is the number percent of data volume that reads and the data volume that reads from disk from buffer area; Quantity, the performance of each solid state hard disc and the performance setting of disk of the solid state hard disc that balanced rate threshold value comprises according to buffer area;
Reading unit 922 when also being used for second judging unit 923 and determining that the balanced rate of visit of buffer areas does not reach balanced rate threshold value, reads the data of read request visit from buffer area;
Reading unit 922 also is used for second judging unit 923 and determines that the balanced rate of visit of buffer area reaches balanced rate threshold value, reads the data of read request visit from disk.
The working mechanism of above-mentioned each module does not repeat them here referring to describing among the corresponding embodiment of Fig. 5.
The device of present embodiment reading of data when storing the data of read request visit in the buffer area, is a disk when having reached processing limit if the rate of load condensate of disk has reached capacity, directly reading of data from buffer area; If the rate of load condensate of disk does not reach capacity, and the balanced rate of the visit of the buffer area visit capacity that to surpass balanced rate threshold values be buffer area is when too much, reading of data from disk; If the rate of load condensate of disk does not reach capacity, and the balanced rate of the visit of the buffer area visit capacity that also to surpass balanced rate threshold values be buffer area more after a little while, reading of data from buffer area.Therefore, make that buffer area and disk can obtain utilizing simultaneously, reached the balanced purpose of visit, the overall performance of storage system has been brought into play in maximization.
Figure 11 is a kind of storage system example structure synoptic diagram provided by the invention.As shown in figure 11.The present embodiment storage system comprises: disk 111 and solid state hard disc 112 also comprise the device 113 of copies data.Wherein disk 111 can be traditional mechanical hard disk, and the device 113 of copies data can be the device of the copies data of describing among the corresponding embodiment of Fig. 6 to Fig. 8, and solid state hard disc 112 is a kind of medium of the buffer area described among the corresponding embodiment of Fig. 6 to Fig. 8.In addition, the present embodiment storage system also can comprise the device of the reading of data of describing among the corresponding embodiment of Fig. 9 to Figure 10.
Figure 12 is an another kind of storage system example structure synoptic diagram provided by the invention.As shown in figure 12.The present embodiment storage system comprises: disk 121 and solid state hard disc 122 also comprise the device 123 of reading of data.Wherein disk 121 can be traditional mechanical hard disk, and the device 123 of reading of data can be the device of the reading of data of describing among the corresponding embodiment of Fig. 9 to Figure 10, and solid state hard disc 122 is a kind of medium of the buffer area described among the corresponding embodiment of Fig. 6 to Fig. 8.In addition, the present embodiment storage system also can comprise the device of the copies data of describing among the corresponding embodiment of Fig. 6 to Fig. 8.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of programmed instruction, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.