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!

Will we ever see samba 4.4+ for smb3/multipath and such

Not anytime soon. Someone would have to patch it for multicall binary support for starter, or else it would eat up 10-15 MB of flash space.
 
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.
Thank you Merlin for looking at this. It's not breaking anything, but it's not optimal either!
 
I checked the git history, and for some reason Asus never configured these parameters for ARM routers - only MIPS (and now ARM under SDK 7.14).

Could be because these were already the default values. In any case I will add the same parameters as the SDK 7.14 ones but with the smaller buffers (to account for the lower amount of memory on these older ARM models). We'll see if people start complaining about loss of performance with these.
 
Hello RMerlin, what about the RT-3200AC ? I understand it has the same RAM as the big brothers but is it not considered MIPs ? would it make sense to configure this router as candidate for the TCP_NODELAY but with big buffers ?
 
Hello RMerlin, what about the RT-3200AC ? I understand it has the same RAM as the big brothers but is it not considered MIPs ? would it make sense to configure this router as candidate for the TCP_NODELAY but with big buffers ?

The RT-AC3200 uses an ARM-based CPU.
 
OK. so the TCP_NODELAY is already implemented in the RT_AC3200, is this what you mean ?
 
I checked the git history, and for some reason Asus never configured these parameters for ARM routers - only MIPS (and now ARM under SDK 7.14).

Could be because these were already the default values. In any case I will add the same parameters as the SDK 7.14 ones but with the smaller buffers (to account for the lower amount of memory on these older ARM models). We'll see if people start complaining about loss of performance with these.
I'll be glad to test it out as much as you need! Thanks for taking the time to look into this Merlin !
 
I'll be glad to test it out as much as you need! Thanks for taking the time to look into this Merlin !

If you get the chance, could you post benchmark results with and without those settings, to compare the difference? Here is the exact settings I'll be using for the AC56/AC68/AC87/AC3200:

Code:
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=65536 SO_SNDBUF=65536
 
Yes Merlin, thanks a lot. I plan on doing some tests also for the AC3200. I Will post results here.
 
Without Fix
Code:
------------------------------------------------------------------------------
  ROBOCOPY  ::  Robust File Copy for Windows

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

  Started : Wed Apr 06 20:01:35 2016

  Source : d:\test\
  Dest : \\TRISTANIA\Media\

  Files : *.*

  Options : *.* /COPY:DAT /R:1000000 /W:30

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

  1  d:\test\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Downloads\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Music\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Music to organize\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Pictures\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Reorganized Music\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Videos\
100%  New File  1.8 g  test.mp4

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

  Total  Copied  Skipped  Mismatch  FAILED  Extras
  Dirs :  1  0  1  0  0  6
  Files :  1  1  0  0  0  0
  Bytes :  1.853 g  1.853 g  0  0  0  0
  Times :  0:00:58  0:00:58  0:00:00  0:00:00


  Speed :  33984146 Bytes/sec.
  Speed :  1944.588 MegaBytes/min.

  Ended : Wed Apr 06 20:02:34 2016

With Fix
Code:
------------------------------------------------------------------------------
  ROBOCOPY  ::  Robust File Copy for Windows

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

  Started : Wed Apr 06 19:55:11 2016

  Source : d:\test\
  Dest : \\TRISTANIA\Media\

  Files : *.*

  Options : *.* /COPY:DAT /R:1000000 /W:30

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

  1  d:\test\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Downloads\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Music\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Music to organize\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Pictures\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Reorganized Music\
  *EXTRA Dir  -1  \\TRISTANIA\Media\Videos\
100%  New File  1.8 g  test.mp4

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

  Total  Copied  Skipped  Mismatch  FAILED  Extras
  Dirs :  1  0  1  0  0  6
  Files :  1  1  0  0  0  0
  Bytes :  1.853 g  1.853 g  0  0  0  0
  Times :  0:01:58  0:01:58  0:00:00  0:00:00


  Speed :  16855042 Bytes/sec.
  Speed :  964.453 MegaBytes/min.

  Ended : Wed Apr 06 19:57:09 2016

I don't get the reason why it's faster without.....?!
 
That could be why Asus didn't configure these then. Sometimes, optimizations only work within a very specific usage scenarios. Also, some optimizations are more about latency than throughput.

It's possible that the default values used by Samba are more optimal for a low-power router.
 
Hi, well, I tested this recipe trough smb.postconf and I get almost exactly the same transfer speed with / without it (I implement the smb.postconf file in /jffs/scripts (w/execute rights) and reboot the rooter before measuring) with my rt-ac3200. In both cases close to 53MB/sec transfer speed w/4 big files of around 700MB. Is there any way to check that it has been correctly read ? where can the current smb.conf file be found?
 
Thanks. I could verify that the settings were effectively being used when re-enabling samba or rebooting ... and redid the tests. same story.. well, I could measure a very small improvement <2% (this time the throughput with the new parameters was slightly above 54MB/sec) that is not too significative. I also played with buffers (increased them to 500KB) but also no change in the measurements.
 
Somehow I can't reproduce the speed I was getting before going on this mission to improve the throughput of transfers... I find it odd, but at least speed has improved.
 
Somehow I can't reproduce the speed I was getting before going on this mission to improve the throughput of transfers... I find it odd, but at least speed has improved.

This would match my own experience, back when I was experimenting with Samba 3.6. I couldn't find any combination of socket options that would give any kind of measurable improvement. I suspect those tweaks only help when your bottleneck is the network. In our case, the bottleneck is the CPU, so the only way to optimize performance is to optimize CPU usage (and thus, I started compiling Samba with better compiler optimization).
 
Hello guys, new around here.

I have an SMB disk which tends to have an average write speed of 4MB/s.. :|
"top" shows smbd at 80%+ and really dunno why.
I've formatted the HDD with mkfs.ext3 but still the issue is the same.

I have latest AC66u (380.63_2). Any ideas?

Cheers
 
Via WLAN or cable?
Can you post your /etc/smb.conf?

Btw: As I've started with the AC56U about 2 years ago I've tested the speed difference between NTFS and EXT3 and didn't saw any special difference. The integrated 3rd party NTFS driver seems quite good.
 
admin@AsusRouter:/tmp/home/root# cat /etc/smb.conf
socket options = TCP_NODELAY
I have only this line there
 
Mh, quite small smb.conf :)
I'm using a complete customized smb.conf via the "custom config files" feature of the Merlin firmware.

If you want to try something you could try to add some parameters via the "Postconf scripts" feature ==> smb.postconf
https://github.com/RMerl/asuswrt-merlin/wiki/Custom-config-files

I remember that the following parameters had some impact regarding my performance. You could try to add these parameters via the "smb.postconf" file. After a restart of the router these parameters should be added to your config file.
Code:
smb encrypt = disabled
use spnego = no
client use spnego = no
disable spoolss = yes
strict allocate = no
strict locking = no
use sendfile = no
oplocks = yes
level2 oplocks = yes
kernel oplocks = yes

I have disabled your mentioned "socket options = TCP_NODELAY" option. But I don't know how you can disable it via the config file. Can you perhaps disable it in the WebGui?
You can check all available smb settings on this help page:
www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html

And are you using wirelass lan or cable?

Edit:
And did you already disable the option "Reducing USB3.0 interference"?
If not, please try this first.
 
Last edited:
  • Like
Reactions: Phk

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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