[Samba] Samba Transfer Efficiency (undocumented perf hint for Win7 gives 10X write speeds)

Linda W samba at tlinx.org
Sun Jun 20 18:26:32 MDT 2010

I can share what I have, but won't claim they are optimal for
everyone.  For win7, they give near theoretical performance on
writes (with win7 tuned correctly as well). 

Will only mention a few pertinent items.  Standard
disclaimers concerning your software, work load and hardware 
all need to be considered when evaluating params.

Biggest thing is in reserving enough memory.

I just remeasured linear performance -- using a single task, using 
'dd' to/from a server file of 1 or 4GB in size.

I also figured out my Win7 performance was way below par -- and
tried a WinXP performance improvement on it -- and had it work --
even though it's widely said around the net to no longer work in
Vista or above.

First the linux params, then the other params.

(same methods may work for ipv6, but haven't tested them)
Comparing my distro's defaults to my modified values:

*(don't know if this is important, as I don't think
congestion enters into play in my setup, but:) 

  tcp_allowed_congestion_control=cubic reno
  tcp_available_congestion_control=cubic reno
  tcp_allowed_congestion_control=htcp reno
  tcp_available_congestion_control=htcp reno scalable

Then memory for tcp:
  tcp_mem: 47136 62848 95272
  tcp rmem 4096 87380 2011136
  tcp wmem 4096 87380 2011136
  tcp_mem 2097152 8338608 268435456
  tcp_rmem 1048576 4194304 134217728
  tcp_wmem 1048576 4194304 134217728

Also, in /etc/samba/smb.conf:
 socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=4194304 SO_RCVBUF=4194304
(also, not sure if they are as important, but also use:)
aio read size=65536
aio write size=65536
min recievefile size=65536
max xmit=66576

On my clients, under the HKLM/currentcontrolset, under

TcpIp/Parameters I have (both DWORDS): 
  GlobalMaxTcpWindowSize 1048576

AND I have those same two DWORDS under my active "Interface" 
key (under Parameters).   I looked for the one that corresponded 
to my client's active interface.


In writing up these params I did some benchmark testings.

Win7 (without the TCPMaxWindowSize) changes in the registry), 
gave 10MB/s reads and 12MB/s writes.

WinXP (didn't already had those changes) came in at
35MB/s reads and 73MB/s writes.

Putting in the MaxWinSize words in my Win7 registry (though
several places around the net claim this param was no longer
used, from Vista on), gives:
70MB/s reads
108MB/s writes.

Note -- these are measured not just in terms of the execution
time of 'dd', but also looking at "xosview" running (actually 
running remotely over X -- i.e. using up some of that file
transfer bandwidth!).  I.e. Xosview showed 108MB/s when I measured
108MB/s in 'dd'.  So it wasn't a related to cache timings.

Am glad you posted your question, as I wouldn't have experimented
with the TCPMaxWinSize -- as every place I looked claimed that param
was no longer used from Vista on -- so I had not previously tried it
(being gullible enough to believe all the sites that claimed it was
no longer supported.  C'est la vi!).

Hope this helps,

More information about the samba mailing list