[drupal-devel] file attachment storage

Craig Courtney craig at dawnsedge.com
Mon Jun 27 14:10:14 UTC 2005


Karoly Negyesi wrote:

>On Monday 27 June 2005 14:41, David Norman wrote:
>  
>
>>I'm just tossing this up for discussion, but is it of any concern for
>>scaling that all attachments get dropped in the same directory? Might it
>>be better for them to be divided up by module so book attachments get
>>filed into a book subdirectory of the files directory?
>>    
>>
>
>I have looked into this, and it is not a problem.
>
>ext2fs needs a special setting if you a real lot of files, but that's all. 
>Every filesystem (which is not FAT...) is happy with something like a 
>million files according to Google.
>  
>
This can be a problem, even on unix style file systems.  The file system 
itself is fine and dandy, but get over a couple thousand files in one 
directory and things like 'ls' and 'rm *' and other directory management 
commands start having problems.  At work we have some systems that dump 
out individual log files per service execution (vendor code not ours) 
and we where forced to write custom scripts to manage these log directories.

I have an alternative file system management module and an equivalent of 
upload module which uses it that allows the system admin to specify the 
max number of files in a directory.  Look in modules under filemanager 
and attachment.  These modules allow multiple files with the same name 
as well as allow modules to have both private (permissions enforced with 
Drupal) and public (no php code involved in the download) concurrently.  
Also the attachment module does not suffer from simultaneous upload race 
problems (http://drupal.org/node/11060) nor does it rely on the users 
logging out to free up space used by uploaded files that where not 
submitted.

Craig



More information about the drupal-devel mailing list