[Samba] Directory with large number of files

paul.r.schenk at accenture.com paul.r.schenk at accenture.com
Fri Jul 12 20:24:33 GMT 2002

Hello all,

I am trying to use Samba to replace an NT server that serves a directory
with over 600,000 (yes over 1/2 million) files, with little success. As far
as I can tell this is what is happening:

Samba receives a request to open a file (say 12345678.doc), to find this
file it spins through the directory, comparing file names and seeing if
each file matches (doing an exact match and an 8.3 mangle if needed). Given
the large number of files, this takes lots of CPU and gives pretty bad
performance (NT can serve up a file from this directory in under 5 seconds,
Samba on my HP-UX D380/2 takes close to 2 minutes to present the same
file). This seems to be initiated in the trans2.c code.

My question is: Is there any way to have Samba just attempt to open the
file asked for, and if it's there to respond to the request and forget
about other possible 8.3 matches? (My files all match the 8.3 rules, as
this collection has existed since Win 3.1 on a Novell server and there will
never be long filenames in this particular share).

I've tried all sorts of things with mangling options and dont descend etc.,
with no luck. 'dont descend' makes it so explorer sees the directory as
empty, but opening any of the files (the names are looked up in a database)
causes samba to loop through the directory anyway.

If there's no config settings to stop this, I'm going to have to hack the
code. Has anybody else solved this problem?

Thanks in advance

This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information.  If you have
received it in error, please notify the sender immediately and delete the
original.  Any other use of the email by you is prohibited.

More information about the samba mailing list