Jump to content
php.lv forumi

Liels failu daudzums direktorijā


GS_

Recommended Posts

nez, es tā nedarītu :)

 

Depends on which file system you're using. Reiserfs (my favorite) can handle up to 2^31 files per dir (that's 2 billion), with a max of 2^32 (4 billion) files on the filesys total. It can handle up to 64000 subdirs in a dir (rough numbers, for exact numbers see the faq at www.namesys.com).

 

Ext2 (and hence also ext3) has a limit of 32000 subdirs per dir. The max number of files per dir is theoretically unlimited (actually around 130 trillion), but performance becomes terrible with above 10-15 thousand files. The max number of total files on the filesys is limited by the number of inodes you have. With a 1 gig filesystem and a 4k block/inode ratio (the default), you have around 260000 inodes, and that's also the max number of files you can have.

Link to comment
Share on other sites

Failu sistēmā katra foldera saturs ir indeksēts saraksts.

ja man mapē:

/dati/

ir 100000 failu - tad tas ir viens liels indeksēts saraksts, kurā (minējums - glabājot indeksu kā AWL koku) jāsameklē norāde uz attiecīgā faila fizisko atrašanās vietu.

Savukārt mapju struktūra:

/dati/XXX/YYY/ZZZ/

kur katrā mapē ir ne vairāk par (pieņemsim) 100 failiem - faila atrašanai var vienlaicīgi izmantot jau 4 indeksus dati XXX YYY un ZZZ.

 

Kura no šīm metodēm dzīvē ir ātrāka - tas būtu jānoskaidro eksperimentāli :)

Link to comment
Share on other sites

minējums - glabājot indeksu kā AWL koku

AVL, nevis AWL.

Un tas ir atkarīgs no failsistēmas kā tās glabā failu sarakstu folderī.

Citi izmanto binārus, sakārtotus kokus, citi lineārus sarakstus (FAT32), citi heštabulas (ZFS), citi citus kokus (B+ izmanto NTFS,XFS,JFS,ReiserFS3), citi citus hibrīdus (ext3 var izmantot hašotu B- koku).

Link to comment
Share on other sites

Ehh... biezpiens & atmiņa :D

Tiktiešām AVL - AVL tree is named after its two inventors, G.M. Adelson-Velskii and E.M. Landis

Es kautkā par to biju aizmirsis - un galvā biju sakonstruējis kaut kādu mistisku Average Weighted List, kas man likās varen pareizais nosaukums :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...