Separate cache hash length and folder depth #210
-
Currently, the length of the created cache hash can be configured on the middleware options: And this is used as a parameter on But this setting is also used by So if you currently want to increase the cache hash length (e.g. to reduce collisions), it will also increase the cache folder depth. And because this is linked, it will only ever have a single image and metadata file inside a folder. I recon the folder nesting is done to prevent enumerating large amount of files in a single directory, but the additional nested folders might actually reduce I/O performance (because each folder still requires something to be written into the MFT record). I would suggest the following changes:
I've already created a branch with the first 3 changes, which I can submit as PR if you'd like. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Apologies... I need to stop reading these things first thing in the morning, I'm always grumpy. If we make these changes we need to ensure that the default behavior is backwards compatible, we've got users out there with millions of cached files. I've already made changes to #206 to ensure that users can turn on the old behavior and keep their existing cache structure. We have to do some sanity checking also to ensure that the depth cannot be greater than the hash.
This is an interesting suggestion. We'd have to think up a decent property name in the cache options -perhaps For information as why nesting occurs. Here's a feast of information on NTSF file/folder performance. |
Beta Was this translation helpful? Give feedback.
Dude. I’m not changing the cache.Apologies... I need to stop reading these things first thing in the morning, I'm always grumpy.
If we make these changes we need to ensure that the default behavior is backwards compatible, we've got users out there with millions of cached files. I've already made changes to #206 to ensure that users can turn on the old behavior and keep their existing cache structure.
We have to do some sanity checking also to ensure that the depth cannot be greater than the hash.