• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

Linux: Large Directories and Performance

I need to store about ten thousand files on a Linux web server.  The web path to the files will be stored in a database.  Would it be best for performance to place all the images in a single directory or would it be better to place them in randomly named sub-directories with less files in each sub-directory?  
1 Solution
With most modern file systems (anything that you will be using is 'modern') this is not much of an issue.
It depends on what your system is running.
Most of them are happy with about 10,000 but some like EXT2 will start to struggle about this point as there is no index for the directory tables.
Ext3 or 4 would cope with no issue as would most other more modern Filesystems.

type in
if you want to see how it is formatted and mounted.

Kerem ERSOYPresidentCommented:
Only I am not sure EXT3 would perform better than EXT2. They are the same except for EXT3 has a journal file over the top of EXT2.

EXT4 is a different story and it can support so many files and perform faster than EXT3 so I suggest you to use EXT4.


Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now