Home  >  Article  >  Backend Development  >  What is a good solution if I need to store a large number of similar files in the server? How to avoid single directory file limit?

What is a good solution if I need to store a large number of similar files in the server? How to avoid single directory file limit?

WBOY
WBOYOriginal
2016-08-18 09:15:471050browse

I want to store the static cache of pages in the server cache folder. However, a large number of new page caches are generated every day, and they are frequently read and written.
For this situation, what is a good solution to avoid various limitations and performance issues?

Reply content:

I want to store the static cache of pages in the server cache folder. However, a large number of new page caches are generated every day, and they are frequently read and written.
For this situation, what is a good solution to avoid various limitations and performance issues?

File restrictions can be modeled on squid’s hash into hierarchical directories; for performance, use SSD.

If it is frequently read and written, what is the use of keeping it in the cache?

Enlarge the memory, set an expiration time, and write directly to the memory
redis memcache, etc.

Hash directory hierarchical storage, take the first few characters of the file name or other methods

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn