[Samba] Small file performance

L.P.H. van Belle belle at bazuin.nl
Mon Jan 9 23:48:10 UTC 2017

hai john, 

what is the preformance when you copy between the windows computers make sure you test hdd-hdd or sdd-sdd disk.

to my experience copien lots of small files is always much lower. 

i get same results as you. 
small files copy pc-server is around 3.5-4mb/s, 1 large file i get 110-114mb/s.
without changing the default in smb.conf.
tested on samba 4.5.3 debian 8 and 4.2.14 sernet samba ubuntu 14.04

why this is exacly is hard for me to explain in english. 
maybe someone can.

pointers are. 
sector block size of the partiton.

for example
standard block size 4k, large file copy max 85-90mb/s for me.
but with 4mb block size i get the max bandwith as write speed (1gbit) 110-114 mb/s

and harddisk iops. 
hdd gets maybe 200-1000 iops.
ssd 50.000+ 

so optimizing block size per partiton can help a lot. 

last, make sure you partions are aligned with the block size of the disk.
if you have an advanced format drive an the first sector is not aligned you can loose 20-30% in write speed.

hope that helps a bit for you. at least some things to checkout.



> Op 9 jan. 2017 om 22:26 heeft John Gardeniers via samba <samba at lists.samba.org> het volgende geschreven:
> Hi Volker,
> Thanks for the response. The clients are Win 7, Win 10 and various 
> flavours of Linux, with Samba client versions ranging from 3.6 to 4.5.3. 
> There is no perceptible difference between any of them.
> Network latency is never above 0.2s and mostly sits at around 0.1s. If 
> that's a problem it is so only for Samba.
> I did as you suggested with the smb options but that just made it worse. 
> Using the same test environment and file set, the final speed dropped 
> from average of around 3.5MB/s to an average of about 3.0MB/s over a 
> series if test runs. Again, the OS, and therefore the client version, 
> made no difference. I guess I won't be using those settings in production.
> regards,
> John
>> On 09/01/17 18:00, Volker Lendecke wrote:
>>> On Mon, Jan 09, 2017 at 09:39:31AM +1100, John Gardeniers via samba wrote:
>>> We are experiencing painfully slow performance when transferring many small
>>> files via Samba. We are currently running Samba 4.5.1, although based on my
>>> searches the version doesn't seem to make any difference and this is a long
>>> standing problem.
>> SMB performance critically depends on the client. What client are you
>> using?
>>> Based on my searches I've been playing around with a number of settings. The
>>> testbed right now has the following options added to the basic smb.conf:
>>>         socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=32768
>>> SO_SNDBUF=32768
>>>         read raw = yes
>>>         write raw = yes
>>>         strict locking = no
>>>         min receivefile size = 16384
>>>         use sendfile = yes
>>>         aio read size = 16384
>>>         aio write size = 16384
>>>         strict allocate = yes
>> Just get rid of all these options, in particular the socket options.
>> Replace them with
>> aio read size = 1
>> aio write size = 1
>> and that's it.
>> What't your network latency (ping time)? That's a lot more critical
>> than raw bandwidth.
>> Volker
>> ______________________________________________________________________
>> This email has been scanned by the Symantec Email Security.cloud service.
>> For more information please visit http://www.symanteccloud.com
>> ______________________________________________________________________
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba

More information about the samba mailing list