5

I've encountered a recent problem with my Samba server (18.04). I have gigabit networking on both ends, but I seem to only get write speeds of about 2MB/s. However, using SSH or FTP, I can transfer files at around 30MB/s which is about what I can expect from my hard drives, so I'm pretty sure the problem is isolated to Samba. Read speeds are about what should be expected. I've only noticed this issue recently with 18.04, after I switched from 16.04. I've tried tweaking MTU's, buffers, cache and other things to no avail. I've put a fresh install of 18.04 server on another machine and used samba just to see if a fresh install would help, but the issue seems universal to all my machines running 18.04. Any help would be greatly appreciated. My samba conf right now is just the default.

2

2 Answers 2

2

As per your Comment if you already have samba 4.10 and only observe the symptoms using the GUI, use the command line to copy files as there is a bug in Dolphin which is being addressed and whose fix will eventually make it into Nautilus as well.

(Read the bug's fix at a minimum: interesting read)

1
  • 1
    Good to know it’s not just me. Interesting read, thanks a lot.
    – AlexDude7
    Mar 29, 2020 at 6:04
2

Try to add or modify the next socket option in your smb.conf file under [global] section:

socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=64000 SO_RCVBUF=64000 SO_KEEPALIVE

Then restart samba services:

sudo systemctl restart nmbd smbd

Another option is compiling it from sources or downloading older version from 16.04 repository. But I couldn't confirm now if it is reliable.

I've installed default Samba 4.7.6 version from repositories onto 18.04 Virtualbox VM. It transfers files at speeds more than 70MB/s.

Config file used is:

$ cat /etc/samba/smb.conf 
[global]
   workgroup = WORKGROUP
   server string = %h server (Samba, Ubuntu)
   dns proxy = no
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   server role = standalone server
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

   pam password change = yes
   map to guest = bad user

   usershare allow guests = yes

[homes]
   comment = Home Directories
   browseable = no
   read only = yes
   create mask = 0700
   directory mask = 0700
   valid users = %S

[netlogon]
   comment = Network Logon Service
   path = /home/samba/netlogon
   guest ok = yes
   read only = yes

[profiles]
   comment = Users profiles
   path = /home/samba/profiles
   guest ok = no
   browseable = no
   create mask = 0600
   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

[guest]
  path=/srv/samba/guest
  read only = no
  guest ok = yes

I created /srv/samba/guest folder with all rights and uploaded there an iso image through guest account:

$ ls -ailh /srv/samba/guest/
total 2,0G
285916 drwxrwxrwx 2 root   root    4,0K бер 20 21:35 .
285915 drwxr-xr-x 3 root   root    4,0K бер 20 21:17 ..
264940 -rw-r--r-- 1 nobody nogroup 2,0G бер 11 16:04 ubuntu-18.04.4-desktop-amd64.iso

So this issue is not universal for all 18.04.

5
  • Write speeds are still only 1-2 MB/s
    – AlexDude7
    Mar 20, 2020 at 1:56
  • 1
    I've just tested it on 18.04 VM with samba Version 4.7.6-Ubuntu. Speeds are more than 70MB/s. What version of samba do you have?
    – Gryu
    Mar 20, 2020 at 19:27
  • I've done some more fiddling and testing and I think the issue might be on the client side. I accessed my share with a windows machine and was able to get ~25mB/s. Also, when I mount the share via fstab, I get decent speeds. The only time it's slow is when I access it through the network page in the file manager. Could there be an issue there?
    – AlexDude7
    Mar 22, 2020 at 1:34
  • @AlexDude7 I've ran into the same before and just upvoted Gryu's answer as it's the best you'll get. What is the samba version you're running? I don't have this particular problem on 4.10.10 any more, but used to have it on Ubuntu 16.04. Now I'm getting 19 MiB/s on WiFi and 95MiB/s with a cross-cable (copying to SSD on the command line, HDD is slower, KDE's Dolphin has a bug that is being corrected)
    – Fabby
    Mar 25, 2020 at 10:49
  • @Fabby I'm running 4.10.0 on my server. I don't think the issue is with samba. I think it's a Nautilus problem, because when I connect with my windows machine or via the terminal instead of using the file manager the speeds are fine.
    – AlexDude7
    Mar 27, 2020 at 22:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .