Samba CPU Usage with large directories ...

Green, Paul Paul.Green at
Thu Dec 19 15:13:00 GMT 2002

Scott Taylor [mailto:scottt at] wrote:

> We have a samba server running version 2.2.5 on kernel 2.4.18 with the SGI
XFS patch.
> The shared volume consists of an XFS partition on a 3-ware raid5
controller. The
> network connection is via a 4 port bonded pipe to the switch.

> We notice that the samba CPU usage during write operations increases
> once a directory contains more than a certian number of files - thought to
> somewhere around the 1500 to 2000 mark.

> We have tried allowing samba more memory, which did not seem to help - and
> had little or no success finding any information on the web, hence this

My guess (and that's all it is) is that this is an operating system issue. I
presume you are using Linux 2.4.18 although you didn't say.  Try writing a
small C benchmark program that just does straight fopen/fread/frwrite/fclose
operations, and time them, and see how you fare.  I'll bet you find that the
system calls (esp. the open call) take a lot longer on the big directories.

Make sure your benchmark program uses the same file naming conventions as
your real code, in case the problem has something to do with the efficiency
of hashing or searching the specific names.

Paul Green, Senior Technical Consultant, Stratus Technologies.
Day: +1 978-461-7557; FAX: +1 978-461-3610
Speaking from Stratus not for Stratus

More information about the samba-technical mailing list