[Samba] samba performance when writing lots of small files

thoralf schulze t.schulze at tu-berlin.de
Wed Sep 25 14:37:10 UTC 2019

hi there,

running a simple test like

time for s in $(seq 0 9999); do echo hello > world-$s; done

takes a little more than a minute on a locally mounted test share on our
samba server. the same test finishes in about 5 seconds when it is run
on the server's file system, without samba.

i understand that dealing with many small files isn't exactly the sweet
spot of any (networked) file system. however, more than one order of
magnitude seems a little much …

the samba version is 4.7 from ubuntu bionic running in a clustered
environment with two servers. the underlying file system is a cephfs, so
server-side os caches _should_ not intervene in both test cases - fwiw,
running sync immediately after the file system only-test returned at once.

googling around, we already tuned the server like this:

        kernel change notify = no
        change notify = no
        read raw = Yes
        write raw = Yes
        aio read size = 1
        aio write size = 1

and also enabled the aio_pthread vfs module. we found that seemingly
relevant client-side options (cache=loose,fsc) made hardly any
difference. during both tests, the server was mostly idling.

do you have any recommendations on how to further improve sambas write
performance for this use case?

thank you very much & with kind regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba/attachments/20190925/6e842029/signature.sig>

More information about the samba mailing list