Why SMB_ROUNDUP_ALLOCATION_SIZE so large

Jeremy Allison jra at samba.org
Mon Jun 7 22:30:43 GMT 2004


On Mon, Jun 07, 2004 at 04:50:12PM -0500, Steve French wrote:
> It confuses those reading output from some of the common commands like
> du that the SMB_ROUNDUP_ALLOCATION_SIZE is set so large (1MB) in local.h
> (which is used by get_allocation_size) since it causes even 1 byte files
> to apparently take 1MB of disk space - confusing as you read some Unix
> commands on the client and see them differ so much from the same on ext3
> on the server.   In addition this means samba differs significantly from
> Windows  which has a much smaller minimum allocation size for files
> (when you simply create a file and do "du -sk" on the new file to Samba
> server)
> 
> Anyone know why this was set so high in Samba?
> 
> I would prefer a roundup value (if any) of 4K.

It was set high as Windows 2000 and above clients use this
allocation size to make local caching decisions and use
different read strategies. It is an optimisation to make
samba servers faster with Windows clients than Windows
server are :-). I have the email trail for the tests
someone did if you want to read it....

Jeremy.


More information about the samba-technical mailing list