You are here: Re: 1 - 2 millions files in one folder? « PHP Programming Language « IT news, forums, messages
Re: 1 - 2 millions files in one folder?

Posted by ImOk on 07/30/06 15:53

Miguel Cruz wrote:
> > b007uk@gmail.com wrote:
> >> Thank you!
> >> Maybe I won't need to use mysql after all!
> >> File names are words or frases that may have digits, separated by '-',
> >> like this: this-is-one-file.txt this-1-is-another.txt and-more.txt
> >> ill try to change '-' to '/' and save it like that:
> >> ./t/this/is/one/file.txt
> >> it should work
> >> Thank you for the idea again!
> >
> > If you do this you will have to make a lot of directories all the time.
> >
> > If the names are pretty unpredictable like that, how about just taking
> > the md5() of the name and using the first character of that? That way
> > you get 16 buckets to spread them out over.
> >
> > miguel
>
> Or take first 2 or 3 digits and get a hash-space of 256 or 4096
> subdirectories and filesystem will be still humming fast with 1,000,000
> files.
>
> roman

The solutions offered about breaking down into subdirectories is a good
one. I use it.

But ever hear the term throw more hardware at it? Sometimes brute force
is the cheapest way to go.

1) Buy a higher end machine.

2) You can extend current machine by spreading files across multiple
storage servers or multiple partitions.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация