It would be very useful to have the cached files distributed among subdirectories. When managing a large site, the number of individual files in a directory may sometimes overwhelm standard unix utilities or scripts (e.g. 'rm').
Perhaps something very lightweight like one- or two- levels of directories, hashed by the first/second character of the filename. This would make the number of individual files in any given directory manageable, even for larger sites.
Comments
Comment #1
crunchywelch commentedadd this to the install file:
and in cache.fs.inc change this:
to this
I'm working on some load testing for this scheme on a 4.7 site now, but it should defintely help. Drupal's file scan will break when it hits the kernel memory limit for file descriptors, which also prevents you from doing a manual rm * from the command line. This *will* happen on a busy site with lots of content.
Comment #2
crunchywelch commentedAlso, we need to ensure the subdirectories are scanned for purging. In the 4.7 implementation I have done this in system.module:
This scales nicely, and has not caused the kernel-based exhausted memory error in php on the busy site I am testing this on.
Comment #3
moshe weitzman commentedi committed #1 with modifications. will look at #2 shortly.
Comment #4
jeremy commentedIt would seem logical to have the following cache subdirectories: 'filter', 'menu', and 'page', structuring things like the database.
Comment #5
jeremy commented(Which of course you'd already done, when I finally looked at the HEAD branch.)
Comment #6
moshe weitzman commentedComment #7
(not verified) commented