By jjk2sfu
Running ubuntu 12.04, what is the maximum number of files and folders a single directory can hold assuming that each files are pretty small ~1kb.
I need a way to store up to a million files in a single directory
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
A million files shouldn’t be a problem. ext4 does have a 64,000 subdir limit, however.
<br>
<br>http://askubuntu.com/questions/70351/how-many-files-i-can-have-on-a-single-directory
<br>
<br>https://ext4.wiki.kernel.org/index.php/Ext4_Howto#Bigger_File_System_and_File_Sizes
<br>
The maximum number of files on your drive is limited by the inode limit. For example:
df -i
/dev/vda 1310720 230115 1080605 18% /
Shows that there are only about 1,080,000 free inodes (1,310,720 total and 230,115 used) on my droplet. So you would have to keep it under that.
You cannot currently change the number of inodes. DigitalOcean currently uses an inode ratio of 16kb meaning 20gb / 16kb = the max number of inodes. So more disk space would allow you to host more files.
You shouldn’t have a problem with a million files. There isn’t any specific limit on the number of files in a directory, but each file no matter how small take up at least on “inode.” The number of available inodes is related to the size of the disk. This does a good job of explaining it: <br> <br>http://stackoverflow.com/a/8238973/598929
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.