I've been researching the web in an attempt to see if there is a recommended maximum for the number of files in an IIS folder but the opinions vary wildly. I am building an image library site and storing small JPGs which users search for using a SQL db. I currently have 2700 images in one folder and there is no apparent difference in speed between that one and another with only 50 images. A common opinion is that the absolute max is 65565 files but other people have suggested as low as 2000 which is obviously wrong. I cannot find an answer via MS Support unfortunately. I will be splitting the images by subject at some point but am trying to find out at what point it the splitting up will become essential. Any thoughts much appreciated! Steve / Slick Stock Images
Hi Mark, Thanks for the full and considered reply! I don't have a MSDN login but I have done a fair amount of research and a number of articles I've read mention the 4kb cluster size. Fortunately the folder will never be browsed as a whole - the SQL db will usually only return links to 12 images at a time and users will have the option to view 24, 48 or 96 per page. Each time the user advances to the next page the db returns the links to the next batch and in this way the existing site I've just finished works really fast. With images at only 30/40Kb in size then it will take a while to get even to 4Gb so maybe it's not too much of an issue after all. This new library project is a rebuild of an existing library and it might be easier to leave images in a single folder, hence my question, but the purist in me prefers the idea of splitting the images up in some way, probably by category. It just depends how much the client wants to spend! Thanks again for your reply and I think I now have my answer! Cheers, Steve
I'll always help where I can, it is an honor to do so. By the way... This article was published today and will no doubt be beneficial to you: http://weblogs.asp.net/omarzabir/archive/2008/04/07/reduce-website-download-time-by-heavily-compressing-png-and-jpeg.aspx Salute, Mark http://blogcastrepository.com/blogs/wisemx/
Hi Steve, As you already know it is incredibly difficult to get the "hard" numbers on this. The best I've done has been with the Windows Server technical library. If you have a MSDN login you can search the Technet library on-line. http://technet.microsoft.com/ In the past I spent some of my time traveling with Microsoft Tech shows. My role was to keep up on the NTFS technologies and describe what I could when questions came up. As you already know many things changed from FAT32 to NTFS on Windows Servers. That being said...I would describe your limitations more in volume than numbers. It will not be a problem on a Shared Host because you will hit internal limits first. As an example, the largest factor here is the 4kb default cluster size, which limits you to 4GB per folder. See what I mean? But even that is not a hard limit, you can go over 4GB and your folder will survive. My suggestion will be to limit the number of files if you ever need to Browse the folder. Depending on what you open the file handles with the number of files in each folder may stress your app. However, if you dump 5,000 images in a folder and only access them via SQL strings... I've done this on Shared servers and have never had a problem with it. Take for example a Forum that has thousands of avatar images. Those avatar image folders will be difficult to browse but they will not be any problem from code or SQL. The absolute quickest browsing file limit is 199, lightning fast. As you go beyond that number you do not hit a "hard" limit but you do begin to loose folder browsing speed. I do not believe you need to worry but the DASP crew may have some performance suggestions for you. Salute, Mark Post Edited (wisemx) : 4/7/2008 12:29:20 PM GMT