Transfer rate when accessing Samba share from Mac OS X

I use my Cubietruck as a Samba server. Some day I noticed the transfer rate when copying files from my Mac with OS X El Captian was only around 10 MB/s. As the Cubietruck has a gigabit ethernet port the transfer rate should be much higher. I also remembered the transfer rate to be around 30 MB/s in the past. Not as fast as gigabit can deliver but I guess CPU load is a factor here.

After some research on the internet I found a configuration which got me back to ca. 30 MB/s. OS X uses SMB Signing since Mac OS X 10.11.5 by default. You can view the Samba version and options currently used for connected shares with the tool smbutil:

Mini:~ johannes$ smbutil statshares -a

==================================================================================================
SHARE                         ATTRIBUTE TYPE                VALUE
==================================================================================================
media
                              SERVER_NAME                   cubie
                              USER_ID                       502
                              SMB_NEGOTIATE                 AUTO_NEGOTIATE
                              SMB_VERSION                   SMB_3.0
                              SMB_SHARE_TYPE                DISK
                              SIGNING_SUPPORTED             TRUE
                              EXTENDED_SECURITY_SUPPORTED   TRUE
                              LARGE_FILE_SUPPORTED          TRUE
                              CLIENT_REQUIRES_SIGNING       TRUE
                              FILE_IDS_SUPPORTED            TRUE
                              DFS_SUPPORTED                 TRUE
                              MULTI_CREDIT_SUPPORTED        TRUE
                              ENCRYPTION_SUPPORTED          TRUE
                              SIGNING_ON                    TRUE

--------------------------------------------------------------------------------------------------

The line “SIGNING_ON TRUE” indicates that SMB Signing is used. You can change this setting in the file ~/Library/Preferences/nsmb.conf:

Mini:~ johannes$ echo "[default]" >> ~/Library/Preferences/nsmb.conf; echo "signing_required=no" >> ~/Library/Preferences/nsmb.conf
Mini:~ johannes$ cat ~/Library/Preferences/nsmb.conf
[default]
signing_required=no

After restarting your Mac or disconnecting all shares and reconnecting afterwards SMB Signing should be deactivated (SIGNING_ON is no longer shown):

Mini:~ johannes$ smbutil statshares -a

==================================================================================================
SHARE                         ATTRIBUTE TYPE                VALUE
==================================================================================================
media
                              SERVER_NAME                   cubie
                              USER_ID                       502
                              SMB_NEGOTIATE                 AUTO_NEGOTIATE
                              SMB_VERSION                   SMB_3.0
                              SMB_SHARE_TYPE                DISK
                              SIGNING_SUPPORTED             TRUE
                              EXTENDED_SECURITY_SUPPORTED   TRUE
                              LARGE_FILE_SUPPORTED          TRUE
                              FILE_IDS_SUPPORTED            TRUE
                              DFS_SUPPORTED                 TRUE
                              MULTI_CREDIT_SUPPORTED        TRUE
                              ENCRYPTION_SUPPORTED          TRUE

--------------------------------------------------------------------------------------------------

To get back to the original configuration you can just delete the file ~/Library/Preferences/nsmb.conf.

As an alternative to deactivating SMB Signing globally in ~/Library/Preferences/nsmb.conf you can also connect your share with cifs://hostname instead of smb://hostname. This way Samba version 1 without SMB Signing is used:

Mini:~ johannes$ smbutil statshares -a

==================================================================================================
SHARE                         ATTRIBUTE TYPE                VALUE
==================================================================================================
pyload
                              SERVER_NAME                   cubie
                              USER_ID                       502
                              SMB_NEGOTIATE                 SMBV_NEG_SMB1_ONLY
                              SMB_VERSION                   SMB_1
                              SMB_SHARE_TYPE                UNKNOWN
                              EXTENDED_SECURITY_SUPPORTED   TRUE
                              UNIX_SUPPORT                  TRUE
                              LARGE_FILE_SUPPORTED          TRUE
                              CLIENT_REQUIRES_SIGNING       TRUE

--------------------------------------------------------------------------------------------------