Invention content
This application provides disk method and device is kicked in a kind of cloud storage system, can be greatly reduced to avoid writing speed
Disk influence cloud storage system performance.
Disk method is kicked in a kind of cloud storage system provided by the embodiments of the present application, including:
A, every piece of disk first threshold and second threshold are set in cloud storage system, the first threshold is write-in data
The max-thresholds of queue, second threshold are the minimum write performance threshold value of disk;
B, the number of tasks blocked in data write-in queue is found out in cloud storage system to be greater than or equal to first threshold and write
Enter speed and be less than or equal to second threshold disk, the disk is kicked out of into cloud storage system.
Optionally, step B includes:
The write-in data queue of each piece of hard disk of each data memory node in B1, monitoring cloud storage system;It is all
Writing task enter data write-in queue and be lined up, the number of tasks blocked in queue, which is written, to data counts;
B2, judge whether the number of tasks blocked in data write-in queue is greater than or equal to first threshold, if so, being directed to data
The disk that the number of tasks blocked in write-in queue is more than first threshold executes step B3, otherwise return to step B1;
B3, the disk writing speed is obtained, judges whether said write speed is less than or equal to second threshold, if so,
Step B4 is executed, otherwise return to step B1;
B4, the disk is kicked out of into cloud storage system, is then back to step B1.
Optionally, any value of the first threshold value between 500-1000.
Optionally, the second threshold value range is 1MB/s to 5MB/s.
Optionally, in same cloud storage system, first threshold and the second threshold difference of the disk of same model are equal.
The embodiment of the present application also provides disk policy enforcement means are kicked in a kind of cloud storage system, which is located at data
Memory node, including:
Threshold setting module, for every piece of disk first threshold and second threshold to be arranged, the first threshold is write-in number
According to the max-thresholds of queue, second threshold is the minimum write performance threshold value of disk;
Data queue's maintenance module is written, the write-in data queue of each piece of hard disk for supervising data storage node;
All writing tasks enter data write-in queue and are lined up, and the number of tasks blocked in queue, which is written, to data counts;
Judgment module, for judging whether the number of tasks blocked in the data write-in queue is greater than or equal to the first threshold
Value obtains the disk write-in speed if so, being more than the disk of first threshold for the number of tasks blocked in data write-in queue
Degree, judges whether said write speed is less than or equal to second threshold, if so, by the identification notification execution module of the disk;
Execution module, for according to the disk mark from judgment module, the disk being identified corresponding disk and is kicked out of
Cloud storage system.
Optionally, any value of the first threshold value between 500-1000.
Optionally, the second threshold value range is 1MB/s to 5MB/s.
As can be seen from the above technical solutions, it is monitored by the write-in data queue to disk, and according to disk
Write performance comes whether comprehensive descision disk is normal, carries out kicking disk processing, the application side for the disk of low-quality disk or degraded performance
Case can be to handling in so-called " the slow disk " that will damage edge, it is ensured that the overall performance of cloud storage and safety.
Specific implementation mode
This application provides disk method is kicked in a kind of cloud storage system, fundamental design idea is:By to disk
Whether write-in data queue is monitored, and normal come comprehensive descision disk according to the write performance of disk, for low-quality disk or
The disk of degraded performance carries out kicking disk processing.Specifically,
A, every piece of disk first threshold and second threshold are set in cloud storage system, the first threshold is write-in data
The max-thresholds of queue, second threshold are the minimum write performance threshold value of disk;
B, the number of tasks blocked in data write-in queue is found out in cloud storage system to be greater than or equal to first threshold and write
Enter speed and be less than or equal to second threshold disk, the disk is kicked out of into cloud storage system.
To keep the technical principle, feature and technique effect of technical scheme clearer, below in conjunction with specific reality
Example is applied technical scheme is described in detail.
Disk process flow is kicked as shown in Figure 1, including the following steps in cloud storage system provided by the embodiments of the present application:
Step 101:Every piece of disk first threshold and second threshold are set in cloud storage system, and the first threshold is to write
Enter the max-thresholds of data queue " write_queue ", second threshold is the minimum write performance threshold value of disk;
Step 102:Monitor the write-in data queue of each piece of hard disk of each data memory node in cloud storage system
"write_queue";All writing tasks enter data write-in queue and are lined up, to data be written in queue the number of tasks blocked into
Row statistics;
Step 103:Judge whether the number of tasks blocked in data write-in queue is greater than or equal to first threshold, if so, needle
Data are written with the disk execution step 104 that the number of tasks blocked in queue is more than first threshold, otherwise return to step 102;
Step 104:The disk writing speed is obtained, judges whether said write speed is less than or equal to second threshold,
If so, executing step 105, otherwise return to step 102.
Step 105:The disk is kicked out of into cloud storage system.It is then back to step 102, continues the feelings for monitoring other disks
Condition.
The setting of above all threshold values can be automatically configured by parameter mode when data storage service starts;
First threshold is the number of tasks being written in data queue " write_queue ", disk when considering data write-in
Whether read-write is busy and the states such as network delay, any value of the usual value of first threshold between 500-1000;
Second threshold is the minimum write performance threshold value of disk, mainly according in the theoretical value of disk and practical application
Actual readwrite performance considers on every piece of disk, and the value range that second threshold is usually arranged is 1MB/s to 5MB/s.For example,
It can set second threshold to 2MB/s.
In general, the same cloud storage system uses the disk of same model, therefore all first thresholds can be made
And second threshold value is consistent.It, can be according to difference if being used in mixed way various types of disks in cloud storage system
The performance of model disk is different, is adjusted to first threshold and/or second threshold.
When the operating system that another embodiment of the application gives data memory node is Linux system, disk write is obtained
Enter the method for speed, including:
The write performance when front disk is obtained from/proc/diskstats.
Obtaining disk speed performance order is:
cat/proc/diskstats|grep-E sda|awk'{print$3""$6""$10}'
2 data are obtained using the order interval time t, the difference divided by time t between 2 data are exactly current magnetic
The writing speed of disk." sda " in order line is the disc identifier that data queue is written and is more than threshold value and continues to increase.
The embodiment of the present application also provides disk policy enforcement means are kicked in a kind of cloud storage system, which is located at data
Memory node, including:
Threshold setting module, for every piece of disk first threshold and second threshold to be arranged, the first threshold is write-in number
According to the max-thresholds of queue, second threshold is the minimum write performance threshold value of disk;
Data queue's maintenance module is written, the write-in data queue of each piece of hard disk for supervising data storage node;
All writing tasks enter data write-in queue and are lined up, and the number of tasks blocked in queue, which is written, to data counts;
Judgment module, for judging whether the number of tasks blocked in the data write-in queue is greater than or equal to the first threshold
Value obtains the disk write-in speed if so, being more than the disk of first threshold for the number of tasks blocked in data write-in queue
Degree, judges whether said write speed is less than or equal to second threshold, if so, by the identification notification execution module of the disk;
Execution module, for according to the disk mark from judgment module, the disk being identified corresponding disk and is kicked out of
Cloud storage system.
Optionally, any value of the first threshold value between 500-1000.
Optionally, the second threshold value range is 1MB/s to 5MB/s.
It should be appreciated that although this specification is described according to each embodiment, not each embodiment is only wrapped
Containing an independent technical solution, this description of the specification is merely for the sake of clarity, and those skilled in the art should
It considers the specification as a whole, the technical solution in each embodiment may also be suitably combined to form people in the art
The other embodiment that member is appreciated that.
The foregoing is merely the preferred embodiments of the application, not to limit the protection domain of the application, it is all
Within the spirit and principle of technical scheme, any modification, equivalent substitution, improvement and etc. done should be included in this Shen
Within the scope of please protecting.