[Samba] massive performance problems if transferring many small
files
Steffen Kauka
steffen.k at gmx.at
Wed Feb 11 08:29:47 GMT 2004
> > > Are all/many of these files in the same directory?
> >
> > Yes, it's a flat directory hierarchy.
>
> Because unix is case sensitive, and windows is not, this is almost a
> pathalogical case for Samba.
>
> Samba must scan the *entire* directory, to see if there is a matching
> file (of potentially different case), so it can say 'sorry, file by that
> name already'. Naturally, this isn't exactly fast as you approach 27000
> files...
>
> > > I would suggest that Samba 3.0 might handle this situation better, or
> > > in 2.2 set 'mangle method = hash2'.
> >
> > I'll try it....
>
> The hash2 method is not only much faster, it has a much lower collision
> rate. This helps if for some reason, the 8.3 names are being used.
> If you can put the files into a hierarchy, then things will be *much*
> better. Or, for this copy only, you might want to turn 'case sensitive
> = yes' on in your smb.conf - however the implications of that are nasty
> for normal windows operations (and perhaps even the copy, depending on
> what you use).
You did suggest to try Samba 3 - I did it. My test environment consists of a
PC (Pentium 4 2.4 GHz CPU and 512 MB RAM), a SUN Blade 100 (500 MHz CPU, 256
MB RAM) and between both a switched network at a speed of 100 MBit/s. The
smb.conf is the same as I mentioned in my initially posting. Unfortunately I
couldn't recognize any significant difference between Samba 2.2.8a and Samba
3.0.1 :-( Now the good news! If I change the option 'preserve case' to 'yes'
the transfer rate increases by about 550% and that's really ok. I don't expect
any problems in this case because the source data I want to transfer are
lower case at all and UNIX-like. What do you mean with nasty implications? At
the moment I can't imagine a case.
More information about the samba
mailing list