NYCPHP Meetup

NYPHP.org

[nycphp-talk] [OT] number of files in a directory?

csnyder chsnyder at gmail.com
Sun Jan 1 14:59:27 EST 2006


On 12/31/05, Marc Antony Vose <suzerain at suzerain.com> wrote:
> Hey all:
>
> First of all:  Happy New Year!
>
> Secondly: I am rebuilding a site that was coded somewhat sloppily,
> and they have product images all stored in one directory (a script
> that I am not writing auto-uploads them to the web server from
> elsewhere).  Presently, this directory contains about 33,000 files.
> It will be more like 75,000 when the site launches, if things remain
> the same.
>
> The question is:  should I be worried about this, or was this only a
> problem several years ago? (I remember people at one time attempting
> to not put too many files in one place.)
>
> If I should be worried, what could happen?  Will we ever reach a hard
> limit of files per directory?
>
> Is it better if each product instead has its own directory inside
> there (i.e., 75,000 directories), each with as many files as we need
> inside, or is that just the same problem?
>
> Cheers,
>
> --
> Marc Antony Vose
> http://www.suzerain.com/
>

Beyond possible performance issues, another thing to consider is
scalability. If you're going to have 75,000 images at launch, how many
will there be in 3 years?

At the very least, having a year- or year-and-month-based directory
structure will allow you to add new storage as it becomes necessary.
So images/2005/ and images/2006/ can be on one partition, while
images/2007/ is on another.


--
Chris Snyder
http://chxo.com/


More information about the talk mailing list