Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

On Linux systems (Amazon EC2), what is the maximum number of files that can be stored in one directory without slowing down performance? (I know too many files in one directory on Windows systems will cause the system to operate slowly.)

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Personally, I would keep the count under 30 000 to make sure I wouldn't have to worry about performance problems with any versions of ls or similar tools.

From a great answer on SO, here's the number of files you are able to keep, depending on your chosen file system (ext3 is default on Amazon Linux I think).

FAT32:

  • Maximum number of files: 268,435,437
  • Maximum file size: 4GB
  • maximum number of files per directory: 65535

NTFS:

  • Maximum number of files: 4,294,967,295
  • Maximum file size: 16TB currently (16EB theoretically)

Ext2:

  • Maximum number of files: 10¹⁸
  • Maximum file size: 2TB
  • theoretical file per directory limit: 1.3 × 10²⁰ files

Ext3:

  • Maximum number of files: number of bytes in volume/2¹³.
  • Maximum file size: 16GB (1KB block) to 2TB (4KB block)

Also, see this on performance problems with ls when using large directories.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.