This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2015-001068, filed on Jan. 6, 2015, the entire contents of which are incorporated herein by reference.
The embodiments discussed herein are related to an arrangement technique of data.
In a storage device, a throughput in an irregular access to data having a small size is low, and cost for random access is high as compared to cost for sequential access. As a technique for improving this throughput, a cache technique is used.
The cache technique is a technique in which, when a control device in which a processing speed is fast reads out data faster from a low-speed storage device, processing time is shortened using a memory. When the control device reads out data from the low-speed storage device, the read-out data is held temporarily in the memory, and thereby, from the next time, the data can be read out from the memory faster than a hard disk in reading and writing.
About the above-described cache technique, for example, a least frequently used (LFU) algorithm and a least recently used (LRU) algorithm are used. Alternatively, as one of the cache techniques, a data relocation (technique is used in which, based on an access history, data having relevance is collected into the same data segment and is written back to a disk (e.g., Patent Literature 1).
Patent Literature 1: International Publication Pamphlet No. WO 2013/114538
A non-transitory computer-readable recording medium has stored therein a data arrangement program that causes a computer to execute a process including: selecting one or more data segments from a first storage device according to a free capacity of the first storage device that stores a plurality of data segments, each of the plurality of data segments being a data group grouped according to data relevance between data included in the data group; calculating an evaluation value based on the data relevance between the data included in the selected data segments; and determining arrangement positions of the selected data segments in storage areas of a second storage device based on the evaluation value and readout performance information of a plurality of storage areas in the second storage device in which readout performance differs by the plurality of storage areas.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention.
In data segments generated by an data relocation technique, some data segments in which data having a strong relevance is aggregated and the other data segments in which data having a not-so-strong relevance is aggregated are present. In data in which reading efficiency is high, the data segment in which the data having a strong relevance is aggregated includes both types of related data. Therefore, when both types of data are readout to a cache, it is easy for a cache hit ratio to become high (namely, the reading efficiency is high). On the other hand, the data segment in which the data having a not-so-strong relevance is aggregated includes either both types of data having no relation to each other or both types of data that are related but not strongly related to each other. Therefore, even if both types of data are readout to the cache, it is difficult for the cache hit rate to become high (namely, the reading efficiency is low).
The “reading efficiency is high” or “reading efficiency is low” characteristics in the above-described data segments change according to a change in a pattern of data access or an importance level of individual data.
However, when a size, an access frequency, and characteristics of data (data segments in the case of the data relocation technique) or characteristics of disks are not considered and the data are written back, the data segments in which the reading efficiency is different are mixed and written back. As a result, when the data are then collectively read out from the disks, useless data also are read out.
Further, in sequential read performance of the disk, the outer peripheral side of the disk has a shorter read time of the data than the inner peripheral side thereof, namely, the outer peripheral side has a higher sequential read performance than the inner peripheral side. Thus, in the sequential read performance of the disk, for example, a performance difference of 1.5 to 2 times at a maximum is present based on a physical position (the inner peripheral side or the outer peripheral side of the disk) of the data. Accordingly, when the data having a large size is readout from the disk, the read time is largely different based on the physical position of the data.
However, the collective readout of the data has a larger read cost than the readout of a single piece of data. Therefore, when the data segment in which the reading efficiency is low is recorded on the inner peripheral side, the read cost at the time of collectively reading out data becomes large as compared to a case in which the data is recorded on the outer peripheral side.
In the present embodiment, as one aspect, a technique is provided of improving the reading efficiency of the data from a storage device in which the readout performance differs according to positions of memory areas.
The selection unit 2 selects one or more data segments from a first storage device according to a free capacity of the first storage device that stores a plurality of data segments. Each of the plurality of data segments is a data group grouped according to data relevance between data included in the data group. As an example of the selection unit 2, a control device 21 serving as a write-back execution unit 26 is included. As an example of the first storage device, a memory 31 is included.
The calculation unit 3 calculates an evaluation value based on the data relevance between the data included in the selected data segments. As an example of the calculation unit 3, the control device 21 serving as a characteristic extraction unit 27 is included. As an example of a second storage device, a disk 41 is included.
The determining unit 4 determines arrangement positions of the selected data segments in storage areas of a second storage device based on the evaluation value and readout performance information of a plurality of storage areas in the second storage device in which readout performance differs by the plurality of storage areas. As an example of the determining unit 4, the control device 21 serving as a recording place determining unit 29 is included. As an example of the information about the readout performance according to the position of the storage area, a disk performance storage table 37 is included.
In the above-described configuration, the readout efficiency of the data from the memory device in which the readout performance differs according to the position of the memory area can be improved.
The calculation unit 3 calculates the evaluation value to be higher as the data relevance between the data included in the data segments becomes stronger. Based on the evaluation value and the readout performance information, the determining unit 4 determines that the arrangement positions becomes higher in the readout performance as the evaluation value of the data segments becomes higher.
In the above-described configuration, the data segment including the data group that is easy to access is arranged in a position in which the readout performance is high, thereby suppressing an increase in the read cost.
The data arrangement apparatus 1 further includes a write unit 5. Based on the determined arrangement positions, the write unit 5 writes the selected data segments in the storage areas. As an example of the write unit 5, the control device 21 serving as the write-back execution unit 26 is included.
In the above-described configuration, the data segment in which the readout efficiency is more efficient is arranged in a position in which the readout performance is high, thereby suppressing an increase in the read cost.
The data arrangement apparatus 1 further includes the reading unit 6. According to the arrangement positions of the data segments including data specified by a read request, the reading unit 6 changes the number of data segments to be read out from the storage areas. And The reading unit 6 reads out the data segments arranged continuously in the storage areas from the arrangement positions by the number of the data segments. As an example of the reading unit 6, the control device 21 serving as an input-output management unit 22 is included.
In the above-described configuration, the higher the readout efficiency of a data segment, the higher its position in the readout performance, and therefore more data segments are collectively read out. On the other hand, the lower the readout efficiency of a data segment, the lower its position in the readout performance. However, to that extent, fewer data segments are collectively read out, or one data segment is read out. Thereby, an increase in the read cost can be suppressed.
Further, the above-described data relevance is data relevance between the data generated from an access history of the data. As a result, according to the content or nature of the data included in the data segment formed based on the access history of the data, an arrangement in the disk can be determined and an increase in the read cost can be suppressed.
The server 11 includes the control device 21, the memory device (hereinafter, referred to as a “memory”) 31, and a storage device (disk) 41. The control device 21 is a processor such as a central processing unit (CPU).
The storage device 41 may be a disk device such as a hard disk drive (HDD). Hereinafter, the storage device 41 is referred to as the disk 41.
The memory 31 is a memory device accessible at a higher speed than the disk 41. The memory 31 may be, for example, a RAM (Random Access Memory), a flash memory, and the like.
In addition to the above-described configuration, the server 11 has a ROM that stores a BIOS (Basic Input/Output System), a program memory, and the like. A program that is executed by the control device 21 may be obtained via the network 61, or may be obtained by mounting on the server 11 a computer-readable portable storage medium such as a portable memory and a CD-ROM. The program that is executed by the control device 21 also includes a program in which processing described in the present embodiment is performed.
In the present embodiment, when data in the memory 31 is written back to the disk 41, the control device 21 also considers characteristics that are due to content of the records or characteristics of record processes and determines a recording place in the disk 41. The characteristics due to content of the records are characteristics of the importance level of the records, the number of times access, etc. Further, the characteristics due to the content of the record processes are characteristics using the access history based on a rule of thumb that related records are accessed and processed at the same time. The characteristics due to the content of the records or the content of the record processes exert an influence on the readout efficiency of a reading unit (data segment). Details of the data segment will be described in
When the data segments are written back to the disk 41, the control device 21 collectively writes back a plurality of data segments. The control device 21 calculates a priority of each of the plurality of data segments written back collectively and allocates the data segments to the area having a higher performance in the order of the data segment having higher priority
The control device 21 extracts data characteristics (an index indicating an aptitude) whenever the data process (new preparation, reference, update (rearrangement using the data relocation technique etc.), and the like) is generated and stores characteristic information thereof in each piece of data.
When the plurality of data segments are written back to the disk, the control device 21 calculates the priority of each data segment based on the characteristic information stored at the time of the data process.
In the disk 41, the record is stored in units of the data segment. The data segment is a set of the record in which data relevance is recognized based on the record history specified by the request, and is a minimum unit of reading and writing with respect to the disk 41. The data segment content is updated by a process of the control device 21 as described below. Here, the request includes a Read request and a Write request.
In the present embodiment, for example, a data segment size is assumed to be a fixed size. Further, when the data segment is written back from the memory to the disk, a unit (the number of the data segments) in which the data segment is collectively written is adjusted.
The record is read out from the disk 41 in units of the data segment, and is stored in the memory 31. That is, all the records included in the data segment to which the record specified by the request belongs are read out from the disk 41, and are stored in the memory 31. Further, when a capacity of the memory 31 becomes deficient, the record stored in the memory 31 is written back to the disk 41 in units of the data segment.
The memory 31 has a record-data segment correspondence table 33, a relevance storage table 34, a data segment management table 35, an empty area management table 36, and the disk performance storage table 37. The record-data segment correspondence table 33 stores information representing a correspondence relationship between the key for specifying the record and the data segment to which the record belongs. The relevance storage table 34 is a table for managing related information in which the records specified by the previous request are sequentially related in each record specified by the request and are accumulated. The data segment management table 35 is a table for managing a physical position and characteristics (an index value) in each data segment in the disk 41. The empty area management table 36 is a table for managing empty areas in the disk 41. The disk performance storage table 37 is a table for managing a readout performance in each physical position in the disk 41.
The control device 21 executes programs according to the present embodiment, and thereby serves as the input-output management unit 22, an analysis necessity determination unit 23, a relevance analysis unit 24, a data segment arrangement unit 25, the write-back execution unit 26, the characteristic extraction unit 27, a priority calculation unit 28, and the recording place determining unit 29.
The input-output management unit 22 searches the memory 31 according to requests input from a request source such as the client 51, and if the record specified by the request is not present in the memory 31, further searches the disk 41, and transmits the record specified by the request to the request source. Not only the request is transmitted by the client 51 but also a main body of processes or the like performed in the server 11 may be an issue source of the requests. Further, when an input-output device is connected to the server 11, a user is assumed to input the request to the input-output device.
When a request is input, the input-output management unit 22 first searches the memory 31 for the record specified by the request. When the record specified by the request is present in the memory 31, the input-output management unit 22 reads out the record from the memory 31 and sends back the read-out record to the request source.
Further, when the record specified by the request is not present in the memory 31, the input-output management unit 22 searches the disk 41 for the record specified by the request. When the record specified by the request is present in the disk 41, the input-output management unit 22 reads out from the disk 41, using the record-data segment correspondence table 33, all of the records included in the data segment to which the record specified by the request belongs. Further, the input-output management unit 22 sends back the record specified by the request to the request source from among all the records included in the read-out data segment. At this time, the input-output management unit 22 stores in the memory 31 all the records included in the read-out data segment.
In the above, a case in which the input-output management unit 22 performs a process of storing all the records included in the data segment read out from the disk 41 in the memory 31 at a timing at which the request is received is described; however, it is not limited thereto. For example, the input-output management unit 22 may obtain an access frequency in a certain prescribed period and read out from the disk 41 preferentially the data segment in which the access frequency is high to store the data segment in the memory 31.
Using the relevance storage table 34, the analysis necessity determination unit 23 determines whether the data segments to which the record specified between the continuous requests belongs are the same, and thereby determines whether the relevance analysis unit 24 is caused to perform an analysis of the relevance.
According to determination results of the analysis necessity determination unit 23, the relevance analysis unit 24 analyzes from the relevance storage table 34 the data relevance between the record of the data segment to which the record specified by the current request belongs and the record of the data segment to which the record specified by the previous request belongs. Based on the analysis results, the relevance analysis unit 24 determines the data segment to which the record belongs.
According to the determination of the relevance analysis unit 24, the data segment arrangement unit 25 updates an arrangement of the data segments of the record-data segment correspondence table 33.
Based on an instruction from the input-output management unit 22, when the capacity of the cache area 32 is deficient, the write-back execution unit 26 performs the write-back processing. When the write-back processing is performed, the write-back execution unit 26 calls out the characteristic extraction unit 27, the priority calculation unit 28, and the recording place determining unit 29. After the processing of the characteristic extraction unit 27, the priority calculation unit 28, and the recording place determining unit 29, the write-back execution unit 26 writes back a write-back target data segment to an area in the disk allocated by the recording place determining unit 29 described later.
With reference to the record-data segment correspondence table 33 and the relevance storage table 34, the characteristic extraction unit 27 calculates an index value indicating a height of the reading efficiency as characteristics of the data segment, and stores the calculated index value in the data segment management table 35.
Based on the calculated index value, the priority calculation unit 28 determines a priority of a height of the reading efficiency in each data segment.
With reference to the empty area management table 36 and the disk performance storage table 37, the recording place determining unit 29 sequences an empty area in the order of disk performance according to a physical position of the disk of the empty area. The recording place determining unit 29 allocates all the data segments in which the priority is determined to empty areas in which the disk performance is higher in descending order of priority.
The record-data segment correspondence table 33 includes items of the “key” and the “data segment”. The “key” is information for specifying the record, and corresponds to a record name. The data segment represents a data segment to which the record specified by the key belongs.
The relevance storage table 34 includes items of the “key” and the “relevance”. The key represents information for specifying the record and corresponds to a record name.
“key” K2 of the record specified by the request before the “key” K1, indicating the record specified by the current request, and an intensity n of the relevance between K1 and K2 are sequentially accumulated and stored in the item of the “relevance”. In
For example, the record specified by the current request is assumed to be ‘A’, the record specified by the previous request is assumed to be ‘C’, and the intensity of the relevance between the records A and C is assumed to be 3. In this case, in the relevance storage table 34, {C:3} is stored in the item “relevance” corresponding to key=A.
In
Thus, in the disk performance storage table 37, entries of the “physical position range”, the “readout performance”, and the “reading method” are set so that as the readout performance in the physical position range becomes higher, the number of the data segments to be collectively read out is further increased.
Next, accumulation processing of relevance information managed by the relevance storage table 34 will be described. In the present embodiment, the relevance is present between the records continuously accessed by the same client 51, and as the number of times of continuous accesses becomes greater, the relevance is considered to become stronger.
Further, in the present embodiment, both the records are accessed continuously by the same client, or different clients. However, the above records are discriminated from the records in which an arrival order to the input-output management unit 22 is continuous by chance, and the latter case is assumed to have no relevance.
Further, in the present embodiment, even if a request is specified by the same client, the importance level may be different depending on the record. As the importance level specified by the request becomes larger, the relevance is considered to be stronger. For example, when data processing is performed in which access logs of the Web are accumulated and the Web site is followed so each user can analyze a carrier, each Web site page corresponds to the record and the importance level is high. On the other hand, advertisement data that is attached to the Web site is also included in the record, but displayed at random on the Web site (continuously accessed at random), and therefore the importance level is low.
A method for accumulating the relevance information will be described. A common session number is given to the request from the same client. Each of the requests includes a value indicating the importance level in each record. A record that is not related to other records at all is set to an importance level of zero. The importance level is specified by application programs or users that put in the request. The input-output management unit 22 checks the requests in the order of arrivals, and records the latter records continuously accessed with the common session number as the relevance information of the former records.
At the time of issuance from the client, the session number is given to the generated request in each client. In
In an example of
First, the request Rq1: Get (A, 10, X) is issued from the client X. At this time, ‘10’ is assumed to be set to the importance level. In
Next, the request Rq2: Get (B, 10, X) is issued by the client X. At this time, ‘10’ is assumed to be set to the importance level. A session of the request Rq2 is the same as that of the request Rq1, and the request Rq2 is continuously accessed. In this case, the input-output management unit 22 determines that the record ‘A’ specified by the request Rq1 is related to the record ‘B’ specified by the request Rq2. In this case, the input-output management unit 22 updates the relevance storage table 34 as illustrated in
Specifically, the key of the record specified by the current request Rq2 is ‘B’, and the key of the record specified by the previous request is ‘A’. Therefore, the input-output management unit 22 stores ‘A’ in the “relevance” corresponding to the key ‘B’ of the relevance storage table 34. Further, the input-output management unit 22 calculates the relevance between the record ‘B’ and ‘A’, and stores the calculated relevance in the relevance storage table 34. The relevance between the record ‘B’ and ‘A’ is calculated to be the number of times lithe importance level 10=10 in which B and A are continuously accessed (within the same session).
Next, the request Rq3: Get (C, 5, Y) is issued by the client Y. At this time, ‘5’ is assumed to be set to the importance level. The request Rq3 is accessed continuously after the request Rq2, but a session of the request Rq3 is different from that of the request Rq2. In this case, the input-output management unit 22 determines that the record ‘C’ specified by the request Rq3 is not related to the record ‘B’ specified by the request Rq2. In this case, the input-output management unit 22 does not update the relevance storage table 34 as illustrated in
Next, the request Rq4: Get (D, 5, Y) is issued by the client Y. At this time, ‘5’ is assumed to be set to the importance level. A session of the request Rq4 is the same as that of the request Rq3, and the request Rq4 is continuously accessed. In this case, the input-output management unit 22 determines that the record ‘D’ specified by the request Rq4 is related to the record ‘C’ specified by the request Rq3. In this case, the input-output management unit 22 updates the relevance storage table 34 as illustrated in
Specifically, the key of the record specified by the current request Rq4 is ‘D’, and the key of the record specified by the previous request is ‘C’. Therefore, the input-output management unit 22 stores ‘C’ in the “relevance” corresponding to the key ‘D’ of the relevance storage table 34. Further, the input-output management unit 22 calculates the relevance between the record ‘D’ and ‘C’, and stores the calculated relevance in the relevance storage table 34. The relevance between the record ‘D’ and ‘C’ is calculated to be the number of times 1×the importance level 5=5 in which D and C are continuously accessed (within the same session).
Next, the request Rq5: Get (E, 0, Y) is issued by the client Y. At this time, ‘0’ is assumed to be set to the importance level. A session of the request Rq5 is the same as that of the request Rq4, and the request Rq5 is continuously accessed. However, the importance level is 0, and therefore the input-output management unit 22 determines that the record ‘E’ specified by the request Rq5 is not related to any other record. In this case, the input-output management unit 22 does not update the relevance storage table 34 as illustrated in
First, the input-output management unit 22 reads out the record specified by the request from the memory 31 or the disk 41, and transmits the record to the request source (S1). At this time, when the record specified by the request is not present in the memory 31, the input-output management unit 22 reads out from the disk 41 all the records of the data segment to which the record specified by the request belongs using the record-data segment correspondence table 33. From among all the records of the read-out data segment, the input-output management unit 22 further transmits the record specified by the request to the request source. A process of S1 will be described in detail in
Next, the input-output management unit 22 refers to the record specified by the previous request included in the current request, and updates the relevance storage table 34 (S2). A process of S2 corresponds to the process illustrated in
When the relevance storage table 34 is updated, the analysis necessity determination unit 23 determines whether the relevance analysis according to the relevance analysis unit 24 is needed (S3). That is, based on the record-data segment correspondence table 33, the analysis necessity determination unit 23 determines whether the record (current record R1) specified by the current request and the record (previous record R2) specified by the previous request belong to different data segments. When the current record R1 and the previous record R2 belong to the same data segment, namely, when it is determined that the relevance analysis is not needed (“NO” at S3), the control device 21 finishes the process of this flowchart.
When the current record R1 and the record R2 of the previous time belong to the different data segments, namely, when it is determined that the relevance analysis is needed (“YES” at S3), the relevance analysis unit 24 analyzes the relevance of the record (S4). Further, the relevance analysis unit 24 analyzes the relevance between the data, for example, using a graph division method. Here, between all the records included in the data segment to which the current record R1 belongs and all the records included in the data segment to which the record R2 of the previous time belongs, the relevance analysis unit 24 demands a combination of two records, and calculates an intensity of the relevance between the two records. Here, the intensity of the relevance between the records is a value obtained by multiplying the number of times of the access illustrated in
Next, based on the analysis results of the relevance analysis unit 24, the data segment arrangement unit 25 determines whether a change in the correspondence between the record and the data segment is needed, namely, whether a reorganization of the data segments is needed (S5). When the data segment to which any of the records belong is not changed, namely, when it is determined that the change in the correspondence between the record and the data segment is not needed (“NO” at S5), the control device 21 finishes the process of this flowchart.
When the data segment to which the record belongs is changed, namely, when it is determined that the change in the correspondence between the record and the data segment is needed (“YES” at S5), the data segment arrangement unit 25 performs the next processing. That is, based on the results of the reorganization of the data segment at S5, the data segment arrangement unit 25 changes the correspondence between the record and the data segment (S6).
Based on the changed correspondence relationship between the record and the data segment, the data segment arrangement unit 25 updates the record-data segment correspondence table 33 (S7). As a result of the reorganization of the data segments at S5, for example, when the data segment to which the record belongs is changed, a data segment name corresponding to the “key” of the record is updated in the record-data segment correspondence table 33.
As illustrated in the record-data segment correspondence table 33, the current record H and the previous record G belong to different data segments, and therefore the analysis processing according to the relevance analysis unit 24 is performed.
A relationship between the records of the record-data segment correspondence table 33 is illustrated in
Thereby, the intensities of the relevances between respective records CFG=4, CFH=0, CF1=0, CGH=3, CGI=0, and CHI=1 in a combination of two records between two data segments are obtained as illustrated in
The relevance analysis unit 24 is assumed to set all data segment patterns in which the number of all the records which belong to two data segments is divided, for example, within a range in which a maximum number of the records (e.g., 3) within the data segment is satisfied. In an example of
Next, as illustrated in
Further, the relevance analysis unit 23 selects the data segment pattern in which a total of the intensities of the relevances of a combination of the records that belong to different data segments is minimized, and determines a new data segment (S17). In the case of
C
FI
+C
GI
+C
HI=1 (FGH) (I):
C
FG
+C
FH
+C
FI=4 (GHI) (F):
C
FG
+C
GH
+C
GI=7 (HIF) (G):
C
FH
+C
GH
+C
HI=3 (FGI) (H):
C
FH
+C
FI
+C
GH
+C
GI=3 (FG) (HI):
C
FG
+C
FI
+C
GH
+C
HI=8 (FH) (GI):
C
FG
+C
FH
+C
GI
+C
HI=5
Thus, in all the data segment patterns, the total of the intensities of the relevances between the records of the data segment pattern of the data segments (FGH) and the data segment (I) is 1, and is minimized. Accordingly, the relevance analysis unit 24 determines that the above data segment pattern of (FGH) and (I) is a new data segment.
As illustrated in
In addition, in
When it is determined that the total size is larger than the prescribed threshold (“YES” at S11), the input-output management unit 22 instructs the write-back execution unit 26 to write back the data segments in the cache area 32 to the disk 41.
From the data segments in the cache area 32, the write-back execution unit 26 selects a plurality of data segments so that the prescribed number of the data segments is selected or a size of the total is the prescribed size (S12).
A method for selecting a data segment includes a random selection method, an LRU algorithm, and an LFU algorithm. The random selection method is, for example, a method for selecting one or more data segments at random from a plurality of data segments in the cache area 32. The LRU algorithm is an algorithm for cuing the data segments in the order of the access and selecting a data segment from the data segments that have not been accessed for the longest time. The LFU algorithm is an algorithm for cuing the data segments in the order of the access frequency and selecting a data segment from the data segments in which the access frequency is lowest.
The total size or the number of the data segments to be selected depends on how wide a recording place is desired to be adjusted between the data segments. For example, the number of the data segments to be selected is considered to be set to five times the number of areas in the disk 41.
When an instruction is received from the write-back execution unit 26, the characteristic extraction unit 27 calculates the index value in each data segment as described later with respect to all the selected data segments, and stores the calculated index values in the data segment management table (S13). That is, using the record-data segment correspondence table 33 and the relevance storage table 34, the characteristic extraction unit 27 totalizes the intensities (=the number of times of the access×the importance level) of the relevances of all the records included in the data segments in units of the selected data segment.
In the case of the record-data segment correspondence table 33 of
The index value in each data segment may be updated whenever the data segment is changed. Further, the index values may be collectively calculated in the write-back processing.
The priority calculation unit 28 determines respective priorities of the selected data segments according to a size of the index value of the data segment calculated at S13 (S14). That is, the priority calculation unit 28 sets the data segment to have a higher priority as the index value of the data segment becomes larger.
The recording place determining unit 29 confirms the empty area in the disk 41 (S15). That is, the recording place determining unit 29 specifies a physical position of the empty area in the disk 41 from the empty area management table 36.
From the disk performance storage table 37, the recording place determining unit 29 obtains the readout performance of the physical position range corresponding to the specified empty area. The recording place determining unit 29 sequences the empty areas in the order of the higher readout performance in the physical position range.
The recording place determining unit 29 determines that the data segment to which the priority is given is allocated, in the order of higher priority, to the empty area in which the readout performance is higher (S16). When the plurality of data segments are allocated to the same physical position range, the recording place determining unit 29 allocates the data segment having higher priority, for example, to the area in which a physical position number is smaller.
Based on the determined allocation content, the recording place determining unit 29 updates the relevance storage table 34, the data segment management table 35, and the empty area management table 36 (S17). Specifically, the recording place determining unit 29 deletes an entry of the data segment selected at S12 from the relevance storage table 34. Further, the recording place determining unit 29 adds to the data segment management table 35 the entry corresponding to the area to which the data segment is allocated. Further, from the empty area management table 36, the recording place determining unit 29 deletes the entry corresponding to the area to which the data segment is allocated.
The write-back execution unit 26 writes back the data segment to the recording place determined in the order of the priority at S16 (S18).
The input-output management unit 22 receives the request from the client 51 and obtains the key of the record specified by the request (S21). Based on the obtained key, the input-output management unit 22 determines whether the record specified by the request is present in the cache area 32 (S22). When the specified record is present in the cache area 32 (YES at S22), the input-output management unit 22 sends back the record read out from the cache area 32 to the request source (S29).
When the specified record is not present in the cache area (NO at S22), the input-output management unit 22 specifies from the record-data segment correspondence table 33 the data segment to which the specified record belongs (S23).
From the data segment management table 35, the input-output management unit 22 specifies the physical position of the specified data segment (S24). Using the disk performance storage table 37, the input-output management unit 22 specifies the reading method of the data segment from the specified physical position (S25).
Using the specified reading method, the input-output management unit 22 reads out the specified data segment from the specified physical position of the disk 41 (S26). For example, when the reading method specified from the disk performance storage table 37 is “collective reading of ten data segments”, the input-output management unit 22 collectively reads out the ten data segments at the periphery or arranged continuously, including the specified data segments from the physical position of the specified data segment.
Only whether the collective reading is performed in each area is previously determined of the reading method. When the physical position of the data segment is actually specified, whether the collective reading is performed from the physical position may be determined.
Further, a unit of the collective reading may be determined according to a size (the number of the requests received per unit time by the input-output management unit 22) of the load. For example, the unit of the collective reading may be adjusted so that the unit of the collective reading is made to be large at the time of a large load and the unit of the collective reading is made to be small at the time of a small load.
The input-output management unit 22 stores the read-out data segment in the cache area 32 and sends back the specified record included in the data segment to the request source (S27). The input-output management unit 22 adds to the relevance storage table 34 the entry corresponding to the read-out data segment (S28).
In the data segments arranged on the outer peripheral side, the plurality of data segments are assumed to be collectively read. In the data segments arranged on the inner peripheral side, the plurality of data segments are assumed to not be collectively read.
In
Further, in the data segments arranged on the inner peripheral side, one data segment is read out by the readout processing of one time, and is held in the cache. At this time, when a record P is accessed, records Q and R also are held in the cache all together. The records P, Q, and R are not related to each other, and therefore a ratio by which the records Q and R are also accessed while being held in the cache is low. That is, the records Q and R are read out uselessly. However, only the records Q and R are read out uselessly, and therefore the number of the records that are read out uselessly can be suppressed.
According to the present embodiment, according to the relevance between the records included in the data segment generated based on the access history of the data, an arrangement of the data segments in the disk can be determined and written back to the disk. As a result, the data segment in which the reading efficiency is high is recorded in the area in which the sequential read performance is high, and the data segment in which the reading efficiency is low is recorded in the area in which the sequential read performance is low. Therefore, an increase in the read cost can be suppressed.
Further, when the data segment is read out from the disk, the number of the data segments to be read out can be controlled according to the sequential read performance of the reading position in the memory area of the disk. That is, as the sequential read performance of the reading position becomes higher, the number of the data segments to be readout is further increased. On the other hand, as the sequential read performance of the reading position becomes lower, the number of the data segments to be read out is further reduced. As a result, an increase in the read cost can be suppressed.
According to one aspect of the present embodiment, the reading efficiency of the data from the memory device in which the readout performance differs according to positions in the memory area can be improved.
The present invention is not limited to the above-described embodiments, and various configurations or embodiments can be implemented without departing from the gist of the present invention.
All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2015-001068 | Jan 2015 | JP | national |