Summary of the invention
The method and apparatus that the object of the present invention is to provide a kind of file data storing and read, solve data hierarchy method of the prior art and be merely able to promote the very problem of the read-write response speed of finite population file, make under the identical condition of storage medium configuration, there is more file to obtain the lifting of read-write response speed, thereby significantly promotes the whole input and output performance of storage system.
Be a kind of file data storing and the read method of realizing that the object of the invention provides, comprise step: A. arranges existing different types of storage medium in storage system from short to long according to response time, calculates successively the differential time of the response time of the response time of current kind storage medium and next class storage medium; B. calculate successively the data volume of the wide energy transmission of filled band in described differential time, result of calculation is set as each data writing amount higher limit of corresponding current storage medium and preserves, come the storage medium of last position without each data writing amount higher limit; When C. write data requests occurring, the data in the file that will deposit according to each data writing amount higher limit of every kind of storage medium are deposited into storage medium successively; When D. read data request occurring, send simultaneously or concentrate the transmission reading order to the storage medium that has required file data.
The response time of storage medium is for receiving after read write command to the length of the time of delay of sending desired data from storage medium.
Wherein, described step B comprises: B1. sets application server towards the bandwidth value that reads and writes data of storage medium; B2. calculate in described differential time the data volume that can transmit during the wide transmission of data bandwidth filled band; B3. result of calculation be set as each data writing amount higher limit of corresponding current storage medium and preserve.
Wherein, described step C comprises: when write data requests appearred in C1., whether the data volume of the file that judgement will deposit in greater than the each data writing amount of the storage medium that ranks the first higher limit, was that execution in step C2, no, execution in step C3; C2. according to the every kind of each data writing amount of storage medium higher limit, the data of the file that will deposit in are deposited into two or more storage medium successively; C3. the judgement file that need to deposit in whether be read frequency higher than predeterminated frequency, be, this document is deposited into the storage medium that ranks the first, no, be deposited into other storage mediums.
Wherein, when described storage medium comprised SSD hard disk, SAS hard disk and SATA hard disk, described steps A comprised: A1. arranges three kinds of hard disks from short to long according to response time, and rank results is SSD hard disk, SAS hard disk, SATA hard disk; A2. calculate the differential time of the response time of the response time of described SSD hard disk and described SAS hard disk; Calculate the differential time of the response time of the response time of described SAS hard disk and described SATA hard disk.
Wherein, described step B comprises: B1. sets application server towards the bandwidth value that reads and writes data of the storage array of three kinds of hard disks compositions; B2. calculate the wide data volume that can transmission of in the differential time of the response time of the response time of described SSD hard disk and described SAS hard disk filled band; The wide data volume that can transmission of calculating filled band in the differential time of the response time of the response time of described SAS hard disk and described SATA hard disk; B3. will be in the differential time of the response time of the response time of described SSD hard disk and described SAS hard disk the wide data volume that can transmission of filled band be set as each data writing amount higher limit of SSD hard disk; Will be in the differential time of the response time of the response time of described SAS hard disk and described SATA hard disk the wide data volume that can transmission of filled band be set as each data writing amount higher limit of SAS hard disk, the SATA hard disk is without each data writing amount higher limit.
Wherein, described step C comprises: when write data requests appearred in C1., whether the data volume of the file that judgement will deposit in greater than each data writing amount higher limit of SSD hard disk, was that execution in step C2, no, execution in step C3; Data with each data writing amount higher limit equivalent of SSD hard disk in the file that C2. will deposit in are deposited into the SSD hard disk; Remaining data in file are deposited into the SAS hard disk; If file data also has residue, the remaining data in file is deposited into the SATA hard disk; C3. the judgement file that need to deposit in whether be read frequency higher than predeterminated frequency, be, this document is deposited into the SSD hard disk, no, be deposited into SAS hard disk or SATA hard disk.
The present invention also provides a kind of file data storing and reading device, comprise: set in advance module, be positioned on Control Server, be used for the existing different types of storage medium of storage system is arranged from short to long according to response time, calculate successively the differential time of the response time of the response time of current kind storage medium and next class storage medium; Calculate successively the wide data volume that can transmit of filled band in described differential time, result of calculation is set as each data writing amount higher limit of corresponding current storage medium and preserves; Writing module is positioned on application server, and when being used for write data requests occurring, the data in the file that will deposit according to each data writing amount higher limit of every kind of storage medium are deposited into storage medium successively; Read module is positioned on application server, when being used for read data request occurring, sends simultaneously or concentrate the transmission reading order to the storage medium that has required file data.
The response time of storage medium is for receiving after read write command to the length of the time of delay of sending desired data from storage medium.
Wherein, the described module that sets in advance comprises: the differential time acquisition module, be used for the existing different types of storage medium of storage system is arranged from short to long according to response time, calculate successively the differential time of the response time of the response time of current kind storage medium and next class storage medium; Set the bandwidth module, be used for setting application server towards the bandwidth value that reads and writes data of storage medium; Computing module is used for calculating the wide data volume that can transmit of filled band in described differential time; Memory module is used for result of calculation is set as each data writing amount higher limit of corresponding current storage medium and preserves.
the invention has the beneficial effects as follows: a kind of file data reading/writing method and device that the present invention describes, be stored in different storage mediums by the data sectional with a file, make application server after sending read-write requests simultaneously to several different storage mediums, carry out at other storage mediums in the time of the work such as tracking and internal data transfer, the fastest storage medium of response speed takes the lead in desired data is sent, then response speed time fast storage medium also has been ready to the data that will send, by that analogy, this kind location mode can provide for the read requests of application server at once, the data response that filled band is wide.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, a kind of file data storing of the present invention and the method and apparatus that reads are further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
Due to when the reading writing harddisk, the factor of restriction performance is mainly the seek time of magnetic head and the data transmission bauds of hard disk inside.Therefore, aim of the present invention is when the server write data, can be according to response time and the read or write speed difference of various storage mediums, in conjunction with the readwrite bandwidth between application server and hard disk array, calculate the size of data that to deposit and carry out corresponding striping and process on various storage mediums, so that can be by the relay service of different storage mediums when reading, for the read requests of application server provides data response at once, that filled band is wide.This calculating and data sectional are deposited necessary address allocation procedure and are carried out on the IPSAN Control Server of storage system inside.
A kind of file data reading/writing method provided by the invention as shown in Figure 1, comprises the steps:
A. existing different types of storage medium in storage system is arranged from short to long according to response time, calculated successively the differential time of the response time of the response time of current kind storage medium and next class storage medium.
The response time of storage medium is from storage medium and receives after read write command that to the length of the time of delay of sending desired data, time of delay is longer, and response speed is slower.The response time of hard disk depends primarily on the seek time of magnetic head and the data transmission bauds of hard disk inside.
After sequence, be the first storage medium, the second storage medium, the 3rd storage medium according to all kinds of storage mediums of sequence definition
Calculate the differential time of the response time of the response time of current kind storage medium and next class storage medium, the time difference of namely at first calculating the response time of the first storage medium and the second storage medium, obtain the first differential time; The response time of then calculating the second storage medium and the 3rd storage medium is poor, obtains the second differential time; Calculate again the time difference of the 3rd storage medium and the 4th storage medium ... when not having the 4th storage medium, do not calculate.
B. calculate successively the data volume of the wide energy transmission of filled band in described differential time, result of calculation is set as each data writing amount higher limit of corresponding current storage medium and preserves, come the storage medium of last position without each data writing amount higher limit.
Bandwidth is the call parameter of calculated data amount, should set in advance each application server towards the port bandwidth of storage medium on the IPSAN Control Server.
Calculating in the first differential time, the data volume that bandwidth can transmit fixedly the time, defining this data volume is the first data volume, the first data volume=bandwidth * the first differential time; Calculate again the second data volume, the second data volume=bandwidth * the second differential time ... in the middle of practical application, also should consider the problem of valid data transmission efficiency, at this moment, the first data volume=first differential time * bandwidth * valid data transmission efficiency, the second data volume=second differential time * bandwidth * valid data transmission efficiency, the rest may be inferred, can calculate the data volume in other differential times, repeat no more.
On the IPSAN Control Server, each data volume of calculating gained is designated as each data writing amount higher limit of corresponding storage medium, and it is saved as static data, a limit standard of the data writing amount when storing data into different storage medium.So-called higher limit, the data volume that namely at every turn is written to this kind storage medium can not be more than this higher limit.
When C. write data requests occurring, the data in the file that will deposit according to each data writing amount higher limit of every kind of storage medium are deposited into storage medium successively.
Because every kind of storage medium has all been set corresponding each data writing amount higher limit, therefore file is deposited in the process of different storage mediums, also just Data Division has been become a plurality of data segments.For example, if the data volume that a file arranged greater than each data writing amount (the first data volume) higher limit of the first storage medium less than each data writing amount higher limit sum of the first storage medium and the second storage medium, in the process that writes, the data of each data writing amount higher limit equivalent of the front in this document and the first storage medium are deposited into the first storage medium, remaining data volume writes the second storage medium, and file just has been divided into two data segments and stores like this.If the data volume of certain file is larger, the each data writing amount higher limit sum greater than the first storage medium and the second storage medium is deposited into the 3rd storage medium with the remaining data volume of this document, and like this, file just has been divided into three data segments and has stored.If three kinds of storage mediums are only arranged in storage system, the 3rd storage medium is not set each data writing amount higher limit.
in the middle of practical application, in order to take full advantage of application server reading and writing data bandwidth, the data that identical file is deposited in storage medium of the same race can be deposited in different memory cell through striping, as the reading and writing data bandwidth of supposing application server is 10Gbps, and the first storage medium is the SSD hard disk, its bandwidth that connects by network is 1Gbps, the first data volume is 4.3MB as calculated, the data of the front 4.3MB of a certain file can leave 10 or more on polylith SSD hard disk (bandwidth of 10 or more 1Gbps merge reach the above bandwidth of 10Gbps) in through striping, when the transmission of data, these SSD hard disks transmit data simultaneously, make the application server readwrite bandwidth fully to be occupied and to utilize.
When D. read data request occurring, send simultaneously or concentrate the transmission reading order to the storage medium that has required file data.
When read data request occurring, should guarantee that in all kinds of storage mediums and all kinds of storage medium, each memory cell is to receive simultaneously reading order.But, in actual applications, because application server can't accomplish to send simultaneously many reading orders, can only be one by one, the concentrated area sends reading order, namely each reading order sends in succession, but the time of two adjacent order meeting machine cycles of interval.Because this machine cycle is very of short duration, can ignore, reading order almost arrives all kinds of storage mediums simultaneously.
Almost receive simultaneously under the prerequisite of read write command at all kinds of storage mediums, because the response speed of the first storage medium is the fastest, through the response time of the first storage medium, the first storage medium sends the data of the first data volume in the middle of required file, after the first differential time, the transfer of data of the first data volume is complete.At this moment, almost receive simultaneously the moment of read write command apart from all kinds of storage mediums, elapsed time length is response time and the first differential time sum of the first storage medium, and the response time of the first storage medium and the first differential time sum are the response time of the second storage medium, that is to say from the moment of receiving read write command and count, passed through the response time of the second storage medium, at this moment, the second storage medium is with the DSR of the second data volume of required file and send to application server.When the data of the second data volume are transmitted when complete, the response time of the 3rd storage medium arrives, and the 3rd storage medium sends the data of the 3rd data volume, by that analogy, until the data in file are all sent.
Therefore, after sending the order that reads or writes to the data of certain file, only through the response time of the first storage medium, needed data will wide, continuous the sending of filled band, if the performance of the first storage medium is enough superior, the response time of the first storage medium can be ignored, and namely application server can obtain wide, the continuous data of filled band at once after sending read write command.
Referring to Fig. 2, Fig. 2 is for using the schematic diagram of a kind of storage system of the present invention.By the Ethernet switch Direct Communication, be point-to-point interconnect architecture between the application server of this system and storage medium array, have fixing bandwidth.
On such system architecture, the storage medium of storage system inside can have SSD hard disk, SAS hard disk and SATA hard disk.Technical scheme of the present invention is applied to this storage system, and storage medium is defined as SATA hard disk, SAS hard disk and SSD hard disk, and as shown in Figure 3, technical scheme of the present invention comprises:
A1. SATA hard disk, SAS hard disk and SSD hard disk are arranged from short to long according to response time.
The SSD hard disk is owing to adopting semiconductor technology, there is not the seek time of magnetic head, it is very high that read or write speed can reach, it is only tens of microseconds that read-write postpones, and the rotating speed of SAS hard disk is at 10000 rev/mins to 15000 rev/mins, 2 to 4 milliseconds of the seek time average out to of magnetic head, internal transmission speed is suitable with the SATA hard disk.The SATA hard disk gets 8 to 12 milliseconds of seek time average out to left and right of magnetic head, internal data transfer speed average out to 110MB/ second.Therefore the SSD hard disk should come at first, the SAS hard disk secondly, the result of arrangement is: SSD hard disk, SAS hard disk, SATA hard disk.
A2. calculate the first differential time of the response time of the response time of described SSD hard disk and described SAS hard disk; Calculate the second differential time of the response time of the response time of described SAS hard disk and described SATA hard disk.
The response time of supposing the SAS hard disk is 4ms (millisecond), and the response time of SATA is 12ms, and the response time of SSD hard disk is ignored, the first differential time=4ms-0ms=4ms, the second differential time=12ms-4ms=8ms.
B1. set application server towards the bandwidth value that reads and writes data of the storage array of three kinds of hard disks compositions.
B2. calculate the wide data volume that can transmission of in the differential time of the response time of the response time of described SSD hard disk and described SAS hard disk filled band; The wide data volume that can transmission of calculating filled band in the differential time of the response time of the response time of described SAS hard disk and described SATA hard disk.
Calculate the wide data volume that can transmit of filled band in the first differential time 4ms, this data volume is the first data volume, the first data volume=4ms* bandwidth.In the middle of practical application, also should consider the problem of valid data transmission efficiency, at this moment the first data volume=4ms* bandwidth * valid data transmission efficiency.Calculate the wide data volume that can transmit of filled band in the second differential time 8ms, this data volume is the second data volume, the second data volume=8ms* bandwidth * valid data transmission efficiency.
B3. will be in the differential time of the response time of the response time of described SSD hard disk and described SAS hard disk the wide data volume that can transmission of filled band be set as each data writing amount higher limit of SSD hard disk; Will be in the differential time of the response time of the response time of described SAS hard disk and described SATA hard disk the wide data volume that can transmission of filled band be set as each data writing amount higher limit of SAS hard disk, the SATA hard disk is without each data writing amount higher limit.
Above-mentioned steps A1-B3 be for data deposit and read the preparation of doing in, the parameters such as response time of application server port bandwidth and all kinds of storage mediums can be set when system initialization by the management software by system.After calculating the data volume higher limit that all kinds of hard disks deposit at every turn, the IPSAN Control Server just can be deposited in different hard disks with file fragmentation according to this data value.
When C1. write data requests occurring, whether the data volume of the file that judgement will deposit in greater than each data writing amount higher limit of SSD hard disk, is that execution in step C2, no, execution in step C3;
Data with each data writing amount higher limit equivalent of SSD hard disk in the file that C2. will deposit in are deposited into the SSD hard disk; Remaining data in file are deposited into the SAS hard disk; If file data also has residue, the remaining data in file is deposited into the SATA hard disk.
C3. the judgement file that need to deposit in whether be read frequency higher than predeterminated frequency, be, this document is deposited into the SSD hard disk, no, be deposited into SAS hard disk and/or SATA hard disk.
When write data requests occurring, having some small documents need to deposit in, the size of the file that at first the IPSAN Control Server will deposit in and the first data volume are relatively, when the data volume of the file that will deposit in is less than or equal to the first data volume, according to the practical application scene of small documents, small documents is stored in suitable storage medium.As a kind of embodiment, small documents just can be come the deposit position of regulation small documents according to accessed frequency, what accessed frequency was high deposits in the fast storage medium of response, and the small documents that accessed frequency is low is deposited in the storage medium of low-response.
For the file of data volume greater than the first data volume, the data with the first data volume in file deposit the first storage medium in, deposit the data of the second data volume in the middle of remaining data in file in second storage medium, by that analogy.If there is not the 4th storage medium, deposit the remaining data in file in the 3rd storage medium.
When D. read data request occurring, send simultaneously or concentrate the transmission reading order to the storage medium that has required file data.
Suppose that the readwrite bandwidth between application server and hard disk array is 1Gbps, valid data transmission efficiency is 88%, within the time (approximately 4ms) of SAS hard disk tracking and internal data transfer end, can transmit the approximately data of 430KB.And within the time (approximately 12ms) of SATA hard disk tracking and internal data transfer end, can transmit the approximately data of 1.26MB.In the fastest SSD hard disk of response speed, and follow-up data 830KB (being that 4ms is to the data that should transmit between 12ms) leaves in the SAS hard disk the deposit data of the front 430KB of this document, and the remainder data of this document leaves on the SATA hard disk.
After data keep, assign the reading order of data by the Ethernet interface that connects storage system when application server, this order is stored the IPSAN Control Server of internal system and understands, and be mapped to real LBA (Logical Block Address on physical hard disk by the request that the virtualization engine that is arranged on server will read and write data, LBA), then the address after these mappings is returned to application server, application server is the address concrete according to these, with reading order to concentrate the disposable three kinds of hard disks that mail to.
SAS hard disk and SATA hard disk carry out the magnetic head tracking immediately after receiving order.Due to the outstanding data response speed of SSD hard disk, it can provide data at first.After the SSD hard disk had passed its data (430KB), the SAS hard disk had been ready to leave in the 830KB above it, and transmission immediately.After the SAS hard disk groups had passed data, the SATA hard disk also had been ready to remaining data, continued the transmission of data.
Like this, the experience that the application server end obtains is: when it will read the data of a file, order once the delay of sending through approximately tens of microseconds the data that just can want with the wide continuous acquisition of filled band.So effectively avoid transmission latency of causing because of SAS and SATA hard disc magnetic head seek time, greatly improved the performance of storage system.
The present invention also provides a kind of file data read-write equipment, comprise and set in advance module, be positioned on Control Server, be used for the existing different types of storage medium of storage system is arranged from short to long according to response time, calculate successively the differential time of the response time of the response time of current kind storage medium and next class storage medium; Calculate successively the wide data volume that can transmit of filled band in described differential time, result of calculation is set as each data writing amount higher limit of corresponding current storage medium and preserves; Writing module is positioned on application server, and when being used for write data requests occurring, the data in the file that will deposit according to each data writing amount higher limit of every kind of storage medium are deposited into storage medium successively; Read module is positioned on application server, when being used for read data request occurring, sends simultaneously or concentrate the transmission reading order to the storage medium that has required file data.
As a kind of embodiment, the described module that sets in advance comprises: the differential time acquisition module, be used for the existing different types of storage medium of storage system is arranged from short to long according to response time, calculate successively the differential time of the response time of the response time of current kind storage medium and next class storage medium; Set the bandwidth module, be used for setting application server towards the bandwidth value that reads and writes data of storage medium; Computing module is used for calculating the wide data volume that can transmit of filled band in described differential time; Memory module is used for result of calculation is set as each data writing amount higher limit of corresponding current storage medium and preserves.
A kind of file data storing provided by the invention and the method and apparatus that reads, the allocation ratio of various storage mediums is identical in system, namely under the prerequisite suitable with the cost of existing storage system, there is more file to obtain the lifting of read-write response speed, thereby significantly promotes the whole input and output performance of storage system.
Should be noted that at last obviously, those skilled in the art can carry out various changes and modification and not break away from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these were revised and modification belongs to the scope of claim of the present invention and equivalent technologies thereof, the present invention also was intended to comprise these changes and modification.