5

Are there registry settings or other settings available to tune Windows networking (SMB/CIFS) performance?

I'm trying to get maximum throughput for large file copy operations but any settings would be interesting.

So far:

TCP Settings

  • Adjust MTU
  • Enable TCP Window Scaling (RFC 1323). Details here.
  • Allow ports above 5000. Details here.


Other Factors

  • SMB2 has performance advantages over SMB. Details here and here.


General Resources

Luke Quinane
  • 717
  • 1
  • 9
  • 20
  • In my experience, for maximum throughput on a SMB share, you need to copy multi-threaded, using a tool like RoboCopy. For example: with a shared USB drive, a single thread might get 5MB/s but multithread might get as high as 20MB/s. – djangofan Jun 14 '12 at 16:29
  • NetApp Data Ontap Operating System uses its own oplocks or Opportunistic so handle Windows smb 1.0/2.0 timeouts. Great Post. –  Nov 29 '10 at 03:39

7 Answers7

5

What is the OS of your client and server? One thing that can make a difference is to update your servers to windows 2008 and your clients to Vista. When you do this you get to take advantage of SMB2 which is less chatty, has larger buffers, and can do multiple things in a single request making it less sensitive to latency.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
4

Start by enabling TCP Window Scaling (RFC 1323). Here is an excellent article explaining how to do it and what it does.

While you're at it, you will probably want to adjust your TCP Window size. The proper size is calculated based on your specific network conditions. I don't have much experience with this, but there are various calculators and/or tutorials you can google for.

Ryan Bolger
  • 16,472
  • 3
  • 40
  • 59
  • Do you know what the default for that setting is under Server 2003 or Server 2008? – Luke Quinane May 05 '09 at 01:13
  • 1
    In Server 2003/XP, the Tcp1323Opts value doesn't exist by default which means it's effectively 0 I think. In Server 2008/Vista, I could've sworn the default was at least 1, but I'm looking at one of my fresh machines right now and it's not there. – Ryan Bolger May 05 '09 at 21:47
3

From the "Performance Tuning Guidelines for Windows Server 2008":

Server Options

TreatHostAsStableStorage

HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\(REG_DWORD)

The default is 0. This parameter disables the processing of write flush commands from clients. If the value of this entry is 1, the server performance and client latency for power-protected servers can improve. Workloads that resemble the NetBench file server benchmark benefit from this behavior.


AsynchronousCredits

HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\(REG_DWORD)

The default is 512. This parameter limits the number of concurrent “asynchronous” SMB commands that are allowed on a single connection. Some file clients such as IIS servers require a large amount of concurrency, with file change notification requests in particular. The value of this entry can be increased to support these clients.


Smb2CreditsMin and Smb2CreditsMax

HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\(REG_DWORD)

The defaults are 64 and 1024, respectively. These parameters allow the server to throttle client operation concurrency dynamically within the specified boundaries. Some clients might achieve increased throughput with higher concurrency limits. One example is file copy over high-bandwidth, high-latency links.


AdditionalCriticalWorkerThreads

HKLM\System\CurrentControlSet\Control\Session Manager\Executive\(REG_DWORD)

The default is 0, which means that no additional critical kernel worker threads are added to the default number. This value affects the number of threads that the file system cache uses for read-ahead and write-behind requests. Raising this value can allow for more queued I/O in the storage subsystem and can improve I/O performance, particularly on systems with many processors and powerful storage hardware.

Client

DisableBandwidthThrottling

HKLM\system\CurrentControlSet\Services\lanmanworkstation\parameters\(REG_DWORD)

The default is 0. This setting is available starting with Windows Server 2008 SP2. By default, the SMB redirector throttles throughput across high-latency network connections in some cases to avoid network-related timeouts. Setting this registry value to 1 disables this throttling, enabling higher file transfer throughput over high-latency network connections.

Luke Quinane
  • 717
  • 1
  • 9
  • 20
2

Not Windows specific, but if you're running gigabit ethernet, you might want to consider increasing the Maximum Transmission Unit (MTU). From the default of 1492 to a maximum of 9000. This reduces the overhead required since less fragments would be required for transmitting the same file.

sheepbrew
  • 227
  • 2
  • 3
2

If you are using SMB3 protocol, you can improve the performance by a) adding multiple network cards on the server-side and enable SMB3 multi-channel feature b) If you add multiple network cards on the client side, receive-side scaling feature of SMB3 will improve the performance c) You can also use SMB Direct option if you have RDMA cards.

athena
  • 71
  • 2
1

If your limit is at least 1MByte/s then the SMB Bandwidth Limits feature introduced with Windows Server 2012 R2 is a built-in option.

Enable SMB Bandwidth Limits via Powershell

Add-WindowsFeature FS-SMBBW
Set-SmbBandwidthLimit –Category Default -BytesPerSecond 1MB
mbx
  • 455
  • 9
  • 21
0

From TechNet:

MaxUserPort

HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\(REG_DWORD)

Default: 5000
Range: 5,000–65,534 (port number)

Specifies the highest port number that TCP can assign when an application requests an available user port from the system. Typically, ephemeral ports (those used briefly) are allocated to port numbers 1024 through 5000.

Luke Quinane
  • 717
  • 1
  • 9
  • 20