What's new

Samba share speed fix?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

NeoDragon

Occasional Visitor
I've been playing around with my Samba share today to try and get a bit more speed out of transfers between Windows 7 users and the Samba share.

First off, here's the hardware/setup:
RT-AC56U
WD Mybook 3tb USB3 Drive
Windows 7 desktop

Before doing anything to it , using mostly default settings, writing speeds were hovering between 10-14 MB/s.
After a bit of reading and google, I've tried adding "socket options = TCP_NODELAY" to the smb.conf via /jffs/configs/smb.conf
Writing Speeds went up between 30-40 MB/s !!

Here's something I've read coming straight from samba.org:
The socket option TCP_NODELAY is the one that seems to make the biggest single difference for most networks. Many people report that adding socket options = TCP_NODELAY doubles the read performance of a Samba drive. The best explanation I have seen for this is that the Microsoft TCP/IP stack is slow in sending TCP ACKs.

Would it be possible to add this quick fix to the next FW release?

Edit: Here's the "quick fix" I made for myself following the comments down below
Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh
pc_insert "wide links = no" "socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=131072 SO_SNDBUF=131072" $CONFIG
Save as smb.postconf under /jffs/scripts

chmod a+rx /jffs/scripts/*

Voila!
 
Last edited:
Last edited:
Well I did add it myself already ( not with postconf tho ), I was simply thinking about other users not knowing about this.
 
Well I did add it myself already ( not with postconf tho ), I was simply thinking about other users not knowing about this.
You have to add it via smb.postconf or smb.conf.add (smb.postconf recommended to make sure it's added in the correct section of smb.conf - use pc_insert). The smb.conf file is regenerated at every boot, and if you edited that file directly, you'll lose the change on a reboot (or some other events that can cause samba to be restarted).
 
Before doing anything to it , using mostly default settings, writing speeds were hovering between 10-14 MB/s.
After a bit of reading and google, I've tried adding "socket options = TCP_NODELAY" to the smb.conf via /jffs/configs/smb.conf
Writing Speeds went up between 30-40 MB/s !!

It can help, but it can also lead to file corruption, which is why most default Samba installs don't include this option - depends on the SMB client implementation...
 
Windows 7 desktop

the simple answer here is upgrade it to win 10 and see the difference , looks like they have done something in win 10 to address this as im now getting 110 MB/s throughput read wise over a 3 x 3 wireless AC 5 gig connection

WD Mybook 3tb USB3 Drive
where is that connected as usb 3 throughput isnt the best on most routers

see

http://www.smallnetbuilder.com/wire...1200-gigabit-router-reviewed?showall=&start=1

storage performance

its got some weird issue with fat32

and the ntfs speeds are just average and thats over ethernet
 
where is that connected as usb 3 throughput isnt the best on most routers
Care to elaborate? Should I switch it to the usb2 port????

My drive is format ext4, not fat32 or ntfs.

It can help, but it can also lead to file corruption, which is why most default Samba installs don't include this option - depends on the SMB client implementation...
I'd like to know more? What causes the file corruption??

I'd prefer to stay on Windows 7 for the moment. What did they change to make your throughput go 110MB/s??
 
What did they change to make your throughput go 110MB/s??

in my case it was upgrading windows , its obvious the new windows handles throughput far better , have no idea why but it just does , previously on win 8 my testing was 50 - 60 MB/s read speeds over wifi max , now 110MB/s read speeds are the norm
Care to elaborate? Should I switch it to the usb2 port????

it would be better connected to a comp than the router and shared through the comp , usb sharing over the router taxes the cpu and makes it work harder
 
Well, it's connected to the router because it's serving for samba+transmission+minidlna. So far it's been doing a very decent job too, but the samba share was not giving me a decent usb3 speed.
 
Its enabled already

Code:
[global]
unix charset = UTF8
display charset = UTF8
log file = /var/log.samba
log level = 0
max log size = 5
security = USER
guest ok = no
map to guest = Bad User
encrypt passwords = yes
pam password change = no
null passwords = yes
max protocol = NT1
passdb backend = smbpasswd
smb encrypt = disabled
smb passwd file = /etc/samba/smbpasswd
force directory mode = 0777
force create mode = 0777
max connections = 5
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=131072 SO_SNDBUF=131072
obey pam restrictions = no
use spnego = no
client use spnego = no
disable spoolss = yes
host msdfs = no
strict allocate = No
bind interfaces only = yes
interfaces = br0 192.168.0.1/255.255.255.0
use sendfile = yes
map archive = no
map hidden = no
map read only = no
map system = no
store dos attributes = yes
dos filemode = yes
oplocks = yes
level2 oplocks = yes
kernel oplocks = no
wide links = no
 
For some reason, Asus only adds it for SDK7.14 (AC88/AC3100/AC5300) and for older MIPS devices (N66/AC66). I suspect it's actually a bug, and they intend the MIPS version to also apply to the pre-SDK7 ARM. Code follows:

Code:
#ifdef RTCONFIG_BCMARM
#ifdef RTCONFIG_BCM_7114
                fprintf(fp, "socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=131072 SO_SNDBUF=131072\n");
#endif
#else
                fprintf(fp, "socket options = TCP_NODELAY SO_KEEPALIVE SO_RCVBUF=65536 SO_SNDBUF=65536\n");
#endif

I will have to look back to last year's code to see what it used to be before SDK7 got added into the mix.
 
Has anyone got Tuxera smbd to work (or already working as default on some model)?

Would be interesting to see a benchmark between Tuxera vs the vanilla samba.

Perhaps these options work flawlessly with Tuxera smbd..
 
Has anyone got Tuxera smbd to work (or already working as default on some model)?

Would be interesting to see a benchmark between Tuxera vs the vanilla samba.

Perhaps these options work flawlessly with Tuxera smbd..

Last time I tested it, it was giving me worse performance than vanilla 3.0.25b, which surprised the person at Tuxera with whom I was in contact back then (granted, this was still a beta build back then).

I haven't retested it yet since Asus started offering it as an option.
 
One thing I don't like is the fact that it's still based on a prehistoric version (3.0.25b). I use 3.6.25 in my firmware.
 
http://www.tuxera.com/products/tuxera-smb/

According to Tuxera, it supports SMBv3 which indicates a much more recent version of samba...but who knows what they meant.

They probably build it based on the specs provided by their customer. So since Asus uses 3.0.25b, they provide a build based on 3.0.25b as well, to ensure 100% compatibility with the configs generated by the firmware.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top