libsmbclient read chunk size

Kevin Mitchell kevmitch at
Mon Feb 17 02:12:40 MST 2014

I've been looking at the native smb:// url feature in mpv-player [1] (an
mplayer fork), which uses libsmbclient. I have compiled my version of mpv
against libsmbclient-dev=2:4.1.4+dfsg-3 debian package.


I measured the throughput as a function of the size of the buffer handed to
each invocation of smbc_read while mpv fills it's cache with a large file
hosted on a Windows 7 64 bit machine. I find that with a modest buffer size
on the order of a kernel page size (4K), I don't get the full performance
that I expect from my network (e.g. as compared to scp,and iperf). However,
the smb throughput increases significantly as the buffer size is increased
up to about 128K where it begins to level off [2], although prerformance
continues to improve up to 1MB. These results are consistent between both
wireless(11n) and wired Ethernet(gigabit).


I have also performed some less scientific tests using the simpler
testread.c example program supplied with smbclient which essentially
confirm these results.

For comparison, I took a look also at smbnetfs, which apparently uses a
read chunk size of 128K and gets reasonable network performance.

My question is if there is some known magic property of the 128K read
chunk. My second question is whether such a large read chunk (32 kernel
pages) is considered normal for using with libsmbclient.


More information about the samba-technical mailing list