CN102063462A - Method and device for recovering storage resources from cache server - Google Patents

Method and device for recovering storage resources from cache server Download PDF

Info

Publication number
CN102063462A
CN102063462A CN 201010531117 CN201010531117A CN102063462A CN 102063462 A CN102063462 A CN 102063462A CN 201010531117 CN201010531117 CN 201010531117 CN 201010531117 A CN201010531117 A CN 201010531117A CN 102063462 A CN102063462 A CN 102063462A
Authority
CN
China
Prior art keywords
resource
new
content
document number
need
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN 201010531117
Other languages
Chinese (zh)
Inventor
田江波
栗伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LANXUN NETWORK SCIENCE-TECHNOLOGY Co Ltd BEIJING
Original Assignee
LANXUN NETWORK SCIENCE-TECHNOLOGY Co Ltd BEIJING
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by LANXUN NETWORK SCIENCE-TECHNOLOGY Co Ltd BEIJING filed Critical LANXUN NETWORK SCIENCE-TECHNOLOGY Co Ltd BEIJING
Priority to CN 201010531117 priority Critical patent/CN102063462A/en
Publication of CN102063462A publication Critical patent/CN102063462A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for recovering storage resources from a cache server, which are used for solving the problem that the service capability of the cache server can be reduced caused by the method for recovering the storage resources from the cache server in the prior art. The method comprises the following steps of: when the resource storage capacity of a cache system reaches a threshold value, determining resource numbers which need recovering; and when new contents need storing, writing the new contents in resources corresponding to the resource numbers which need recovering. The storage resources which need recovering are not physically deleted, so the service capability of the cache server is improved when the storage resources are recovered.

Description

A kind of method and device that reclaims storage resources in the caching server
Technical field
The invention belongs to field of computer technology, particularly a kind of method and device that reclaims storage resources in the caching server.
Background technology
The caching server that Cache server is just usually said, in the process of serving for the source station normally, can constantly grasp new source station content from the source station, be buffered in the file of cache server this locality, thereby improve netizen's speed of download, promote netizen's experience of surfing the Net.
Because the content quantity of source station is very big, the memory capacity of cache server is limited, it obviously is unpractical wanting all content cachings in source station are got off, so cache server must adopt certain mechanism, when reaching certain threshold value, memory capacity deletes some old files, to guarantee that having the position in the new source station can store, this mechanism is called cache server file reclaim mechanism.
The file reclaim mechanism of existing cache server software is roughly as follows:
1, existing cache server software has its configuration file, the O﹠M personnel control most of behavior of existing cache server software by the configuration configuration file, the threshold value of startup file reclaim mechanism can be disposed by configuration file, the operable disk size of cache server software can also be disposed.For example threshold value is set to 90, when the file size of storage on the cache server reached operable disk size 90% the time, will the startup file reclaim mechanism, the content in file and the file is deleted.
2, existing cache server software self inside has a monitor event, the operation of this incident each second kind once, whether the capacity of constantly checking disk has reached threshold value, if reached threshold value just according to lru (Least Recently Unused, use at most recently) algorithm is found out those the coldest files, these files are done the physics deletion from disk, the physics deletion is divided into two steps: one, the document number that these are cold is labeled as and can uses, the operable meaning is " this article piece number is not used now ", promptly discharge this article piece number, when have new content to store next time, just can use this document number to create new file like this, and content is written to this file.Two, physically delete this file.
Similarly situation is, also there is similar problem in Cache server when data import in disk in internal memory, the capacity of the internal memory of Cache server is limited, data importing is behind internal memory in a large amount of disks, when then in internal memory, importing data once more as not taking appropriate measures, can cause original loss of data in the internal memory, response mechanism of the prior art is, when the memory capacity reaches certain threshold value, concentrate and discharge old address space in some internal memories, when new disc content imports in internal memory, redistribute a sector address space again
Very big problem of prior art is: by the long-term test of online service environment, when existing cache server software during at the startup file recovery process, the service ability of cache server is subjected to great influence, the general service ability 50%-70% that can both descend.Similarly when cache server carries out the address space release in the internal memory and redistributes, also can take the certain system resource of cache server, cause cache server service ability to descend, no matter be the file that relates in the file recovery process, still the address space that relates in the Memory Allocation flow process all is a kind of storage resources, this shows the method for storage resources among the existing recovery cache server, can cause cache server service ability to descend.
Summary of the invention
The invention provides a kind of method and device that reclaims storage resources in the caching server, the problem that cache server service ability descends when solving the startup storage resources reclaim mechanism that exists in the prior art.
The embodiment of the invention provides a kind ofly reclaims that the method for storage resources comprises in the caching server:
When the resource memory capacity of caching system reaches threshold value, need to determine the resource number of recovery;
When new content need be stored, new content is write in the resource of the resource number correspondence that needs recovery.
The embodiment of the invention also provides a kind of method that reclaims storage resources in the caching server, and this method comprises:
When the memory capacity of caching server reaches threshold value, need to determine the resource number of recovery;
When having new content to store, deletion needs the resource of the resource number correspondence of recovery to set up new resource, and new content is write in the new resource.
The embodiment of the invention also provides a kind of device that reclaims storage resources in the caching server, and this device comprises:
Determination module is used for when the resource memory capacity of caching system reaches threshold value, need to determine the resource number of recovery;
First writing module is used for when new content need be stored, and new content is write in the resource of the resource number correspondence that needs recovery.
The embodiment of the invention also provides a kind of device that reclaims storage resources in the caching server, and this device comprises:
Determination module is used for when the memory capacity of caching server reaches threshold value, need to determine the resource number of recovery;
Second writing module, when being used to have new content to store, deletion needs the resource of the resource number correspondence of recovery to set up new resource, and new content is write in the new resource.
Beneficial effect of the present invention is as follows: with respect to traditional cache server storage resources recovery method, adopted the resource number elder generation preservation method for future use that will reclaim, need not the utilization again that the corresponding resource of physics deletion has realized resource, or only when having new content to store, deletion needs the resource of recovery, avoided the deletion action of concentrating in the prior art, solve the problem of the service ability decline of cache server software when resource reclaims, thereby improved the service ability of cache server software greatly.
Description of drawings
The method flow diagram that Fig. 1 provides for first embodiment of the invention;
The method flow diagram that Fig. 2 provides for second embodiment of the invention;
The structure drawing of device that Fig. 3 provides for third embodiment of the invention;
The structure drawing of device that Fig. 4 provides for fourth embodiment of the invention.
Embodiment
The problem that cache server service ability descends when solving the startup storage resources reclaim mechanism that exists in the prior art, the first embodiment of the present invention provides a kind of method that reclaims storage resources in the caching server, it is that example describes to reclaim the file of storing among the cache server that present embodiment provides method, comprises the steps: as shown in Figure 1
Step 101, regularly check whether cache server disk size reaches threshold value.
The disk size used by the configuration file configuration in the present embodiment is 100G, and threshold value is set to 90, when the file size of storage on the cache server reaches 90G, has promptly reached threshold value.Present embodiment does not limit the setting of threshold value, during practical application, can set according to the size of disk size and concrete demand.
If step 102 reaches threshold value, then according to not using the document number that the lru algorithm is found out needs recovery recently at most.
For example:, then find out document number 000001,00000A, 100001,10000A, 010001,01000A, 110001, the 11000A that needs recovery according to the lru algorithm if the file size of storage has reached 90G on the cache server.
Step 103, the document number of finding out is made marks, show that these document numbers can be used.
Step 104, the document number that has mark is preserved, put into a document number pool (pond).
Document number pool is one section fixing address space in the internal memory in the present embodiment.For example will need the document number 000001,00000A, 100001,10000A, 010001,01000A, 110001, the 11000A that reclaim to put into document number pool.
Step 105, when new source station content need be stored, whether the document number document number that has mark is at first arranged among the viewing files pool, if have then from document number pool, take out,, write this document with new source station content the former meaningful deletion in this article piece number corresponding file.
For example, new source station content contentl needs storage, whether the document number document number that has mark is at first arranged among the viewing files pool, because in the step 104, document number 000001,00000A, 100001,10000A, 010001,01000A, 110001,11000A has deposited among the document number pool, therefore can from document number pool, take out the document number 000001 that has mark in this step, be the new source station content content0 deletion of original content in 000001 the file with document number, it is in 000001 the file that new source station content content1 is write document number.
With respect to traditional cache server file recovery method, made full use of the characteristic that cache server software self application layer is separated to the administrative mechanism of file to the administrative mechanism of file and low-level operation system, adopted the document number that will reclaim (being a kind of resource number) preservation method for future use earlier, need not to delete the utilization again that corresponding file has realized file, or only when having new source station content to store, deletion needs the file of recovery, avoided the deletion action of concentrating, solve the very high problem of disk input and output io load when file reclaims, thereby improved the service ability of cache server software greatly.
Similarly method is also applicable to the recovery of the address space in the internal memory, process is similar, check regularly whether cache server memory size reaches threshold value, if reach threshold value, then find out the address (being resource number) of the address space that needs recovery according to predetermined rule, the address of finding out is made marks, show that these addresses can be used, and zero setting is carried out in these corresponding address spaces, address handled, when new content need be stored, do not need the deallocation space, directly new content is write in the address space that aforementioned addresses shows.
The second embodiment of the present invention provides a kind of method that reclaims storage resources in the caching server, and present embodiment provides method to comprise the steps: as shown in Figure 2
Step 201, regularly check whether cache server disk size reaches threshold value.
If step 202 reaches threshold value, then find out the document number that needs recovery according to the lru algorithm.
Step 203, when new source station content need be stored, the document number that deletion is found out according to the lru algorithm is also set up new file, and new source station content is write in the new file.
For example when a new source station content content1 need store, deleted file number 000001 corresponding file, and set up a new file, content1 is write in this new file.And for example, as two new source station content content1, when content2 need store, deleted file number 000001,00000A corresponding file, and set up two new files, content1, content2 are write respectively in these two new files.
Similarly method is also applicable to the recovery of the address space in the internal memory, process is similar, check regularly whether cache server memory size reaches threshold value, if reach threshold value, then find out the address (being resource number) of the address space that needs recovery according to predetermined rule, only when new content need be stored, discharge old address space and redistribute new address space.
The third embodiment of the present invention provides a kind of device that reclaims storage resources in the caching server, and the device that present embodiment provides comprises as shown in Figure 3:
Determination module 301 is used for when the resource memory capacity of caching system reaches threshold value, need to determine the resource number of recovery;
First writing module 302 is used for when new content need be stored, and new content is write in the resource of the resource number correspondence that needs recovery.
Further, determination module 301 also is used for when the memory capacity of caching server reaches threshold value, need to determine the document number of recovery;
First writing module 302, when also being used for the source station and having new content to store, the content that the source station is new writes in the document number corresponding file that needs to reclaim.
Further, determination module 301 also is used for according to not using algorithm to search and determine the document number of needs recovery recently at most.
Further, determination module 301 also is used for the document number that needs reclaim is carried out mark, shows and can be used.
Further, first writing module 302 also is used for the document number that has mark is put into one section fixing address space of internal memory, when new source station content need be stored, from this address space, take out document number, new source station content is write in the document number corresponding file of taking-up.
The fourth embodiment of the present invention provides a kind of device that reclaims storage resources in the caching server, and the device that present embodiment provides comprises as shown in Figure 4:
Determination module 301 is used for when the memory capacity of caching server reaches threshold value, need to determine the resource number of recovery;
Second writing module 303, when being used to have new content to store, deletion needs the resource of the resource number correspondence of recovery to set up new resource, and new content is write in the new resource.
Further, determination module 301 is used for when the memory capacity of caching server reaches threshold value, need to determine the document number of recovery;
Second writing module 303, when being used for the source station and having new content to store, the document number corresponding file that deletion needs to reclaim is set up new file, and the content that the source station is new writes in the new file
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.This section is the final stage of instructions.

Claims (14)

1. a method that reclaims storage resources in the caching server is characterized in that, comprising:
When the resource memory capacity of caching system reaches threshold value, need to determine the resource number of recovery;
When new content need be stored, new content is write in the resource of the resource number correspondence that needs recovery.
2. the method for claim 1 is characterized in that, when the resource memory capacity of caching system reaches threshold value, determines that the resource number that needs to reclaim is specially:
When the memory capacity of caching server reaches threshold value, need to determine the document number of recovery;
When new content need be stored, new content is write in the resource of the resource number correspondence that need to reclaim and is specially:
When the source station had new content to store, the content that the source station is new write in the document number corresponding file that needs to reclaim.
3. method as claimed in claim 2 is characterized in that, determines that the document number that needs to reclaim is specially:
According to the document number of not using algorithm to search and need to determine to reclaim recently at most.
4. method as claimed in claim 3 is characterized in that, also comprises after the document number of determining to need to reclaim:
The document number that needs reclaim is carried out mark, show and to be used.
5. method as claimed in claim 4 is characterized in that, when the source station had new content to store, the content that the source station is new write in the document number corresponding file that needs to reclaim and is specially:
The document number that will have mark is put into one section fixing address space of internal memory, when the source station has new content to store, takes out document number from this address space, and the content that the source station is new writes in the document number corresponding file of taking-up.
6. a method that reclaims stored resource in the caching server is characterized in that, comprising:
When the memory capacity of caching server reaches threshold value, need to determine the resource number of recovery;
When having new content to store, deletion needs the resource of the resource number correspondence of recovery to set up new resource, and new content is write in the new resource.
7. method as claimed in claim 6 is characterized in that, when the memory capacity of caching server reaches threshold value, determines that the resource number that needs to reclaim is specially:
When the memory capacity of caching server reaches threshold value, need to determine the document number of recovery;
When having new content to store, deletion needs the resource of the resource number correspondence of recovery to set up new resource, new content is write in the new resource be specially:
When the source station had new content to store, the document number corresponding file that deletion needs to reclaim was set up new file, and the content that the source station is new writes in the new file.
8. a device that reclaims the file of storing in the caching server is characterized in that, comprising:
Determination module is used for when the resource memory capacity of caching system reaches threshold value, need to determine the resource number of recovery;
First writing module is used for when new content need be stored, and new content is write in the resource of the resource number correspondence that needs recovery.
9. device as claimed in claim 8 is characterized in that, determination module also is used for when the memory capacity of caching server reaches threshold value, need to determine the document number of recovery;
First writing module, when also being used for the source station and having new content to store, the content that the source station is new writes in the document number corresponding file that needs to reclaim.
10. device as claimed in claim 9 is characterized in that, determination module also is used for according to not using algorithm to search and determine the document number of needs recovery recently at most.
11. device as claimed in claim 10 is characterized in that, determination module also is used for the document number that needs reclaim is carried out mark, shows and can be used.
12. device as claimed in claim 11, it is characterized in that, first writing module, also be used for the document number that has mark is put into one section fixing address space of internal memory, when new source station content need be stored, from this address space, take out document number, new source station content is write in the document number corresponding file of taking-up.
13. a device that reclaims stored resource in the caching server is characterized in that, comprising:
Determination module is used for when the memory capacity of caching server reaches threshold value, need to determine the resource number of recovery;
Second writing module, when being used to have new content to store, deletion needs the resource of the resource number correspondence of recovery to set up new resource, and new content is write in the new resource.
14. device as claimed in claim 13 is characterized in that, determination module is used for when the memory capacity of caching server reaches threshold value, need to determine the document number of recovery;
Second writing module, when being used for the source station and having new content to store, the document number corresponding file that deletion needs to reclaim is set up new file, and the content that the source station is new writes in the new file.
CN 201010531117 2010-10-29 2010-10-29 Method and device for recovering storage resources from cache server Pending CN102063462A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010531117 CN102063462A (en) 2010-10-29 2010-10-29 Method and device for recovering storage resources from cache server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010531117 CN102063462A (en) 2010-10-29 2010-10-29 Method and device for recovering storage resources from cache server

Publications (1)

Publication Number Publication Date
CN102063462A true CN102063462A (en) 2011-05-18

Family

ID=43998740

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010531117 Pending CN102063462A (en) 2010-10-29 2010-10-29 Method and device for recovering storage resources from cache server

Country Status (1)

Country Link
CN (1) CN102063462A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016134627A1 (en) * 2015-02-27 2016-09-01 Huawei Technologies Co., Ltd. Method and system for smart object eviction for proxy cache
CN108776614A (en) * 2018-05-03 2018-11-09 华为技术有限公司 The recovery method and device of memory block

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001051892A (en) * 1999-08-06 2001-02-23 Nippon Telegr & Teleph Corp <Ntt> Method and device for calculating cache server performance value and storage medium stored with cache server performance value calculating program
CN101105773A (en) * 2007-08-20 2008-01-16 杭州华三通信技术有限公司 Method and device for implementing data storage using cache
CN101588369A (en) * 2009-06-25 2009-11-25 浙江大学 Service discovery method based on Service Cache
CN101833512A (en) * 2010-04-22 2010-09-15 中兴通讯股份有限公司 Method and device thereof for reclaiming memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001051892A (en) * 1999-08-06 2001-02-23 Nippon Telegr & Teleph Corp <Ntt> Method and device for calculating cache server performance value and storage medium stored with cache server performance value calculating program
CN101105773A (en) * 2007-08-20 2008-01-16 杭州华三通信技术有限公司 Method and device for implementing data storage using cache
CN101588369A (en) * 2009-06-25 2009-11-25 浙江大学 Service discovery method based on Service Cache
CN101833512A (en) * 2010-04-22 2010-09-15 中兴通讯股份有限公司 Method and device thereof for reclaiming memory

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016134627A1 (en) * 2015-02-27 2016-09-01 Huawei Technologies Co., Ltd. Method and system for smart object eviction for proxy cache
CN108776614A (en) * 2018-05-03 2018-11-09 华为技术有限公司 The recovery method and device of memory block
CN108776614B (en) * 2018-05-03 2021-08-13 华为技术有限公司 Recovery method and device of storage block

Similar Documents

Publication Publication Date Title
US8595451B2 (en) Managing a storage cache utilizing externally assigned cache priority tags
US9940261B2 (en) Zoning of logical to physical data address translation tables with parallelized log list replay
US8990502B2 (en) Write cache structure in a storage system
CN102782683B (en) Buffer pool extension for database server
CN107656875B (en) Method and system for shortening power-on time of solid state disk serving as system disk
US7937522B2 (en) Method for flash memory data management
CN111007991B (en) Method for separating read-write requests based on NVDIMM and computer thereof
CN101645043B (en) Methods for reading and writing data and memory device
CN103246696A (en) High-concurrency database access method and method applied to multi-server system
CN107016100A (en) A kind of metadata management method based on Nonvolatile memory file system
CN102521147A (en) Management method by using rapid non-volatile medium as cache
CN102567427A (en) Method and device for processing object data
CN105718530A (en) File storage system and file storage control method thereof
CN102768645A (en) Solid state disk (SSD) prefetching method for mixed caching and SSD
CN103678166A (en) Method and system for using solid-state disk as cache of computer
CN102981979B (en) A kind of method improving memory system data access speed
US8856439B2 (en) Method and device for utilizing application-level prior knowledge for selectively storing data in higher performance media
CN103744611A (en) Computer system based on solid state disc as cache and cache accelerating method
CN103198021A (en) Method for improving solid state disk data transmission efficiency
CN105607862A (en) Solid state disk capable of combining DRAM (Dynamic Random Access Memory) with MRAM (Magnetic Random Access Memory) and being provided with backup power
CN102306124A (en) Method for implementing hardware driver layer of Nand Flash chip
CN100580669C (en) Method for realizing cache memory relates to file allocation table on Flash storage medium
CN107577492A (en) The NVM block device drives method and system of accelerating file system read-write
US10073851B2 (en) Fast new file creation cache
CN105630410A (en) Method for dynamically managing file memory area by nonvolatile random access memory chip

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20110518