Search code examples
imageresizer

ImageResizing.net DiskCache and CleanupStrategy with 1,000,000 images


I have around 960,000 active images (40,000 products, average 8 images per product, and in three sizes).

To avoid changing the targetItemsPerFolder in cleanupStrategy (which is not recommended) from the default 400, that would give me the need for around 2,400 folders (which rounded to the next power of two is 4,096 folders).

4,096 folders is way more folders than (default) items in folders (400). Is it better to have more folders, than files in the folders? One would think that the NTFS issue with more than 8,000 files per folder also would be an issue on folders?

Is this a situation where you would go against the recommendation of changing the targetItemsPerFolder, to lower the number of folders?

I would think a configuration like the following would be ok, but I don't like going against the warnings.

<diskCache autoClean="true" subfolders="1024" />
<cleanupStrategy targetItemsPerFolder="1000" maximumItemsPerFolder="2000" />

Any thoughts of what I should aim for? Are there any recommendations for DiskCache and CleanupStrategy for sites with lots of images?


Solution

  • It's better to have more folders. Each folder is treated as a separate slice of the cache for eviction purposes, so smaller folders are more scalable.

    I'd suggest 8,192 folders for your scenario.