SMB Performance Tuning


Recommended Posts


At the moment I try to enable SMB Multichannel when my Client has 10G LAN and my server has two 1G LAN ports. What I tried:


Enabled Multichannel and added speed capabilities per adapter/ip:



Checked on the client if both IPs have been found and selected for Multichannel:



But finally it does not work as eth1 is not used:




Then I reminded that it is not possible to mix RSS and non-RSS scenarios:


Sample Configurations that do not use SMB Multichannel

The following are sample network configurations that do not use SMB Multichannel:

  • Single non-RSS-capable network adapters. This configuration would not benefit from multiple network connections, so SMB Multichannel is not used.
  • Network adapters of different speeds. SMB Multichannel will choose to use the faster network adapter. Only network interfaces of same type (RDMA, RSS or none) and speed will be used simultaneously by SMB Multichannel, so the slower adapter will be idle.


So the first step was to disable RSS on the clients adapter:



But still no activity on eth1:



Then I did:

- disabled IPv6 on the server and on the client

- rebooted server and client


And now it works:



Was it because of disabling RSS? No, after re-enabling IPv6 and rebooting, it does not work anymore:



As you can see "thoth" resolves to an IPv6 address. I tried to copy to both IPv4 addresses of the server, but it does not enable SMB Multichannel:





This is strange as for both IPs both target server adapters were found:



Maybe SMB multichannel works only for SMB server names? Let's try it out by adding "tower" as a new server name for .8:



again no success after copying to "tower":



Next step was to disable IPv6 in the network adapter properties:



Even rebooting the client does not help... 


I did a little bit research and on this blog I found someone who gets IPv6 addresses if he executes Get-SmbMultichannelConnection:



So I think my problem is that this command returns in my case only IPv4 addresses even if the clients network adapter has IPv6 enabled. But why 🤔


The smb service on Unraid listens to IPv6:

netstat -lnp | grep smb
tcp        0      0   *               LISTEN      30644/smbd          
tcp        0      0   *               LISTEN      30644/smbd          
tcp6       0      0 :::139                  :::*                    LISTEN      30644/smbd          
tcp6       0      0 :::445                  :::*                    LISTEN      30644/smbd


And the client resolves with "ping" the smb server name with an IPv6 address, too....


Just for fun I added the IPv6 addresses to the smb conf:

interfaces = "fd00::b62e:99ff:fea8:c72c;speed=1000000000" "fd00::b62e:99ff:fea8:c72a;speed=1000000000" ";speed=1000000000" ";speed=1000000000"


SMB listens now only to these specific IPs:

netstat -lnp --wide | grep smb
tcp        0      0*               LISTEN      24774/smbd          
tcp        0      0*               LISTEN      24774/smbd          
tcp        0      0*               LISTEN      24774/smbd          
tcp        0      0*               LISTEN      24774/smbd          
tcp6       0      0 fd00::b62e:99ff:fea8:c72a:139 :::*                    LISTEN      24774/smbd          
tcp6       0      0 fd00::b62e:99ff:fea8:c72c:139 :::*                    LISTEN      24774/smbd          
tcp6       0      0 fd00::b62e:99ff:fea8:c72a:445 :::*                    LISTEN      24774/smbd          
tcp6       0      0 fd00::b62e:99ff:fea8:c72c:445 :::*                    LISTEN      24774/smbd


And ironically the Windows client now reaches the server through one (?!) IPv6:


Server Name Selected Client IP                             Server IP                 Client Interface Index Server Interface Index Client RSS Capable Client RDMA Capable
----------- -------- ---------                             ---------                 ---------------------- ---------------------- ------------------ -------------------
THOTH       True                           13                     11                     False              False
THOTH       True     2003:e0:a71d:5700:e988:c813:e0d4:a16a fd00::b62e:99ff:fea8:c72c 13                     12                     False              False


But transfer speed is still capped to one....


Next try. Disable IPv6 on the client, force SMB to listen only to IPv4, set as the IP of "THOTH" through the windows hosts file and reboot the client, but still no success 🙈

# SMB Conf:
interfaces = ";speed=1000000000" ";speed=1000000000"
bind interfaces only = yes
netstat -lnp --wide | grep smb
tcp        0      0*               LISTEN      31758/smbd          
tcp        0      0*               LISTEN      31758/smbd          
tcp        0      0*               LISTEN      31758/smbd          
tcp        0      0*               LISTEN      31758/smbd


So do it reverse. This time IPv6 is enabled on the client, but server gets IPv6 fully disabled...



Not sure if this is important, but the server resolves to the second ethernet port. Don't know why:



Server and client reboot... does not work.


... after several additional tests I found out, that it is unreliable. For example if I disable IPv6 only in the router and reboot the client, then SMB Multichannel works. But only for several minutes?! Then it fails again.


Next test is to disable IPv4 in the router and reboot all devices incl switches. Maybe thats the reason?!

Link to comment
  • 3 weeks later...

In the last "All things Unraid" there was this Blog Thread:

Basically the sum up of your start post ;-)

BUT two more arguments have been added to smb-extra "aio read size" and "aio write size"

As i had no clue what that meant i asked my pal Google and found at a detailed explanation (you also have this link in your post

Besides the fact that (if i understand it right) "aio write size" and "aio read size" should be already "1" on default i also found "aio max threads" which description sounds interesting.

But you wrote none of the other arguments had any noticable effect on speed. So you tested thatspecific argument as well?

Multihreaded Samba should give, in theory, a big performance boost - for weak single core perfomance CPUs at least. Also couldn't find any hints which Samba version might be required for this.

Link to comment
2 minutes ago, jj1987 said:

But you wrote none of the other arguments had any noticable effect on speed. So you tested thatspecific argument as well?


Yes, I tested everything and the only difference I found was "aio write size" must be enabled and "write cache size" should be not zero. But write cache size has been already removed in Samba 4.12 because io_uring became the default:


PS Unraid 6.9.2 uses already Samba 4.12.14


8 minutes ago, jj1987 said:

"aio write size" and "aio read size" should be already "1" on default



And another important change with Samba 4.13 is the auto detection of RSS. So maybe since Unraid 6.10 we don't need this line anymore:

interfaces = ";capability=RSS,speed=10000000000"


So finally we only need to enable SMB Multichannel and everything should be perfectly running.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.