Fwd: Help Needed: Samba share slow to query not existing files

Jônatas Hudler jonatashudler at gmail.com
Wed Jan 20 17:37:45 UTC 2021


Hello everyone,

*(First mail in this mailing list, so take it easy if I'm infringing any
good manners here)*

In a samba share we have a directory with lots of files - binaries and
resources to run our ERP application (around 20K entries).

The application is taking too long to load. The found reason is that the
application tries to load several files in a trial/error fashion, looking
for extensions in a particular order (e.g: file.dll, file.lbr, file.gnt,
file.int). Many of these files are not required and doesn't even exist.

Every "not found" hit take ~0.2 seconds. And there are lots of these events.

The thing is that apparently samba is not caching this result. My guess is
that every new not existing file open request causes a full directory's
entries lookup.

If I run this code (in a Windows Command Prompt) in this samba share, it
takes considerable time, whereas in a native Windows share it is
instantaneous.

  for /L %i in (1,1,50) do @dir \\server\share\not_existing.txt >nul

Anything that can be done?
------------------------------

Current smb.conf content:

# Global parameters
[global]
    netbios name = ***omitted***
    realm = ***omitted***
    server role = active directory domain controller
    workgroup = ***omitted***
    idmap_ldb:use rfc2307  = yes
    dns forwarder = ***omitted***
    vfs objects = acl_xattr
    map acl inherit = yes
    store dos attributes = yes
    #
    aio read size = 1
    aio write size = 1
    aio write behind = true
    socket options = TCP_NODELAY SO_RCVBUF=65535 SO_SNDBUF=65535
    read raw = yes
    write raw = yes
    max xmit = 65535
    dead time = 0
    getwd cache = no
    max connections = 5000
    time server = yes

------------------------------

Environment Details:

   - CentOS Linux release 7.6.1810 (Core)
   - Samba version 4.8.3
   - Application Runtime: Microfocus NetExpress (Cobol) v3.1


PS: This question was originally posted in the Server Fault website and can
be reached thru this link: Samba: Slow to query not existing files - Server
Fault
<https://serverfault.com/questions/1050543/samba-slow-to-query-not-existing-files>

Thank you in advance for all the support!

Jonatas Hudler


More information about the samba-technical mailing list