Mysql – limit that a folder can store how many files and folders

filesystemsimagesMySQL

I have this folder, called it 'X'.

Currently, it has 40k folders and 70k files.

I am abit worried, inside are the images. Is there a limit that the folder 'X' can store?

That folder is important, it stores my current users images. Please advise?

Or should I store in database (BLOB)? I am using mysql.

Please advise.

EDIT:

I am using windows server 2003. IIS 6

Best Answer

It is all very well posting theoretical NTFS limits as some other posters have done, however you will find that in reality if you put 100k files in a folder, performance on accessing those files significantly drops. This is the case not just with NTFS but all the popular Linux filesystems as well.

The easiest method is to divide them into subfolders holding no more than 10k-20k each. If your naming is relatively evenly distributed you can do this by the first few characters of the filename to keep it simple. You want to create these folders in one go, not on the fly, so that the root folder is not fragmented.

There is also the issue of wasted space in blocks if you files are small and do not align to the block size. If this is the case then you may want to look at combining files to match it.