CIFS/Samba very slow speeds with "mount -t cifs" but not smbclient.

Hi,

I’m getting very slow performance with a linux NAS mounted with CIFS to my local desktop. Oddly, the problem is only in one direction - file transfers from the desktop client to the NAS. Also, sending files with smbclient gives decent speeds both directions (>90MB/sec), so it’s something specific to the CIFS mount:
**Desktop->NAS == 8MB/sec
NAS->Desktop == 105MB/sec

**I’m using password authentication, if it makes any difference.

LAN is 1000Gbps switched, full duplex.

An NFS mount works fine.

I’m not too clear on the different standards, but it looks like CIFS is a variant of SMBFS? The ‘smbfs’ mount option has been removed, so I can’t see if it would work any better. Also, smbmount looks like a useful utility, but it’s been pulled from the repos…

Does anyone have any ideas?

notes:
I’ve tried various mount params without any luck:

  • cache mode to none
  • rsize and wsize to various sizes (from 4096 up to the large default)
  • configured the samba server to SMB2 protocol

NAS Samba: 3.6.25
NAS: Netgear RNDU6000 (latest firmware)
Desktop Samba: 4.2.4-33.1-3764-SUSE-SLE_12-x86_64
Desktop: SUSE Leap 42.1

A couple silly questions:

  1. Is it safe to assume you’re transferring one big file, vs. many little
    files? If not, could you?

  2. Have you tested with something that natively implements SMB (i.e. an
    interior, but alternative, operating system)? How do the results compare
    there when mapping a drive and copying files in each way?

  3. A LAN trace may be interesting. I would guess, since “downloading” is
    fast, that both options are using the same version of SMB, but maybe not.

  4. Have you compared with, or tried, openSUSE Leap 42.2? I also see
    something about SUSE-SLE_12 in your data; are you pulling data from SUSE
    Linux Enterprise (SLE) repositories too?


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.

Yep, one 1.6GB file.

  1. Have you tested with something that natively implements SMB (i.e. an
    interior, but alternative, operating system)? How do the results compare
    there when mapping a drive and copying files in each way?

Not yet. I have access to a local iMac and will give that a try.

  1. A LAN trace may be interesting. I would guess, since “downloading” is
    fast, that both options are using the same version of SMB, but maybe not.

I saw something potentially interesting with Wireshark; smbclient uses much larger packet sizes compared to mount -t cifs:


left: local smbclient->NAS file transfer
right: local mount -t cifs, file copied to NAS

  • same direction, quite a different dialog
  1. Have you compared with, or tried, openSUSE Leap 42.2? I also see
    something about SUSE-SLE_12 in your data; are you pulling data from SUSE
    Linux Enterprise (SLE) repositories too?

I have a Leap 42.2 desktop I can try.

Thanks for the suggestions.

If you look at the TCP window size, which Wireshark can probably graph for
you over the course of the transfers, do you see it filling up all of the
way at all? This is just odd to me, but it’s technically different code.

Google mentioned possibly using a mount option for protocol other than
version 1, and if so then that would almost definitely help:
https://unix.stackexchange.com/questions/345094/smb-cifs-enable-large-rsize-wsize-to-netapp


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.

Yep, I’ve tried the suggestions on that page - setting vers=2.0, rsize/wsize values, etc.

I’ve also tried enforcing SMB2 protocol from the server end.

‘cat /proc/mounts | grep nas’ returns the mount details and the rsize/wsize looks reasonable:

rsize=65536,wsize=65536

From looking at Wireshark again; I don’t fully understand TCP window size, but it looks like the NAS is advertising a value of 48790 but ‘mount -t cifs’ on the desktop is still sending very small TCP segments of around 2896 bytes (and then only splits it up into two parts to reassemble).

But smbclient is sending up to 4 reassembled parts and each TCP segment is much larger (up to 42468 bytes).

Does this make any sort of sense?

Not really. Could you make full packet traces (starting with connection establishment) available for both kernel mount and smbclient?

For some reason, the file manager used to copy makes a big difference (with ‘mount -t cifs’):

Midnight Commander: 11.5MB/sec
Konqueror: 4.5MB/sec
Dolphin: 30MB/sec
Thunar: 8MB/sec
bash cp: 46MB/sec

But, if each client’s inbuilt smb protocol is used (smb://IP/shared_dir in the URL bar), I get a consistent 35-40MB/sec with all of them.

Am also getting similar performance with an iMac.

So this accounts for much of the variation. But smbclient is still getting over double the performance.