Putting 3 million pages in 1 folder or including them in several subfolders, which structure is faster to read and write?

If I have 3 million pages, which directory structure is better?

Method 1. ~ / 123456789.htm

(Entering all 3 million pages in the same folder folder)

Method 2. ~ / 789 / 123456789.htm

(Create 999 subfolders, each subfolder contains about 3000 pages)

In Windows Server 2008, which folder structure is faster? (To create, read and delete files)

+3
source share
4 answers

IMO putting thousands of files in a single directory is not good practice.

One option is to get the hexadecimal representation of an integer,
eg 123456789 -> 075BCD15

: ~/07/5B/CD/15.htm

+1

. DMS . /YYYY/MM/DD/HH/MM/, , .

, NTFS Windows 2008 , . 3.000.000 , . , , 10 ( 6, 3 * 10 ^ 6 ), .

, . , , , , :)

+1

, (NTFS? ext3?), , , , 3 // .

, NTFS 30 000 .

0

400K. NTFS 400K, , , 676 .

0
source

Source: https://habr.com/ru/post/1744087/


All Articles