2013-05-13

Notes To Self: Attempting CIFS Performance Tuning

Problem: Abysmal SMB peformance when using W7 as intermediate between EON and FreeNAS: 19.6MB/s.
After Tuning: 25.8MB/s.
(After Turning Direct W7 -> FreeNAS = 42.1MB/s)

Wireshark Capture Filter:
host x.x.x.x and (port 139 or port 445)

Windows Registry:
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters\TreatHostAsStableStorage = 1
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters\SizReqBuf = 16384
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters\DisableLargeMtu = 0
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters\DisableBandwidthThrottling = 1
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters\FileInfoCacheEntriesMax = 65536
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters\DirectoryCacheEntriesMax = 4096
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\EnableWsd = 0
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Executive\AdditionalCriticalWorkerThreads = 2
FreeNAS Server:
  • Enable EA Support
  • Enable Send files with sendfile(2)
  • Enable AIO
  • Minimum AIO Read/Write Size: 16,384
  • Auxiliary Parameters: max protocol = smb2
FreeNAS Wishy-Washy-Me:
mount -uw /
vi /conf/base/etc/ttys
'on' to 'off' for all but first two. (Logic: board supports max of 8gb; need the extra memory for I/O.)
mount -ur /

To potentially dealing with:
re0: watchdog timeout
re0: link state changed to DOWN
re0: link state changed to UP
Be conservative with:
-rxcsum -txcsum -tso -lro -wol -vlanmtu -vlanhwtag -vlanhwfilter -vlanhwtso


Reference:
SMB Tuning for XenApp and File Servers on Windows Server 2008  - Wireshark screenshots, and settings applicable to more than just XenApp
SMB Block Size Negotiation When Copying Files
SMB/CIFS Performance Over WAN Links
Poor Samba Performance?
Performance Tuning Guidelines for Windows Server 2008 R2 (Has docx with descriptions, page 59 for smb2 start of relevance)
Optimizing Operating System Performance
AdditionalCriticalWorkerThreads Forum Thread
Improve FreeNAS SMB Performance
FreeNAS CIFS Page
ifconfig manpage
Potential Headache:
Bug 8726 - SMB2 protocol crashes smbd inconsistently without any reasons
FreeNAS irritation:
Realtek 8111F fails at high traffic 're0 Watchdog Timeout Error'

No comments: