Image files, cached files, etc. is it necessary to separate many folders? -Php Tutorial

Source: Internet
Author: User
Image files, cached files, etc. is it necessary to separate many folders? Many people say that a folder cannot contain more than 1000 pieces of information, otherwise it is a waste of resources;
I don't quite understand;
If the file is traversed, this may waste too much resources;
If a specific file path is given, it will not traverse, but read and modify it. is this a waste of resources?

My cache folder contains 10 million cached HTML files. using complex algorithms to separate multiple directories makes it difficult to make one folder contain no more than 1000 pieces of information. Instead, it is troublesome to manage.
Only modify, read, create, and delete cached files. the specific path. Will this affect the performance ?!


Reply to discussion (solution)

Not all cached files are frequently used. you only need to cache the required content. For more information about the number of files in a folder, it may be related to the disk's division of the file size. some of them do not remember. This means that if there are too many files to be wasted, a total of space will be wasted.
I don't think we need to consider the current hardware.

Some systems ?,? ? File ?? ? Is there a limit, and if the file ?? File? Multiple, list ?? Very slow.

View the file system.

Files in the same folder cannot be duplicated (files in different folders can be duplicated)
The characters that can be used as file names are limited, so the file name will become lengthy and the readability will decrease.

When accessing a file, the operating system needs to read the directory file first and find the location of the desired file in the hard disk in the directory file.
Obviously, the directory file is relatively small, and the time to find the file is relatively short.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.