Cache server and content distribution system
The cache server system addresses the wear issue in nonvolatile memory by using a processor to manage content recovery based on delivery capability and write cost, enhancing memory lifespan and distribution efficiency.
Patent Information
- Application Number
- JP2024032234
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-03-04
- Publication Date
- 2025-09-17
AI Technical Summary
Cache servers using nonvolatile memory face challenges in managing the finite number of program/erase cycles, leading to wear and the need for technology to reduce consumption of this memory to extend its lifespan.
A cache server system that includes a processor to manage nonvolatile memory by determining the recovery of content based on delivery capability and the cost of writing data, employing error correction and selective recovery methods to minimize wear on the memory.
The system effectively reduces wear on nonvolatile memory by selectively recovering content, optimizing delivery capability while minimizing unnecessary writes, thereby extending the memory's lifespan and maintaining efficient content distribution.
Smart Images

Figure 2025134368000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a cache server and a content distribution system. [Background technology]
[0002] A content delivery network (CDN) is known as an information distribution system that has become widespread in recent years.
[0003] In information distribution systems such as CDNs, multiple cache servers are used to prevent access concentration on an origin server and to improve content distribution speed.
[0004] Each of the multiple cache servers acquires content requested by a client from an origin server, distributes the acquired content to the client, and stores the content in a storage device included in the cache server. After that, when the content is requested by another client, the cache server reads the content from the storage device and distributes the read content to the other client.
[0005] Recently, solid state drives (SSDs), which include nonvolatile memory such as NAND flash memory and a controller that controls the nonvolatile memory, have begun to be used as storage devices for cache servers.
[0006] When a cache server including an SSD is unable to successfully read content requested by a client that was previously stored in the SSD's nonvolatile memory from the SSD's nonvolatile memory, it may determine that this content was not originally present in the SSD, rather than that a read error has occurred. In this case, the cache server retrieves the content for which the read error occurred from the origin server, delivers the retrieved content to the client, and writes the retrieved content to the SSD's nonvolatile memory to restore the content for which the read error occurred.
[0007] However, due to its characteristics, nonvolatile memory wears out as the program / erase cycle progresses, so there is an upper limit to the number of program / erase cycles (number of times it can be rewritten) that nonvolatile memory can undergo, and it is necessary to control writing to nonvolatile memory so that this upper limit is not exceeded.
[0008] For this reason, in cache servers that use nonvolatile memory as a cache, there is a need for technology that can suppress consumption of the nonvolatile memory. [Prior art documents] [Patent documents]
[0009] [Patent Document 1] U.S. Patent No. 9,558,065 Summary of the Invention [Problem to be solved by the invention]
[0010] An object of the present invention is to provide a cache server and a content distribution system that can reduce consumption of nonvolatile memory. [Means for solving the problem]
[0011] According to an embodiment, a cache server connectable to an origin server that stores content via a network includes a storage device and a processor. The storage device includes a nonvolatile memory and a controller. The nonvolatile memory has a finite data retention period and a finite number of writes. The controller controls the nonvolatile memory. The processor uses the storage device as a cache for content stored in the origin server and delivers content obtained from the origin server to clients that request the content. When an error occurs when reading content from the storage device, the processor determines whether to restore the content based on the amount of recovery of the cache server's delivery capability due to content recovery and the cost of writing data to the storage device associated with content recovery. If it is determined that the content should be restored, the processor selects a content recovery method based on a first remaining retention period for which the content should be retained and a second remaining retention period until the content is deleted from the storage device. [Brief explanation of the drawings]
[0012] [Figure 1] FIG. 1 is a diagram showing an example of the configuration of an information distribution system including a cache server according to an embodiment. [Figure 2] FIG. 2 is a block diagram showing an example of the functional configuration of a processor of a cache server according to the embodiment. [Figure 3] FIG. 2 is a block diagram showing an example of the configuration of a storage device (SSD) of a cache server according to the embodiment. [Figure 4] FIG. 1 is a block diagram showing an example of the configuration of a NAND flash die, which is an example of a nonvolatile memory die according to an embodiment. [Figure 5] FIG. 10 is a diagram illustrating an example of error correction performed in a cache server according to the embodiment. [Figure 6] 10 is a flowchart showing the procedure of a content distribution process executed in a cache server according to the embodiment. [Figure 7]FIG. 2 is a diagram for explaining an error detection process executed in an information distribution system including a cache server according to an embodiment. [Figure 8] FIG. 2 is a diagram for explaining a content recovery process executed in an information distribution system including a cache server according to an embodiment. [Figure 9] FIG. 10 is a diagram for explaining an error notification process executed in an information distribution system including a cache server according to an embodiment. [Figure 10] 10A and 10B are diagrams for explaining a restoration instruction transmission process executed in an information distribution system including a cache server according to an embodiment. [Figure 11] FIG. 2 is a diagram showing a first example of the delivery capability of a cache server according to the embodiment. [Figure 12] FIG. 10 is a diagram showing a second example of the delivery capability of a cache server according to the embodiment. [Figure 13] 10 is a flowchart showing an example of an operation procedure when a cache server according to the embodiment causes a content read error. [Figure 14] 10A and 10B are diagrams for explaining a method for selecting a block to which a recovery target portion of content is written in a cache server according to an embodiment. [Figure 15] 10 is a diagram for explaining a method for writing a restoration target portion of content to a storage device in a cache server according to an embodiment. FIG. [Figure 16] 10 is a diagram showing an example in which content data is stored separately in normal blocks and recovery blocks in a cache server according to an embodiment. FIG. [Figure 17] FIG. 10 is a diagram showing an example of a recovery data management table included in the cache server according to the embodiment. [Figure 18] FIG. 10 is a diagram showing an example of a recovery block management table included in the cache server according to the embodiment. [Figure 19] 10 is a flowchart showing an example of an operation procedure when a control server of an information distribution system including a cache server according to an embodiment receives a notification that a content read error has occurred. [Figure 20] 10 is a flowchart showing an example of an operation procedure when a cache server according to an embodiment receives a content recovery instruction from a control server. [Figure 21] 10 is a flowchart showing an example of an operation procedure in which a control server of an information distribution system including a cache server according to an embodiment instructs a cache server to restore content based on a content restoration unexecuted list. [Figure 22] A flowchart showing an example of an operational procedure for instructing a cache server to restore content based on a content restoration unperformed list when a control server of an information distribution system including a cache server according to an embodiment receives notification that a content read error has occurred. DETAILED DESCRIPTION OF THE INVENTION
[0013] Hereinafter, embodiments will be described with reference to the drawings. FIG. 1 is a diagram showing an example of the configuration of an information distribution system including a cache server according to an embodiment. The information distribution system is a system for distributing content to various client terminals (clients 4-1 to 4-4 in FIG. 1) via a network 5 such as the Internet, and is realized, for example, as a CDN. The information distribution system includes an origin server 1, one or more cache servers 2 (three cache servers 2-1 to 2-3 in FIG. 1), and a control server 3. The network 5 is composed of, for example, networks 5-1, 5-2, and 5-3. The origin server 1, cache servers 2-1 to 2-3, control server 3, and clients 4-1 to 4-4 are connected via the network 5.
[0014] The origin server 1 is a server that holds multiple pieces of content. The origin server 1 is also called a distribution server. The content may be, for example, video, images, or any other type of data.
[0015] Each of the cache servers 2-1 to 2-3 is a server that temporarily caches content. Each of the cache servers 2-1 to 2-3 caches content distributed by the origin server 1. Then, in response to a request received from a client 4-1 to 4-4, the cache servers 2-1 to 2-3 distribute the cached content to the client 4-1 to 4-4 instead of the origin server 1. Specifically, each of the cache servers 2-1 to 2-3 determines whether or not it has cached first content requested by the client 4-1 to 4-4. If it has cached the first content, it reads the first content and distributes the read first content to the client 4-1 to 4-4. If the requested first content is not cached, the cache servers 2-1 to 2-3 obtain the first content from the origin server 1, distribute the obtained first content to the client, and cache the obtained first content.
[0016] The control server 3 is a server that controls the cache servers included in the information distribution system. In this embodiment, since the information distribution system includes cache servers 2-1 to 2-3, the control server 3 controls these cache servers 2-1 to 2-3. The control server 3 may function as, for example, a DNS server. The control server 3 functioning as a DNS server converts a URL received from one of the clients 4-1 to 4-4 into an address (IP address) corresponding to the cache server to be accessed among the cache servers 2-1 to 2-3, and returns the address (IP address) to the client. Alternatively, any server outside the control server 3 may function as a DNS server. Furthermore, the control server 3 may function as a load balancer for selecting a cache server that executes a content distribution service from the cache servers 2-1 to 2-3.
[0017] Clients 4-1 to 4-4 are client terminals that use content. The clients are, for example, a car (or an in-car device), a computer, a game console, or a smartphone (or a mobile phone). Each of clients 4-1 to 4-4 transmits a request specifying a certain content to one of cache servers 2-1 to 2-3 via network 5-1. Specifically, each of clients 4-1 to 4-4 transmits a request to a cache server specified by an address obtained from a DNS server.
[0018] Next, an example of the configuration of the cache server will be described. Here, an example of the configuration of the cache server 2-1 will be described, but the other cache servers 2-2 and 2-3 also have the same configuration as the cache server 2-1.
[0019] The cache server 2-1 includes a network interface controller (NIC) 21, a processor 22, a main memory 23, and a plurality of solid state drives (SSDs) 24-1 to 24-4. The NIC 21, the processor 22, the main memory 23, and the SSDs 24-1 to 24-4 are connected to one another via a bus 20.
[0020] The NIC 21 is an interface circuit that communicates with external clients (clients 4-1 to 4-4) and external servers (for example, the control server 3, the origin server 1, and other cache servers 2-2 to 2-3) via the network 5.
[0021] The processor 22 is a central processing unit (CPU). The processor 22 controls the overall operation of the cache server 2-1 by controlling each component of the cache server 2-1. The processor 22 executes software (host software) loaded into the main memory 23 from the SSDs 24-1 to 24-4 or other storage devices connected to the cache server 2-1. The host software includes, for example, an operating system, a file system, and an application program.
[0022] The main memory 23 is a volatile memory. The main memory 23 is, for example, a dynamic random access memory (DRAM). A part of the storage area of the main memory 23 is used as a data buffer. The data buffer temporarily stores content to be written to the SSDs 24-1 to 24-4 or content read from the SSDs 24-1 to 24-4. Another storage area of the main memory 23 is used, for example, to store a content management table 231. The content management table 231 is a table for managing each piece of content cached in the cache server 2-1. The content management table 231 holds management information corresponding to each piece of content stored in each of the multiple SSDs 24-1 to 24-4 in the cache server 2-1. The management information corresponding to a certain piece of content includes, for example, information for identifying the content, the size of the content, address information indicating the storage area where the content is stored, the predicted number of times the content is read, the requested data retention period for the content, and the requested remaining data retention period for the content.
[0023] The SSDs 24-1 to 24-4 are storage devices. The nonvolatile memory of each of the SSDs 24-1 to 24-4 is used as a cache for storing one or more contents. Note that, although FIG. 2 shows an example in which each cache server 2 includes multiple SSDs as storage devices, each cache server 2 may include only one SSD 24 as a storage device.
[0024] Next, an example of the configuration of a storage device will be described. Here, an example of the configuration of the SSD 24-1 will be described, but the other SSDs 24-2 to 24-4 also have the same configuration as the SSD 24-1.
[0025] The SSD 24-1 includes a controller 241 and a nonvolatile memory 242. The controller 241 is a control circuit that controls the nonvolatile memory 242. The controller 241 writes data to the nonvolatile memory 242 or reads data from the nonvolatile memory 242 based on a command received from the processor 22, for example.
[0026] An example of the nonvolatile memory 242 is, for example, a NAND flash memory. The nonvolatile memory 242 may be a two-dimensional flash memory or a three-dimensional flash memory. The nonvolatile memory 242 has a finite data retention period and a finite number of rewrites. Here, the finite data retention period of the nonvolatile memory 242 and the finite number of rewrites of the nonvolatile memory 242 will be described.
[0027] The data retention period of the nonvolatile memory 242 is the period during which data written to the nonvolatile memory 242 can be retained in the nonvolatile memory 242. The data retention period of the nonvolatile memory 242 is also referred to as the data retention period. The data retention period of the nonvolatile memory 242 is determined based on the degree of wear of the nonvolatile memory 242, etc. As the degree of wear of the nonvolatile memory 242 increases, the data retention period of the nonvolatile memory 242 tends to shorten.
[0028] The number of times the nonvolatile memory 242 can be rewritten is the number of program / erase (P / E) cycles in the nonvolatile memory 242. Because the nonvolatile memory 242 wears out as the P / E cycles progress due to its characteristics, there is an upper limit to the number of times the nonvolatile memory 242 can be rewritten (the number of P / E cycles). Specifically, in the nonvolatile memory 242, a data erase operation is performed in units of blocks included in the nonvolatile memory 242, and a data write operation is performed in units of pages included in each block. Because each block wears out due to rewriting (data erase operation, data write operation, etc.) due to its characteristics, there is an upper limit to the number of times each block can be rewritten. The number of times each block can be rewritten is also referred to as the number of P / E cycles of the block.
[0029] The controller 241 includes an error correction circuit 2413. The error correction circuit 2413 adds an error correction code (ECC) to content to be written to the nonvolatile memory 242. The error correction circuit 2413 also performs error correction processing to detect and correct errors contained in the content read from the nonvolatile memory 242 by using the ECC added to the content. Content for which error correction processing has been successfully performed is transmitted to the processor 22 by the controller 241. If error correction processing has not been successfully performed, that is, if the read content contains error bits exceeding the number of correctable error bits, the error correction circuit 2413 notifies the processor 22 that an error (read error) has occurred in reading the content.
[0030] Next, a description will be given of an example of the functional configuration of the processor 22. Fig. 2 is a block diagram showing an example of the functional configuration of the processor 22 according to the embodiment.
[0031] The processor 22 includes a content acquisition unit 2201, a content writing unit 2202, a content reading unit 2203, a content distribution unit 2204, a read error detection unit 2205, a content recovery unit 2206, an error correction processing unit 2207, a delivery capability calculation unit 2208, a recovery judgment unit 2209, a delivery capability transmission / reception unit 2210, a recovery instruction receiving unit 2211, an error notification unit 2212, and a recovery method selection unit 2213. Some or all of the content acquisition unit 2201, content writing unit 2202, content reading unit 2203, content distribution unit 2204, read error detection unit 2205, content recovery unit 2206, error correction processing unit 2207, delivery capability calculation unit 2208, recovery judgment unit 2209, delivery capability transmission / reception unit 2210, recovery instruction receiving unit 2211, error notification unit 2212, and recovery method selection unit 2213 may be realized by dedicated hardware within cache server 2-1.
[0032] The content acquisition unit 2201 executes a process of acquiring content from another server. The other servers include, for example, the origin server 1, and the cache server 2-2 other than the cache server 2-1, and the cache server 2-3. When a first content is requested by one of the clients 4-1 to 4-4 and the first content is not stored in the SSDs 24-1 to 24-4, the content acquisition unit 2201 executes a process of acquiring the first content from the origin server 1. Furthermore, when an error (read error) occurs in reading the first content from the nonvolatile memory 242, the content acquisition unit 2201 executes a process of acquiring the first content from another server (the origin server 1 or another cache server).
[0033] The content writing unit 2202 executes a write process to write content to SSDs 24-1 to 24-4. In the write process, the content writing unit 2202 transmits a write command for writing the content to one of the SSDs 24-1 to 24-4. For example, when the cache server 2-1 acquires new content, the content writing unit 2202 identifies one of the SSDs 24-1 to 24-4 to which the content should be written, and issues a write command for writing the content to the identified SSD.
[0034] The content reading unit 2203 executes a read process to read the content to be read from one of the SSDs 24-1 to 24-4. The content reading unit 2203 identifies one of the SSDs 24-1 to 24-4 that stores the content to be read, and transmits a read command for reading the content to be read to the identified SSD. For example, when a first content is requested by one of the clients 4-1 to 4-4 and the first content is stored in SSD 24-1, the content reading unit 2203 executes a process to read the first content from SSD 24-1. At this time, the content reading unit 2203 transmits a read command specifying the first content to SSD 24-1.
[0035] The content distribution unit 2204 executes a distribution process for distributing content. For example, the content distribution unit 2204 distributes content requested by one of the clients 4-1 to 4-4 to this client via the network 5-1.
[0036] The read error detection unit 2205 receives a notification indicating a read error from any of the SSDs 24-1 to 24-4 that issued the read command, and thereby detects that an error (read error) has occurred in reading the content from the nonvolatile memory 242 of this SSD.
[0037] The content recovery unit 2206 executes recovery processing to recover content for which a read error has occurred. The content recovery unit 2206 causes the content acquisition unit 2201 to execute processing to acquire content from the origin server 1. The recovery processing executed by the content recovery unit 2206 includes options: a first recovery method in which the portion of the content to be restored, newly acquired by the content acquisition unit 2201, is written to the SSD 24; and a second recovery method in which the portion to be restored is not written to the SSD 24 but is instead stored in the main memory 23 in order to reduce wear on the nonvolatile memory 242. With regard to content recovery using the first recovery method, the cache server 2 of this embodiment has a unique mechanism for writing the portion to be restored to the SSD 24 and for managing the portion to be restored. This will be described later.
[0038] The error correction processor 2207 executes error correction processing. The error correction processing executed by the error correction processor 2207 has a higher error correction capability than at least the error correction executed by the error correction circuit 2413 in each of the controllers 241 of the SSDs 24-1 to 24-4. For example, the error correction processor 2207 recovers content in which a read error has occurred by executing an error correction process that is different from the error correction process executed by each of the controllers 241 of the SSDs 24-1 to 24-4, using data read from the SSDs 24-1 to 24-4. Details of the error correction processing executed by the error correction processor 2207 will be described later with reference to FIG. 5.
[0039] The delivery capability calculation unit 2208 calculates the delivery capability of the cache server 2-1. The delivery capability of the cache server 2-1 is the capability of the cache server 2-1 to deliver the deliverable content stored in the nonvolatile memory 242 of each of the SSDs 24-1 to 24-4. In other words, the delivery capability of the cache server 2-1 is a value indicating the capability of the cache server 2-1 to directly deliver content to any client 4 using the deliverable content stored in the nonvolatile memory 242. If a read error occurs for a certain content, the content will not be deliverable content until it is recovered. For this reason, when calculating the delivery capability of the cache server 2-1 immediately after a read error occurs for a certain content, the content for which the read error occurred is excluded. The delivery capacity of the cache server 2-1 indicates, for example, (A) the total number of contents that the cache server 2-1 is expected to deliver to any client 4 per unit time using the distributable contents stored in the nonvolatile memory 242, (B) the total data size of the contents that the cache server 2-1 is expected to deliver per unit time using the distributable contents stored in the nonvolatile memory 242, or (C) the total number of contents that the cache server 2-1 is expected to deliver to any client 4 using the distributable contents stored in the nonvolatile memory 242 until the data retention request period of each distributable content expires. The delivery capacity of the cache server 2-1 is calculated, for example, when any of the following events (1) to (3) occurs:
[0040] (1) When cache server 2-1 obtains new content from origin server 1 (2) When the cache server 2-1 detects an error (read error) when reading content from the nonvolatile memory 242 (3) When the cache server 2-1 recovers the content in which the read error occurred and writes the recovered content to the nonvolatile memory 242 The delivery capability calculation unit 2208 calculates the delivery capability of the cache server 2-1 based at least on the predicted read count for each of the deliverable contents stored in the non-volatile memory 242. The predicted read count differs for each of the deliverable contents. For example, the predicted read count (predicted number of requests) for highly popular content may be set to a relatively large value, and the predicted read count (predicted number of requests) for unpopular content may be set to a relatively low value. The predicted read count for each content may be the predicted read count per unit time (e.g., the predicted read count per second), or the total predicted read count for the data retention request period (or remaining data retention request period) of each content.
[0041] The predicted number of reads per unit time of a certain content may be a value designated by the origin server 1 or the distributor of this content.
[0042] Alternatively, the processor 22 of the cache server 2-1 may measure the number of requests for each content. In this case, the predicted number of reads per unit time for a certain content may be the most recent number of requests per unit time for this content.
[0043] The delivery capability calculation unit 2208 may, for example, calculate the sum of the predicted read counts of each of the distributable contents stored in the nonvolatile memory 242 as the delivery capability of the cache server 2-1. In this case, the predicted read count of each of the distributable contents may be the predicted read count per unit time, or may be the total predicted read count during the data retention request period (or the remaining data retention request period). In the case where the delivery capability calculation unit 2208 calculates the delivery capability of the cache server 2-1 using the predicted read count per unit time, the calculated delivery capability of the cache server 2-1 indicates the above-mentioned (A), that is, the total number of contents that the cache server 2-1 is expected to deliver to any client 4 per unit time using the distributable contents stored in the nonvolatile memory 242.
[0044] Furthermore, the delivery capability calculation unit 2208 may calculate, as the delivery capability of the cache server 2-1, the sum of the products of the predicted read counts of each piece of distributable content stored in the nonvolatile memory 242 and the data size of each piece of distributable content. In this case, the predicted read count of each piece of distributable content may be the predicted read count per unit time, or may be the total predicted read count for the data retention request period (or the remaining data retention request period). In a case where the delivery capability calculation unit 2208 calculates the delivery capability of the cache server 2-1 using the predicted read count per unit time, the calculated delivery capability of the cache server 2-1 indicates the above-mentioned (B), that is, the total data size of the content that the cache server 2-1 is expected to deliver per unit time using the distributable content stored in the nonvolatile memory 242.
[0045] Alternatively, the delivery capability calculation unit 2208 may calculate, as the delivery capability of the cache server 2-1, the sum of the products of the predicted read counts of each piece of distributable content stored in the nonvolatile memory 242 and the remaining data retention request periods corresponding to each piece of distributable content. In this case, the predicted read counts of each piece of distributable content are the predicted read counts per unit time. The delivery capability of the cache server 2-1 calculated by the delivery capability calculation unit 2208 indicates the total number of pieces of content that the cache server 2-1 is expected to deliver to any client 4 using the distributable content stored in the nonvolatile memory 242 until the data retention request periods for each piece of distributable content expire, as described above (C).
[0046] The recovery determination unit 2209 determines whether or not to recover the content in which a read error occurred. The recovery determination unit 2209 calculates the recovery amount of the delivery capability of the cache server 2 when the content is recovered and the writing cost to the SSD 24 associated with the recovery of the content. If the calculated recovery amount of the delivery capability is greater than the calculated writing cost, the recovery determination unit 2209 determines to recover the content.
[0047] More specifically, the restoration determination unit 2209 compares the calculated restoration amount of the delivery capability (recovery amount converted value) with a value (cost converted value) obtained by multiplying the calculated writing cost by a predetermined value. If the comparison of the restoration amount and the cost converted value shows that the calculated restoration amount of the delivery capability is greater, the restoration determination unit 2209 determines to restore the content.
[0048] The recovery amount of delivery capability is calculated, for example, by multiplying the number of recent requests for the content by the percentage of the content capacity in the capacity of the SSD 24 of the cache server 2. The write cost is calculated, for example, by multiplying the ratio of the size of the portion to be restored to the write size or erase size of the SSD 24 by the remaining number of writable times of the SSD 24 and the WAF (Write Amplification Factor) of the SSD 24 related to writing to the portion to be restored. The write size or erase size of the SSD 24 is, for example, the larger of the two sizes. The remaining number of writable times of the SSD 24 is calculated, for example, as the ratio of the number of writes to the SSD 24 to the total number of writable times of the SSD 24.
[0049] For example, if the number of recent requests for content is "1000 times / second" and the ratio of content capacity to the SSD 24 of cache server 2 is "1MB / 100GB=0.00001", the recovery amount of delivery capability is calculated to be 0.01. Also, if the ratio of the size of the portion to be restored to the write size or erase size of the SSD 24 is "0.1MB / 10MB=0.01", the ratio of the number of writes to the SSD 24 to the total number of writes possible to the SSD 24 is "50 / 100=0.5", and the WAF of the SSD 24 is "3", the write cost is calculated to be 0.015. If the predetermined value for adjusting whether to prioritize wear on the semiconductor storage device or recovery of delivery capability is "0.5," multiplying the calculated write cost (0.015) by the predetermined value (0.5) yields 0.0075. Since the calculated delivery capability recovery amount (0.01) is greater, it is determined to recover the content in this example. The predetermined value is set based on characteristics of the semiconductor storage device, such as the number of program / erase cycles (rewrite count) and the allowable number of errors, the available delivery capacity of the information delivery system, and the server usage pattern. Note that when units are different, such as for write cost and recovery amount, the predetermined value may be used to convert them into units that allow comparison between the two. For example, if the unit of delivery capability recovery amount is "times / second" and no unit exists for write cost, the unit of the predetermined value should be "seconds / time." This conversion enables comparison of the delivery capability recovery amount and write cost.
[0050] As described above, in the cache server 2 of the embodiment, when a content read error occurs, content recovery is not performed uniformly, but is performed only when the benefit of recovering the content (recovery amount of delivery capability) exceeds the disadvantage (write cost). In other words, the cache server 2 of the embodiment does not recover the content when the disadvantages exceed the advantages.
[0051] This allows the cache server 2 of the embodiment to reduce wear on the nonvolatile memory 242 of the SSD 24.
[0052] If it is determined that the content should not be restored, distribution of the content to the client 4 that requested it is taken over by another cache server 2 under the control of the control server 3.
[0053] The aforementioned number of recent requests for the content, which is used to calculate the recovery amount of the delivery capability, may be replaced with the time elapsed since the content was stored in the cache server 2. Furthermore, the aforementioned ratio of the content capacity to the capacity of the SSD 24 of the cache server 2 may be replaced with the ratio of the size of the portion to be restored to the size of the content.
[0054] The remaining number of writable times of the SSD 24 may be calculated as the ratio of the amount of data already written to the SSD 24 to the total amount of writable data of the SSD 24. Alternatively, it may be calculated as the ratio of the current Bit Error Rate (BER) of the SSD 24 to the allowable BER of the SSD 24.
[0055] Furthermore, the recovery determination unit 2209 may determine whether or not to recover the content in which a read error occurred, based on the delivery capability calculated by the delivery capability calculation unit 2208. In this case, the above-described procedure of comparing the recovery amount of the delivery capability of the cache server 2 with the writing cost to the SSD 24 can be applied to determining whether or not to write the recovered data of the content to the SSD 24 when it is determined that the content should be recovered.
[0056] The delivery capability transmission / reception unit 2210 transmits the calculated delivery capability of the cache server 2-1 to each of the other cache servers 2-2 and 2-3 directly or via the control server 3, and receives the delivery capabilities of each of the other cache servers 2-2 and 2-3 from each of the other cache servers 2-2 and 2-3 directly or via the control server 3. The configuration in which the cache servers 2-1, 2-2, and 2-3 directly exchange their delivery capabilities enables the cache servers 2-1, 2-2, and 2-3 to share their delivery capabilities with each other, even in an information delivery system that does not include a control server 3. Of course, in an information delivery system that includes a control server 3, the delivery capability transmission / reception unit 2210 may notify only the control server 3 of the delivery capability of the cache server 2-1, and the control server 3 may notify each of the other cache servers 2-2 and 2-3 of the delivery capability of the cache server 2-1. In an information distribution system in which the control server 3 exists, the distribution capability transmitting / receiving unit 2210 may receive from the control server 3 the distribution capabilities of each of the other cache servers 2-2 and 2-3.
[0057] It is also possible to use a configuration in which the control server 3 calculates the overall delivery capacity of multiple cache servers 2, including cache servers 2-1, 2-2, and 2-3, and notifies each of the cache servers 2-1, 2-2, and 2-3 of the calculated overall delivery capacity of the multiple cache servers 2.
[0058] The recovery instruction receiving unit 2211 receives a recovery instruction from the control server 3. The recovery instruction includes information instructing the recovery of specific content. The specific content specified by the recovery instruction is the content to be recovered. The content to be recovered is, for example, content in which a read error has occurred. The content in which a read error has occurred is notified to the control server 3 by the error notifying unit 2212, which will be described later. Furthermore, the content to be recovered may be content other than the content in which a read error has occurred.
[0059] The error notification unit 2212 notifies the control server 3 that a content read error has occurred and information identifying the content in which the read error has occurred. Furthermore, in addition to notifying the control server 3 that a content read error has occurred and information identifying the content in which the read error has occurred, the error notification unit 2212 may also notify the control server 3 of either or both of information indicating details of the read error that has occurred and information indicating the degree of wear of the nonvolatile memory 242.
[0060] The recovery method selection unit 2213 selects a method of recovery processing to be executed by the content recovery unit 2206. As described above, the recovery processing executed by the content recovery unit 2206 includes, as options, a first recovery method in which the portion of the content to be recovered is written to the SSD 24, and a second recovery method in which the portion to be recovered is held in the main memory 23. The recovery method selection unit 2213 calculates the remaining retention period of the content and the period during which data can be held in the SSD 24.
[0061] The remaining retention period of content is the required remaining retention period (first remaining retention period) relative to the retention period specified by the content distributor. The data retention period of the SSD 24 is the period until the content is deleted, determined according to the write algorithm (FIFO / LRU) applied to writing data to the SSD 24. The data retention period of the SSD 24 can also be called the remaining retention period until the content is deleted from the storage device (second remaining retention period). In the case of the FIFO method, for example, in a cache server 2 with a total capacity of 10 TB, if data is written at a rate of 1 TB per day, and a certain content was written 9 days ago, the remaining retention period of that content is 1 day. In the case of the LRU method, the remaining retention period is the estimated period until deletion, calculated from the amount of data written per unit time in the cache server 2, based on a list managed in order of use.
[0062] If the calculated remaining retention period of the content is longer than the calculated data retention period of the SSD 24, the recovery method selection unit 221 selects the first recovery method. That is, the portion of the content to be restored is written to the SSD 24. On the other hand, if the remaining retention period of the content is shorter than the data retention period of the SSD 24, the recovery method selection unit 221 selects the second recovery method. That is, the portion to be restored is not written to the SSD 24, but is retained in the main memory 23.
[0063] For example, if the remaining retention period of the content is "3 weeks" and the data retention period of the SSD 24 is "2 weeks," the recovery method selection unit 221 selects a first recovery method in which the portion of the content to be restored is written to the SSD 24. If the remaining retention period of the content is "2 weeks" and the data retention period of the SSD 24 is "3 weeks," the recovery method selection unit 221 selects a second recovery method in which the portion to be restored is not written to the SSD 24 and is retained in the main memory 23. In the latter case, one week of the "3 weeks" data retention period of the SSD 24 is wasted by storing unnecessary data.
[0064] In this way, in the cache server 2 of the embodiment, a content recovery method is selected so as not to write data to the SSD 24, which would result in unnecessary data being held and thus wasted.
[0065] This allows the cache server 2 of the embodiment to reduce wear on the nonvolatile memory 242 of the SSD 24.
[0066] The remaining retention period of the content may be estimated from the access history of the cache server 2 from the client 4. This estimation can be performed using Zipf distribution (popularity) or changes over time. Alternatively, the remaining retention period of the content may be calculated based on the retention period set in the cache server 2.
[0067] Next, the detailed configuration of the storage device will be described. Fig. 3 is a block diagram showing an example of the configuration of a storage device of a cache server according to an embodiment. Although Fig. 3 focuses on SSD 24-1 of cache server 2-1, the other SSDs 24-2 to 24-4 of cache server 2-1 also have the same configuration as SSD 24-1. Furthermore, each SSD included in each of the other cache servers 2-2 and 2-3 also has the same configuration as SSD 24-1.
[0068] The SSD 24 - 1 includes a controller 241 and a nonvolatile memory 242 .
[0069] The controller 241 is a memory controller. The controller 241 is, for example, a control circuit such as a System-on-a-Chip (SoC). The controller 241 is electrically connected to the nonvolatile memory 242. The controller 241 processes each I / O command received from the processor 22. These I / O commands include a write command for writing data to the nonvolatile memory 242 of the SSD 24-1 and a read command for reading data from the nonvolatile memory 242. From the perspective of the SSD 24-1, the processor 22 is an external host (host processor). When the controller 241 receives a write command from the processor 22, it writes data to the nonvolatile memory 242. When the controller 241 receives a read command from the processor 22, it reads data from the nonvolatile memory 242. A physical interface connecting the controller 241 and the nonvolatile memory 242 may be, for example, a Toggle NAND flash interface or an Open NAND flash interface (ONFI). Each function of the controller 241 can be realized by dedicated hardware, a processor executing a program, or a combination of these.
[0070] The nonvolatile memory 242 is a nonvolatile semiconductor memory. The nonvolatile memory 242 includes, for example, a plurality of nonvolatile memory dies. The nonvolatile memory dies are also referred to as nonvolatile memory chips. Each of the plurality of nonvolatile memory dies is, for example, a NAND flash memory die. Hereinafter, the nonvolatile memory die will also be referred to as a NAND flash die or simply as a die.
[0071] Next, a description will be given of the internal configuration of the controller 241. The controller 241 includes, for example, a host interface (host I / F) 2411, a CPU 2412, an error correction circuit 2413, and another CPU 2412. These components are connected to each other via an internal bus 2410.
[0072] The host interface 2411 is a communication interface circuit that executes communication with the processor 22 (host processor). The host interface 2411 is realized by, for example, a PCIe controller.
[0073] The CPU 2412 is a processor that controls each component of the controller 241. The CPU 2412 performs various processes by executing a control program (firmware) stored in the nonvolatile memory 242 or a ROM (not shown).
[0074] The error correction circuit 2413 performs an encoding process when data is written to the nonvolatile memory 242. In the encoding process, the error correction circuit 2413 adds an error correction code (ECC) as a redundant code to the data to be written to the nonvolatile memory 242. When data is read from the nonvolatile memory 242, the error correction circuit 2413 performs a decoding process. In the decoding process, the error correction circuit 2413 performs error correction on the data read from the nonvolatile memory 242 using the ECC added to the data. If the number of error bits included in this data is greater than the number of error bits that can be corrected by the correction circuit 2413, the error correction circuit 2413 notifies the processor 22 that an error has occurred in reading this data. This error is called a read error.
[0075] The NAND interface 2414 is a circuit that controls the nonvolatile memory 242. The NAND interface 2414 is electrically connected to multiple NAND flash dies included in the nonvolatile memory 242.
[0076] Next, an example of the internal configuration of the nonvolatile memory 242 will be described.
[0077] FIG. 3 illustrates an example in which the nonvolatile memory 242 includes 36 NAND flash dies #1 to #36. Each NAND flash die can operate independently. Therefore, the NAND flash dies function as a unit capable of operating in parallel. The NAND interface 2414 includes, for example, NAND controllers 24141-1, 24141-2, ..., 24141-18. The NAND controllers 24141-1, 24141-2, ..., 24141-18 are connected to channels ch1, ch1, ..., ch18, respectively. Each of the NAND controllers 24141-1, 24141-2, ..., 24141-18 is connected to one or more NAND flash dies via a corresponding channel. FIG. 3 illustrates an example in which two NAND flash dies are connected to each of channels ch1, ch2, ..., ch18. In this case, the NAND controller 24141-1 is connected to the NAND flash dies #1 and #19 via channel ch1. The NAND controller 24141-2 is connected to the NAND flash dies #2 and #20 via channel ch2. The NAND flash dies #1, #2, ..., #18 are treated as bank #1 by the controller 241. The NAND flash dies #19, #20, ..., #36 are treated as bank #2 by the controller 241. A bank is a unit in which multiple NAND flash dies operate in parallel through interleaving operation.
[0078] Next, a configuration example of a NAND flash die will be described. Fig. 4 is a block diagram showing a configuration example of a NAND flash die according to an embodiment. Fig. 4 shows a configuration example of NAND flash die #1, but the other NAND flash dies also have a configuration similar to that of NAND flash die #1.
[0079] NAND flash die #1 includes multiple blocks (BLK1, BLK2, ..., BLKx). Each block BLK is the smallest unit of a data erase operation. Each of the multiple blocks includes multiple pages (P1, P2, ..., Py). Each page P is the unit of a data write operation and a data read operation. A page includes a set of memory cells connected to the same word line. A page is also called a physical page.
[0080] Next, the error correction process in the cache server 2-1 will be described. Fig. 5 is a diagram showing an example of the error correction process executed in the cache server 2-1 according to the embodiment.
[0081] In FIG. 5, content C1 is stored in SSD 24-1, content C2 is stored in SSD 24-2, content C3 is stored in SSD 24-3, and redundant code is stored in SSD 24-4.
[0082] Content C1 includes data d1, data d2, data d3, and data d4. Content C2 includes data d11, data d12, data d13, and data d14. Content C3 includes data d21, data d22, data d23, and data d24. The redundancy code includes parity p1, parity p2, parity p3, and parity p4.
[0083] Data d1, data d11, data d21, and parity p1 form codeword CW1. Data d2, data d12, data d22, and parity p2 form codeword CW2. Data d3, data d13, data d23, and parity p3 form codeword CW3. Data d4, data d14, data d24, and parity p4 form codeword CW4.
[0084] The processor 22 may generate redundant codes when writing the content C1, the content C2, and the content C3. The processor 22 may then write the content C1, the content C2, the content C3, and the redundant codes to each SSD in parallel. For example, the processor 22 may write the codeword CW1 by executing, in parallel, the following processes: sending a write command to SSD 24-1 to write data d1; sending a write command to SSD 24-2 to write data d11; sending a write command to SSD 24-3 to write data d21; and sending a write command to SSD 24-4 to write parity P1. In a similar manner, the processor 22 may write the codewords CW2 to CW4.
[0085] Here, it is assumed that an error (read error) occurs when SSD 24-1 reads content C1, and the error correction processing unit 2207 of the processor 22 executes error correction processing on content C1. Here, it is assumed that the number of error bits included in data d1 of content C1 exceeds the number of error bits that the controller 241 of SSD 24-1 can correct.
[0086] First, the processor 22 reads the components of the codeword CW1 including the data d1. Specifically, the processor 22 transmits a read command to SSD 24-2 to read the data d11, a read command to SSD 24-3 to read the data d21, and a read command to SSD 24-4 to read the parity p1. Using the data d11, d21, and parity p1 thus read, the error correction unit 2207 of the processor 22 recalculates the correct data d1. In this way, errors in the data (here, data d1) containing many error bits among the content in which a read error occurred are corrected. Then, the error correction unit 2207 recovers the content C1 through this error correction process using the recalculated data d1 and the data d2 to d4 normally read from SSD 24-1.
[0087] In this way, the code word CW containing multiple pieces of data and parity, which are written in a distributed manner to SSDs 24-1 to 24-4 included in cache server 2-1, is used to correct errors contained in the content in which a read error has occurred, thereby making it possible to recover the content in which a read error has occurred.
[0088] Next, a content distribution process executed in the cache server 2-1 will be described. Fig. 6 is a flowchart showing the procedure of the content distribution process executed in the cache server 2-1 according to this embodiment.
[0089] First, the cache server 2-1 receives a request from a client (step S101).
[0090] The cache server 2-1 determines whether or not a cache hit has occurred (step S102). In this case, the cache server 2-1 refers to the content management table 231 and determines whether or not the content specified by the request received in S101 is stored in the nonvolatile memory 242 of any of the SSDs 24-1 to 24-4 in the cache server 2-1.
[0091] If there is a cache hit (Yes in S102), that is, if the content specified by the request is stored in the nonvolatile memory 242 of any of SSDs 24-1 to 24-4, the cache server 2-1 reads this content from the SSD including the nonvolatile memory 242 in which this content is stored (step S103).
[0092] The cache server 2-1 distributes the content read out in S103 to the client (step S104).
[0093] Also, if there is a cache miss (No in S102), that is, if the content specified by the request is not stored in any of the non-volatile memories 242 of SSDs 24-1 to 24-4, cache server 2-1 obtains the content specified by the request from origin server 1 (step S105).
[0094] The cache server 2-1 distributes the content acquired in S105 to the client (step S106).
[0095] The cache server 2-1 writes the content acquired in S105 to the nonvolatile memory 242 included in the write destination SSD selected from the SSDs 24-1 to 24-4 (step S107).
[0096] In this way, the cache server 2-1 executes the content distribution process to distribute requested content to the client in response to a request received from the client. At this time, if the requested content is stored in the storage device (here, SSDs 24-1 to 24-4) of the cache server 2-1, the cache server 2-1 reads the content from the storage device and distributes it to the client. On the other hand, if the requested content is not stored in the storage device of the cache server 2-1, the cache server 2-1 obtains the requested content from the origin server 1, distributes the obtained content to the client, and further writes the obtained content to the storage device.
[0097] Next, the error detection process will be described with reference to Fig. 7. Fig. 7 shows the error detection process executed in the information distribution system including the cache server 2-1 according to the embodiment.
[0098] 1. First, one of the clients 4-1 to 4-4 transmits a request for content to the cache server 2-1. The processor 22 of the cache server 2-1 receives the request via the NIC 21.
[0099] 2. The processor 22 sends a read request to read the content specified by the received request to, for example, the SSD 24-1.
[0100] 3-4. The controller 241 of the SSD 24-1 that has received the read request reads the content from the nonvolatile memory 242.
[0101] 5. The error correction circuit 2413 of the controller 241 performs error correction processing using the ECC added to the content read from the nonvolatile memory 242. If the number of error bits contained in the read content exceeds the number of error bits that can be corrected by the error correction circuit 2413, the error correction processing fails.
[0102] 6. If the error correction process fails, the error correction circuit 2413 notifies the processor 22 of the read error. By receiving a notification indicating the read error from the controller 241, the processor 22 detects that a read error has occurred in reading this content from the non-volatile memory 242.
[0103] Next, the content recovery process will be described. Fig. 8 is a diagram showing the content recovery process executed in an information distribution system including a cache server according to an embodiment. Here, it is assumed that a read error occurs in SSD 24-1 when reading a certain content, and a first recovery method is selected in which the content is obtained from the origin server 1 and the portion of the content to be recovered is written to SSD 24.
[0104] First, the cache server 2-1 acquires the content for which the read error occurred from the origin server 2-1.
[0105] The acquired content is temporarily stored in the main memory 23.
[0106] The content stored in the main memory 23 is then written to the SSD 24-1. At this time, the processor 22 transmits a write command to the SSD 24-1 requesting that the content be written.
[0107] Next, the error notification process will be described. Fig. 9 is a diagram showing the error notification process executed in an information distribution system including a cache server 2-1 according to an embodiment. Here, it is assumed that a read error occurs in SSD 24-1 in cache server 2-1 when reading a certain content.
[0108] 1. When the read error detection unit 2205 of the processor 22 detects a read error in a certain content, the processor 22 notifies the control server 3 of the error. By notifying the error, the processor 22 notifies the control server 3 of the occurrence of the read error and the content in which the read error occurred.
[0109] Next, the restoration instruction transmission process will be described with reference to Fig. 10, which shows the restoration instruction transmission process executed in the information distribution system including the cache server 2-1 according to the embodiment.
[0110] 1. The control server 3 sends a recovery instruction to the cache server 2-1. The recovery instruction may include information specifying a specific content. The cache server 2-1 stores the received recovery instruction in the main memory 23. Based on the recovery instruction stored in the main memory 23, the cache server 2-1 can determine whether or not to recover the content in which a read error occurred.
[0111] Next, the delivery capability of the cache server 2-1 will be described. Fig. 11 is a diagram showing a first example of the delivery capability of the cache server 2-1 according to the embodiment.
[0112] Here, it is assumed that SSDs 24-1 to 24-4 in cache server 2-1 store content A, content B, content C, content D, content E, and content F. FIG. 11 shows the predicted number of reads for each content and the distribution capacity of cache server 2-1. The predicted number of reads for each content may be either the predicted number of reads per unit time or the total predicted number of reads in the data retention request period (or the remaining data retention request period), but FIG. 11 assumes that the predicted number of reads per unit time is the predicted number of reads per unit time. The predicted number of reads per unit time for a certain content is the predicted number of times that that content will be requested by a client per unit time (for example, one second). In the following, it is assumed that the delivery capacity of the cache server 2-1 is calculated based on the predicted read count of each piece of content stored in the non-volatile memory 242 of SSDs 24-1 to 24-4. However, the delivery capacity of the cache server 2-1 may be calculated not only based on the predicted read count of each piece of content, but also based on the predicted read count of each piece of content and the required remaining data retention period for each piece of content, or based on the predicted read count of each piece of content and the size of each piece of content, etc.
[0113] The predicted read count for content C1 is 30 times / second. The predicted read count for content C2 is 50 times / second. The predicted read count for content C3 is 20 times / second. The predicted read count for content C4 is 30 times / second. The predicted read count for content C5 is 45 times / second. The predicted read count for content C6 is 25 times / second.
[0114] At this time, the delivery capability of the cache server 2-1 is A1. The delivery capability A1 is calculated based on, for example, the total predicted number of reads of the contents C1 to C6.
[0115] Here, it is assumed that an error occurs when reading the content C4 from the nonvolatile memory 242. Fig. 12 is a diagram showing a second example of the delivery capability of the cache server 2-1 according to the embodiment.
[0116] Because an error occurred when reading content C4, content C4 becomes content that cannot be delivered from cache server 2-1. Therefore, when calculating the delivery capacity of cache server 2-1, delivery capacity calculation unit 2208 of processor 22 calculates the delivery capacity based on information on contents C1 to C3 and contents C5 to C6 excluding content C4. Here, the calculated delivery capacity of cache server 2-1 is A2, which is a smaller value than A1. In other words, because content C4 has become content that cannot be delivered, the delivery capacity of cache server 2-1 decreases.
[0117] Because the predicted read count of each content affects the delivery capability of cache server 2-1, if a read error occurs not with content C4 but with content having a higher predicted read count than content C4 (for example, content C2), the delivery capability of cache server 2-1 will decrease to a value even smaller than A2. Conversely, if a read error occurs not with content C4 but with content having a lower predicted read count than content C4 (for example, content C3), the delivery capability of cache server 2-1 will be a value larger than A2. However, this delivery capability will be a value smaller than A1.
[0118] Next, an example of the operation procedure of the cache server 2 when a content read error occurs in the cache server 2 will be described. Fig. 13 is a flowchart showing an example of the operation procedure when the cache server 2 according to the embodiment causes a content read error. Here, it is assumed that whether or not to restore the content in which the read error occurred is determined based on the delivery capability of the cache server 2.
[0119] The processor 22 detects the occurrence of a read error (step S201). If the occurrence of a read error is detected, the control server 3 is notified that the occurrence of the read error has been detected.
[0120] The processor 22 calculates the delivery capability of the cache server 2, taking into consideration the read error detected in S201 (step S202). That is, the processor 22 calculates the delivery capability of the cache server 2, treating the content that could not be read from the SSD 24 due to the occurrence of the read error as content that cannot be delivered.
[0121] The processor 22 determines whether the delivery capability calculated in S202 is within a predetermined allowable range (step S203). The delivery capability being within the allowable range means that the cache server 2 can maintain the expected performance even if the delivery of the content in which the read error occurred is stopped. This allowable range can be set in advance based on the storage capacity of the cache server, other specifications, the usage pattern of the cache server, etc. The delivery capability of the cache server 2 calculated in S202 may be notified to the control server 3 together with a notification that the read error has been detected.
[0122] If the delivery capability is not within the allowable range (No in S203), the processor 22 calculates the recovery amount of the delivery capability when the content is restored and the writing cost to the SSD 24 (step S204). The processor 22 compares the recovery amount of the delivery capability calculated in S204 with the writing cost (step S205).
[0123] If the recovery amount (converted value) of the delivery capability is equal to or greater than the writing cost (converted value) (Yes in S205), the processor 22 then determines whether the remaining required retention period of the content is longer than the data retention period of the SSD 24 (storage device) (step S206). If the remaining required retention period of the content is equal to or longer than the data retention period of the SSD 24 (Yes in S206), the processor 22 selects a recovery method for writing the recovery target portion of the content to the SSD 24 and performs recovery (step S207).
[0124] On the other hand, if the remaining required retention period of the content is shorter than the data retention period of the SSD 24 (No in S206), the processor 22 selects a restoration method in which the portion of the content to be restored is not written to the SSD 24 but is retained in the main memory 23, and performs restoration (step S208). If the amount of restoration of the delivery capability is smaller than the writing cost (No in S205), the processor 22 also selects a restoration method in which the portion of the content to be restored is not written to the SSD 24 but is retained in the main memory 23, and performs restoration (step S208). Furthermore, if the delivery capability is within an allowable range (Yes in S203), the processor 22 determines not to restore the content (step S209). 13, if the objects to be compared are equivalent (if the recovery amount of delivery capability (converted value) = the writing cost (converted value) in S205, or if the remaining required retention period of content = the data retention period of the storage device in S206), a branch destination different from that described above (No in S205 or No in S206) may be set. Such a setting can be made, for example, by tuning the cache server 2.
[0125] Next, we will explain the first unique mechanism that the cache server 2 according to the embodiment has for writing the portion of the content to be restored to the SSD 24. Fig. 14 is a diagram for explaining a method for selecting a block to which the portion of the content to be restored is written in the cache server 2 according to the embodiment.
[0126] The content recovery unit 2206 first searches among the candidate blocks for a block in which the portion of the content to be restored is to be written, and which has a data retention period longer than the remaining required retention period of the content. The data retention period of a block varies depending on the degree of wear of the block. Specifically, it becomes shorter as the block wears out. If multiple blocks with data retention periods longer than the remaining required retention period of the content are found, the content recovery unit 2206 selects the block with the shortest data retention period from among them. In other words, it selects the block with a data retention period closest to the remaining required retention period of the content.
[0127] 14(A) shows an example where multiple blocks with a data retention period longer than the remaining required retention period of the content are found. Specifically, three blocks, Block 1, Block 2, and Block 3, are found.
[0128] Of these three blocks, block 2 has the shortest data retention period, so the content recovery unit 2206 selects block 2 as the block to write the portion of the content to be recovered. By leaving blocks 1 and 3, it is possible to respond to the need to recover content with a longer remaining required retention period.
[0129] 14(B) shows an example in which there is no block among the candidate blocks whose data retention period is longer than the remaining required retention period of the content. When there is no block whose data retention period is longer than the remaining required retention period of the content, the content recovery unit 2206 selects the block with the longest data retention period from among the candidate blocks. Specifically, in FIG. 14(B), there are three candidate blocks: block 4, block 5, and block 6, all of which have data retention periods shorter than the remaining required retention period of the content.
[0130] Of these three blocks, block 5 has the longest data retention period, so the content recovery unit 2206 selects block 2 as the block to write the portion of the content to be recovered. By selecting block 5, which has the lowest degree of wear, it is possible to smooth out the degree of wear between blocks.
[0131] Next, a description will be given of a second unique mechanism that the cache server 2 according to the embodiment has for writing the portion of the content to be restored to the SSD 24. Fig. 15 is a diagram for explaining a method for writing the portion of the content to be restored to the SSD 24 in the cache server 2 according to the embodiment.
[0132] 15A shows a block of the SSD 24 storing content data in which a read error has occurred. The content data stored in this block may be the entire content or a portion of the content. The content data in this block, including the portion to be restored, is the data to be restored. Here, a normal block is a block of all the blocks in the SSD 24 other than the restoration block, which will be described later.
[0133] In the cache server 2 of this embodiment, the content recovery unit 2206 does not acquire the entire data to be recovered from the origin server 1, but acquires only the data in the range where the read error occurred in the data to be recovered, i.e., only the data to be recovered, in units of a predetermined data size, from the origin server 1. Specifically, it instructs the content acquisition unit 2201 to acquire only the data in the range where the read error occurred in the data to be recovered from the origin server 1. Figure 15(B) shows the range of the data to be recovered from the origin server 1.
[0134] The cache server 2 of the embodiment reserves a certain number of recovery blocks from all blocks in the SSD 24. Recovery blocks are dedicated blocks for storing data of the portion of content to be recovered, i.e., recovery data. The cache server 2 of the embodiment also reserves a write buffer for recovery blocks in the main memory 23. The content recovery unit 2206 stores the recovery data obtained from the origin server 1 in the write buffer for recovery blocks. Figure 15(C) shows the write buffer for recovery blocks that stores the recovery data obtained from the origin server 1.
[0135] When the amount of data stored in the write buffer for recovery blocks reaches the write unit amount of the SSD 24, the content recovery unit 2206 writes the data stored in the write buffer for recovery blocks to the recovery blocks. Specifically, the content recovery unit 2206 instructs the content writing unit 2202 to write the data in the write buffer for recovery blocks to the recovery blocks. Figure 15(D) shows the recovery blocks to which the data stored in the write buffer for recovery blocks is written.
[0136] Thereafter, when a request for this content data is received, the complete content data is acquired by combining the content data stored in the normal block and including the part where the read error occurred with the recovery data of the part where the read error occurred, which is stored in the recovery block and is newly acquired from the origin server 1.
[0137] In this way, in the cache server 2 of the embodiment, the amount of data written to the SSD 24 in association with the restoration of content can be reduced, and consumption of the nonvolatile memory 242 of the SSD 24 can be suppressed.
[0138] Furthermore, if content data that is the data to be restored in a normal block is deleted while the restored data for the portion where the read error occurred is stored in the write buffer for the restoration block, the content restoration unit 2206 also deletes the restored data stored in the write buffer for the restoration block. This allows the cache server 2 of the embodiment to further reduce the amount of data written to the SSD 24 in association with the restoration of content, and further suppress wear on the nonvolatile memory 242 of the SSD 24.
[0139] If a read error occurs across all of the content data stored in a certain block, the content recovery unit 2206 may write the recovery data acquired from the origin server 1 to a normal block instead of to a recovery block. In other words, the recovery process executed by the content recovery unit 2206 may subdivide the first recovery method for writing the portion of the content to be recovered to the SSD 24, and further include as options a method for writing the recovery data to a recovery block and a method for writing the recovery data to a normal block.
[0140] Next, a unique mechanism for managing the recovery target portion of content possessed by the cache server 2 of this embodiment will be described. Fig. 16 is a diagram showing an example in which content data is stored separately in normal blocks and recovery blocks. More specifically, content data including a portion in which a read error occurred is stored in the normal blocks, and recovery data for the portion in which the read error occurred is stored in the recovery blocks. Fig. 16 also shows the address and range in which the error occurred in the content data stored in the normal blocks, as well as the recovery data storage address of the recovery data in the recovery blocks.
[0141] In order to manage the content data stored in the SSD 24 in this state, the cache server 2 of this embodiment has a recovery data management table and a recovery block management table. The recovery data management table and the recovery block management table are part of the content management table 231. Fig. 17 is a diagram showing an example of the recovery data management table. Fig. 18 is a diagram showing an example of the recovery block management table.
[0142] As shown in FIG. 17, the recovery data management table includes a content ID field, an error occurrence address field, an error occurrence range field, a recovery data storage address field, and an evaluation value field.
[0143] The content ID field holds an identifier that can uniquely identify the content. The error occurrence address field holds the error occurrence address shown in Figure 16. The error occurrence range field holds the error occurrence range shown in Figure 16. The recovery data storage address field holds an address indicating the location in the SSD 24 of the recovery block that stores the recovery data, and the recovery data storage address shown in Figure 16. Note that the recovery data storage address shown in Figure 16 may also include an address indicating the location in the SSD 24 of the recovery block. The evaluation value field holds an evaluation value of the content, calculated, for example, by calculating the product of the number of content requests per unit time and the remaining retention period of the content.
[0144] Based on this recovery data management table, the cache server 2 of the embodiment can correctly combine and acquire content data stored separately in normal blocks and recovery blocks.
[0145] On the other hand, as shown in FIG. 18, the recovery block management table includes a recovery block ID field, an address field, and a total evaluation value field.
[0146] The recovery block ID field holds an identifier that can uniquely identify the recovery block. The address field holds an address that indicates the location of the recovery block within the SSD 24. The total evaluation value field holds a total evaluation value calculated from the evaluation values of each of the multiple contents whose recovery data is stored in the recovery block (the evaluation values held in the evaluation value field of the recovery data management table).
[0147] As described above, the cache server 2 of the embodiment reserves a certain number of recovery blocks from all blocks in the SSD 24. Then, the cache server 2 of the embodiment uses this certain number of recovery blocks in a FIFO manner. When recovering a recovery block to store new recovery data, the cache server 2 of the embodiment selects recovery candidates in order of the lowest total evaluation value stored in the total evaluation value field of the recovery block management table.
[0148] In the above, an example has been described in which the cache server 2 that caused the content read error determines whether to recover the content, but the control server 3 may also determine whether to recover the content upon receiving a notification from the cache server 2 that a content read error has occurred. In other words, the cache server 2 may recover the content based on an instruction from the control server 3.
[0149] FIG. 19 is a flowchart showing an example of an operation procedure when the control server 3 of the CDN including the cache server 2 according to the embodiment receives a notification that a content read error has occurred.
[0150] The processor of the control server 3 receives a read error from the cache server 2 (step S301). The processor calculates the delivery capacity of the entire system based on, for example, the delivery capacity of each cache server 2 periodically received from all cache servers 2 and the delivery capacity of the cache server 2 after the read error occurred, received together with the read error from the cache server 2 that caused the read error (step S302).
[0151] The processor determines whether there is sufficient margin in the overall system delivery capacity (step S303). If there is not sufficient margin in the overall system delivery capacity (No in S303), the processor instructs the cache server 2 that caused the read error to recover the content (step S304). The fact that there is sufficient margin in the overall system delivery capacity means that another cache server 2 can deliver the content in place of the cache server 2 that caused the read error.
[0152] On the other hand, if there is room in the delivery capacity of the entire system (Yes in S303), the processor transfers the request from the client 4 to another cache server 2 (step S305). In other words, it is determined that the content will not be restored in the cache server 2 where the read error occurred. If the content will not be restored, the processor adds information about the content where the read error occurred to a content restoration unexecuted list (step S306). The content information to be added to the content restoration unexecuted list includes information about the cache server 2 where the read error occurred.
[0153] FIG. 20 is a flowchart showing an example of an operation procedure when the cache server 2 according to the embodiment receives a content recovery instruction from the control server 3.
[0154] The processor 22 of the cache server 2 receives a content recovery instruction from the control server 3 (step S401). Even when the cache server 2 receives a content recovery instruction from the control server 3, the cache server 2 selects a content recovery method as described with reference to Fig. 13. Steps S402 to S406 in Fig. 20 correspond to steps S204 to S208 in Fig. 13.
[0155] That is, the processor 22 calculates the recovery amount of the delivery capability when the content is restored and the writing cost to the SSD 24 (step S402). The processor 22 compares the recovery amount of the delivery capability calculated in S402 with the writing cost (step S403).
[0156] If the recovery amount (converted value) of the delivery capability is equal to or greater than the writing cost (converted value) (Yes in S403), the processor 22 then determines whether the remaining required retention period of the content is longer than the data retention period of the SSD 24 (step S404). If the remaining required retention period of the content is equal to or longer than the data retention period of the SSD 24 (Yes in S404), the processor 22 selects a recovery method for writing the portion of the content to be recovered to the SSD 24 and performs recovery (step S405).
[0157] On the other hand, if the remaining required retention period of the content is shorter than the data retention period of the SSD 24 (No in S404), the processor 22 selects a restoration method in which the portion of the content to be restored is not written to the SSD 24 but is retained in the main memory 23, and performs restoration (step S406). If the writing cost is greater than the recovery amount of the delivery capability (No in S403), the processor 22 also selects a restoration method in which the portion of the content to be restored is retained in the main memory 23, and performs restoration (step S406). As a modified example of the decision flow of S403 and S404 in the flowchart of FIG. 20, if the values to be compared are equivalent (for example, if the recovery amount of the delivery capability (converted value) = the writing cost (converted value) in S403, or if the remaining required retention period of the content = the data retention period of the storage device in S404), a branch destination different from that described above (No in S403 or No in S404) may be set. Such a setting can be made by tuning the cache server 2, for example.
[0158] In this way, even when the cache server 2 of the embodiment receives an instruction to restore content from the control server 3, it can reduce wear on the non-volatile memory 242 of the SSD 24 by selectively using either the first restoration method, which writes the portion of the content to be restored to the SSD 24, or the second restoration method, which stores the portion to be restored in the main memory 23, depending on the situation.
[0159] 21 is a flowchart showing an example of an operation procedure in which a control server 3 of a CDN including a cache server 2 according to an embodiment instructs the cache server 2 to restore content based on the content restoration unexecuted list. This operation is performed periodically by the control server 3.
[0160] The processor of the control server 3 calculates the delivery capacity of the entire system (step S501). The processor determines whether there is a margin in the delivery capacity of the entire system (step S502). If there is not a margin in the delivery capacity of the entire system (No in S502), the processor determines whether there is any unrestored content information in the unrestored content list (step S503).
[0161] If there is content information that has not been restored in the content restoration list (Yes in S503), the processor instructs the cache server 2 that caused the content read error that caused the content information that has not been restored to be added to the content restoration list to restore the content (step S504).
[0162] In this way, by managing the list of unrestored content, the control server 3 may not restore the content when a certain cache server 2 generates a content read error because there is still sufficient delivery capacity in the entire system. However, if the delivery capacity of the entire system subsequently becomes insufficient, the control server 3 can instruct the cache server 2 that generated the read error to restore the content.
[0163] Note that the instruction to restore content to the cache server 2 based on the content restoration unexecuted list may be performed in conjunction with receiving a notification that a content read error has occurred, as described with reference to Fig. 19. Fig. 22 is a flowchart showing an example of an operational procedure for instructing the cache server 2 to restore content based on the content restoration unexecuted list when the control server 3 of the CDN including the cache server 2 according to the embodiment receives a notification that a content read error has occurred.
[0164] 22 is obtained by adding steps S503 to S504 in FIG. 21 as steps subsequent to step S304 in FIG.
[0165] That is, if the delivery capacity of the entire system is insufficient (No in S303), the processor of the control server 3 first transfers the request from the client 4 to another cache server 2 (step S305). Next, the processor determines whether there is any unrestored content information in the unrestored content list (step S503).
[0166] If there is content information that has not been restored in the content restoration list (Yes in S503), the processor instructs the cache server 2 that caused the content read error that caused the content information that has not been restored to be added to the content restoration list to restore the content (step S504).
[0167] This allows the control server 3 to respond to changes in the situation more quickly than if it were to periodically instruct the cache server 2 to restore content based on the list of content that has not yet been restored.
[0168] As described above, in the cache server of the embodiment, content recovery involving writing to SSD 24 is not performed uniformly, but is performed only when the benefits of recovering the content (the amount of recovery of delivery capability) outweigh the disadvantages (the writing cost).
[0169] Furthermore, even when restoring content that involves writing to the SSD 24, the amount of data written to the SSD 24 is reduced.
[0170] In other words, the cache server according to the embodiment can reduce wear and tear on the nonvolatile memory 242 of the SSD 24.
[0171] Although several embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be embodied in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included within the scope and spirit of the invention, and are also included in the scope of the invention and its equivalents as defined in the claims. [Explanation of symbols]
[0172] 1...origin server, 2...cache server, 3...control server, 4...client, 5...network, 20...bus, 21...NIC, 22...processor, 23...main memory, 24...SSD, 231...content management table, 241...controller, 242...non-volatile memory, 2201...content acquisition unit, 2202...content writing unit, 2203...content reading unit, 2204...content reading unit, 2205...read error detection unit, 2206...content recovery unit, 2207...error correction processing unit, 2208...delivery capability calculation unit, 2209...recovery judgment unit, 2210...delivery capability transmission / reception unit, 2211...recovery instruction receiving unit, 2212...error notification unit, 2213...recovery method selection unit, 2411...host interface, 2412...CPU, 2413...error correction circuit, 2414...NAND interface, 24141...NAND controller.
Claims
1. A cache server that can be connected to an origin server that stores content via a network, a storage device including a nonvolatile memory having a finite data retention period and a finite number of writes, and a controller that controls the nonvolatile memory; a processor capable of delivering the content obtained from the origin server to a client requesting the content; Equipped with the storage device is capable of caching the content maintained on the origin server; The processor: if an error occurs when reading the cached content from the storage device, determining whether to restore the content based on the amount of recovery of the delivery capability of the cache server resulting from the restoration of the content and the cost of writing data to the storage device associated with the restoration of the content; If it is determined that the content should be restored, selecting a method for restoring the content based on a first remaining retention period for which the content should be retained and a second remaining retention period until the content is deleted from the storage device. Cache server.
2. The cache server according to claim 1 , wherein the processor determines to restore the content when a recovery amount of the delivery capability of the cache server is greater than a cost of writing data to the storage device.
3. A volatile memory is provided, The processor: If the first remaining retention period is longer than the second remaining retention period, a first recovery method is selected in which recovery data of the content is written to the non-volatile memory; If the first remaining retention period is equal to or shorter than the second remaining retention period, a second recovery method is selected in which the recovery data is not written to the nonvolatile memory but is instead retained in the volatile memory. The cache server according to claim 1 .
4. The cache server according to claim 1 , wherein the processor calculates the first remaining retention period based on an access history of the content.
5. The cache server according to claim 1 , wherein the processor calculates the first remaining retention period based on a retention period designated by a distributor of the content or a retention period designated by the cache server.
6. 2. The cache server according to claim 1, wherein the processor calculates the second remaining retention period based on an amount of data written to the storage device per unit time and a write algorithm applied to writing data to the storage device.
7. 2. The cache server according to claim 1, wherein the processor calculates the recovery amount of the content delivery capability based on the number of accesses to the content in the most recent first period and the proportion of the capacity of the content that occupies the capacity of the storage device.
8. 2. The cache server according to claim 1, wherein the processor calculates a recovery amount of the content delivery capability based on the elapsed time since the content was stored in the cache server and the ratio of the capacity of the content to the capacity of the storage device.
9. 2. The cache server according to claim 1, wherein the processor calculates the cost of writing the data based on a ratio of the size of the recovery data of the content to a write size or erase size of the storage device and a remaining number of writable times of the storage device.
10. The cache server according to claim 9 , wherein the processor calculates the remaining number of writable times of the storage device as a ratio of the number of writes to the storage device to the total number of writable times of the storage device.
11. 10. The cache server according to claim 9, wherein the processor calculates the remaining number of writable times of the storage device as a ratio of an amount of written data in the storage device to a total amount of writable data in the storage device.
12. 10. The cache server according to claim 9, wherein the processor calculates the remaining number of writable times of the storage device as a ratio of a current Bit Error Rate (BER) of the storage device to an allowable BER.
13. The processor: a certain number of blocks are reserved from among all the blocks of the nonvolatile memory as recovery blocks for storing recovery data of the content; managing a retention period for each of the certain number of recovery blocks; selecting, as a block into which the recovery data of the content is to be written, a recovery block having the shortest possible retention period for the data from among recovery blocks whose possible retention period for the data is equal to or longer than the first remaining retention period; The cache server according to claim 1 .
14. The cache server according to claim 13 , wherein the processor, when there is no recovery block for which the data can be retained for a period equal to or longer than the first remaining retention period, selects the recovery block for which the data can be retained for the longest period.
15. The cache server according to claim 14 , wherein when there are multiple recovery blocks as candidates, the processor selects the recovery block with the least number of data writes.
16. 16. The cache server according to claim 15, wherein when content data corresponding to the recovery data before writing to the recovery block, which is present in a buffer that temporarily stores the recovery data to be written to the recovery block, is erased from the storage device, the processor erases the recovery data from the buffer whose corresponding content data has been erased.
17. The processor: calculating a total evaluation value for each of the certain number of recovery blocks based on evaluation values of content data corresponding to the plurality of recovery data stored in each of the certain number of recovery blocks; selecting a recovery block to be reclaimed for writing new recovery data based on the total evaluation value; The cache server according to claim 13.
18. the cache server is connectable via the network to a control server that controls distribution of the content to the client; When an error occurs in reading the content, the processor notifies the control server of the occurrence of the error in reading the content and the delivery capability of the cache server. The cache server according to claim 1 .
19. The cache server according to claim 18 , wherein the processor restores the content for which an error occurred during the reading when an instruction to restore the content is received from the control server.
20. an origin server that holds the content; a plurality of cache servers that acquire the content from the origin server and distribute it to clients; a control server that controls the cache server for delivery of the content to the client; Equipped with Each of the plurality of cache servers transmitting the delivery capability of the cache server to the control server at predetermined intervals; If an error occurs in the content stored in the cache server, a message indicating that an error has occurred in the content is sent to the control server; When receiving an instruction to restore the content in which the error occurred from the control server, restore the content; The control server receiving delivery capabilities from the plurality of cache servers; When a notification is received from any one of the plurality of cache servers that an error has occurred in the content, calculating a delivery capacity of the entire system from the delivery capacities of each of the plurality of cache servers; determining whether or not the content needs to be restored in the cache server where the error occurred based on the delivery capacity of the entire system; If it is determined that the content needs to be restored, the cache server in which the error occurred in the content is instructed to restore the content. Content distribution system.
Citation Information
Patent Citations
Memory system including cache
US9558065B2