Re: Regarding LARGE number of files in a folder in linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Thu, Jul 09, 2009 at 01:04:37PM -0400, Bob Hoffman wrote:
> If you have 300,000 clients you could give them their own folder each and
> then the folders would have only 10 photos, but one folder would contain
> 300,000 folders.

No.  Because that top level folder would be split by first letter, or
by first and second letter
eg
"fred" would be f/r/fred   (or  f/r/ed)
"harry" would be h/a/harry (or  h/a/rry)

If you find there's too much clumping then (eg you have a lot of people
beginning "fr"), you hash the name instead, and then split on the hash.
(A simple hash could just be an incrementing number - "userid").

Then you simply program the web server to automatically convert from
friendly name to split (or split hash'd) name.  So it _looks_ like
everyone has names like "fred" and "harry" but your directory structure
is a lot more efficient.

> SO what is best for file management and system resources?

Best is subjective.  I've just described _one_ method.

-- 

rgds
Stephen
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux