SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Not yet perfect mattalexx's Avatar
    Join Date
    Oct 2005
    Location
    Taos, NM, US
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pros and Cons of less files in a folder

    I have a caching directory that holds images. The directory might at some point carry millions of images. Right now, I hold them like this:
    Code:
    /cache/images/0cbc65283c3385469b18d8ead375177b.jpg
    /cache/images/0f6a8324e77936f281c176740e5d88df.jpg
    /cache/images/1cb609c319a57f816b807172f8369cdb.jpg
    /cache/images/2b6dc4d6135bd9808e4f60617cef287e.jpg
    /cache/images/3d0d6c7ab1cae640977a2de52f56455b.jpg
    /cache/images/6a9291311264b50563fda7fd61b29be0.jpg
    But I've seen people do this:
    Code:
    /cache/images/0/c/0cbc65283c3385469b18d8ead375177b.jpg
    /cache/images/0/f/0f6a8324e77936f281c176740e5d88df.jpg
    /cache/images/1/c/1cb609c319a57f816b807172f8369cdb.jpg
    /cache/images/2/b/2b6dc4d6135bd9808e4f60617cef287e.jpg
    /cache/images/3/d/3d0d6c7ab1cae640977a2de52f56455b.jpg
    /cache/images/6/a/6a9291311264b50563fda7fd61b29be0.jpg
    I'm assuming that they do that so that there are less files per folder and it speeds up IO stuff a little. Am I right? If not, what's the real reason?
    Matt Alexander
    Alexander Site Design

  2. #2
    SitePoint Wizard cmuench's Avatar
    Join Date
    Jul 2005
    Location
    At my computer
    Posts
    2,251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *

    FAT aka FAT16

    FAT, for File Allocation Table, is the successor to the original FAT12 filesystem that shipped with MS-DOS many, many years ago.
    o

    Maximum disk size: 4 gigabytes
    o

    Maximum file size: 4 gigabytes
    o

    Maximum number of files on disk: 65,517
    o

    Maximum number of files in a single folder: 512 (if I recall correctly, the root folder "/" had a lower limit of 128).
    *

    FAT32
    "There's no practical limit on the combined sizes of all the files in a folder, though there may be limits on the number of files in a folder."

    FAT32 was introduced to overcome some of the limitations of FAT16.
    o

    Maximum disk size: 2 terabytes
    o

    Maximum file size: 4 gigabytes
    o

    Maximum number of files on disk: 268,435,437
    o

    Maximum number of files in a single folder: 65,534
    *

    NTFS

    NTFS, or "New Technology File System" introduced with Windows NT, is a completely redesigned file system.
    o

    Maximum disk size: 256 terabytes
    o

    Maximum file size: 256 terabytes
    o

    Maximum number of files on disk: 4,294,967,295
    o

    Maximum number of files in a single folder: 4,294,967,295



    Linux has no limit that I could find. however if you are using a journaling file system one would think it would slow down to have to find the file.

  3. #3
    Not yet perfect mattalexx's Avatar
    Join Date
    Oct 2005
    Location
    Taos, NM, US
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. That was helpful (and kind of interesting). There's CentOS on ext3 on the server. I guess I will try it. Won't hurt.
    Matt Alexander
    Alexander Site Design


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •