[Samba] Slow file listing : Debian Wheezy, Samba Version 3.6.6

Jeremy Allison jra at samba.org
Wed Mar 2 00:41:09 UTC 2016

On Tue, Mar 01, 2016 at 09:48:56AM +0000, J Martin Rushton wrote:
> Hi,
> I have come across something similar.  We had a large directory
> (several 10s of thousand files) stored on a large Linux box which
> was migrated to a faster, but smaller memory (256 GiB -> 12 GiB)
> box.  The Windows users recorded unacceptable access times and
> ultimately we had to:
> 1) Break the large directory into several smaller ones, and
> 2) Move to a larger memory (128 Gib) machine.
> What was happens is that Windows insists on opening each file to
> generate its thumbnail.  It does this one file at a time, so simply
> clicking on the directory in WE leads to (open, read, close )*number
> of files.  With a large memory the files will quite quickly be
> cached by the server, but with a smaller machine they are being
> fetched from disk.

Large directories are painful in Samba unless you're using
a case-insensitive filesystem and have configured Samba
that way. It's the cache misses that kill us - when we
get ENOEN back we don't know if it was the file not there,
or there under another case - so we have to scan the whole

See this:


for details.

More information about the samba mailing list