I searched for “samba slow file transfer” and got no results, hence this post.
When transferring files between Samba shares or Windows and Samba, it is extremely slow. Network is a combination of 100MBit and 1GBit switches, but the speed is equivalent to 10MBit or even less. E.g. 400MB takes 30 minutes.
I searched for “samba slow file transfer” and got no results, hence this post.
When transferring files between Samba shares or Windows and Samba, it is extremely slow. Network is a combination of 100MBit and 1GBit switches, but the speed is equivalent to 10MBit or even less. E.g. 400MB takes 30 minutes.
How do I go about trouble-shooting this?
Thanks,
It might be helpful to know how many computers you are sharing between? If two, copy a know size file, perhaps like an entire audio CD (in MP3 format), knowing the entire file size and time it from PC a to PC b and then PC b to PC a. Going both ways is helpful to see where in the process the slow down might exist. If there three PC’s, then there are six combinations to try. The file group you copy needs to be long enough to take a minute or so to complete, but not something that takes hours and you need a clock with a second hand. You might want to post a copy of your /etc/samba/smb.conf file. It might be helpful to test your Internet speed on both or all PC’s which puts all on equal network footing. Here is the test site to look at:
>
> Hello,
>
> I searched for “samba slow file transfer” and got no results, hence
> this post.
>
> When transferring files between Samba shares or Windows and Samba, it
> is extremely slow. Network is a combination of 100MBit and 1GBit
> switches, but the speed is equivalent to 10MBit or even less. E.g. 400MB
> takes 30 minutes.
>
> How do I go about trouble-shooting this?
>
> Thanks,
>
FeathersMC;
Can you post the contents of /etc/samba/smb.conf. You may use substitute
values for any sensitive data such as public IPs.
What version of Samba is installed? Just report the results of:
/usr/sbin/smbd -V
Are both reading and writing slow? Does direction (to/from Samba) matter?
P. V.
“We’re all in this together, I’m pulling for you.” Red Green
There are several machines of all varieties, including virtuals and physicals, so there are a lot of combinations to test. Similarly there is not just one smb.conf file, but I will post one asap.
However a quick test showed:
100k file from Win XP to a LaCie network storage box: 10 seconds (run from Win XP box)
100k file from Win XP to physical Linux 11.2 Samba share: 2 minutes (run from source Win XP box)
500k file from Win XP to Win XP: 2 seconds (run from destination Win XP box)
I also have some Windows 7 machines which I should try.
Does seem to indicate samba is involved in the problem somehow, although the network storage box is not starring either.
>
> Thanks for quick replies.
>
> There are several machines of all varieties, including virtuals and
> physicals, so there are a lot of combinations to test. Similarly there
> is not just one smb.conf file, but I will post one asap.
>
> However a quick test showed:
>
> 1. 100k file from Win XP to a LaCie network storage box: 10 seconds
> (run from Win XP box)
> 2. 100k file from Win XP to physical Linux 11.2 Samba share: 2 minutes
> (run from source Win XP box)
> 3. 500k file from Win XP to Win XP: 2 seconds (run from destination Win
> XP box)
>
> I also have some Windows 7 machines which I should try.
>
> Does seem to indicate samba is involved in the problem somehow,
> although the network storage box is not starring either.
>
> I will keep you posted …
>
>
FeathersMc;
Have you tested the write speed going from Samba to Windows?
P. V.
“We’re all in this together, I’m pulling for you.” Red Green
Tested physical 11.2 samba to Windows XP from KDE desktop (reverse of 2. above): 100k in just over 2 minutes.
I also tested internet download speeds:
From Windows XP around 14MB/s, upload 1MB/s
From Physical Linux SUSE 11.2: 1.5MB/s, upload 900kb/s (not sure why different - they are sitting next to each other)
From virtual Linux SUSE 11.4: 14MB/s, upload 900kb/s (this is hosted on above-mentioned XP box)
Copying the 100k file from Windows XP to Virtual SUSE 11.4: 20+ minutes
smb.conf on the physical SUSE 11.2 machine:
smb.conf is the main Samba configuration file. You find a full commented
version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
samba-doc package is installed.
Date: 2009-10-27
[global]
workgroup = Home
passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = Yes
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = No
domain master = No
security = user
wins support = No
ldap suffix =
wins server =
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700
[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/
[groups]
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775
I’m not a samba guru, but have read guides that suggest the following parameters can significantly improve file transfer performance. (Add to the ‘global’ section of smb.conf)
read size = 65536
read prediction = true
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
write raw = yes
read raw = no
On Sun July 31 2011 04:26 am, deano ferrari wrote:
>
> Hi FeathersMc
>
> I’m not a samba guru, but have read guides that suggest the following
> parameters can significantly improve file transfer performance. (Add to
> the ‘global’ section of smb.conf)
>
>
> Code:
> --------------------
> read size = 65536
> read prediction = true
> socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
> write raw = yes
> read raw = no
> --------------------
>
>
deano ferrari;
to the share definitions of /etc/samba/smb.conf may improve your performance
to some degree.
FeathersMC;
and
Even here the Linux is considerably slower 14MB/s vs 1.5MB/s. In fact the
Internet speed of Suse is about 9 times slower than Windows and the Samba
speed about 12 times slower. Before tweaking your smb.conf I would look at
the general slowness of the interface. Are both wired or both wireless? If
wired check the cables.
–
P. V.
“We’re all in this together, I’m pulling for you.” Red Green
>
> Hi,
>
> Tested physical 11.2 samba to Windows XP from KDE desktop (reverse of
> 2. above): 100k in just over 2 minutes.
>
> I also tested internet download speeds:
>
> From Windows XP around 14MB/s, upload 1MB/s
> From Physical Linux SUSE 11.2: 1.5MB/s, upload 900kb/s (not sure why
> different - they are sitting next to each other)
> From virtual Linux SUSE 11.4: 14MB/s, upload 900kb/s (this is hosted on
> above-mentioned XP box)
>
> Copying the 100k file from Windows XP to Virtual SUSE 11.4: 20+
> minutes
>
> smb.conf on the physical SUSE 11.2 machine:
>
> # smb.conf is the main Samba configuration file. You find a full
> commented
> # version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if
> the
> # samba-doc package is installed.
> # Date: 2009-10-27
> [global]
> workgroup = Home
> passdb backend = tdbsam
> printing = cups
> printcap name = cups
> printcap cache time = 750
> cups options = raw
> map to guest = Bad User
> include = /etc/samba/dhcp.conf
> logon path = \%L\profiles.msprofile
> logon home = \%L%U.9xprofile
> logon drive = P:
> usershare allow guests = Yes
> add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody
> -s /bin/false %m$
> domain logons = No
> domain master = No
> security = user
> wins support = No
> ldap suffix =
> wins server =
> [homes]
> comment = Home Directories
> valid users = %S, %D%w%S
> browseable = No
> read only = No
> inherit acls = Yes
> [profiles]
> comment = Network Profiles Service
> path = %H
> read only = No
> store dos attributes = Yes
> create mask = 0600
> directory mask = 0700
> [users]
> comment = All users
> path = /home
> read only = No
> inherit acls = Yes
> veto files = /aquota.user/groups/shares/
> [groups]
> comment = All groups
> path = /home/groups
> read only = No
> inherit acls = Yes
> [printers]
> comment = All Printers
> path = /var/tmp
> printable = Yes
> create mask = 0600
> browseable = No
> [print$]
> comment = Printer Drivers
> path = /var/lib/samba/drivers
> write list = @ntadmin root
> force group = ntadmin
> create mask = 0664
> directory mask = 0775
>
> ## Share disabled by YaST
> # [netlogon]
>
FeatherMC;
First please see my reply to deano ferrari’s post. I think this thread may
be miss named since much of the problem seems to be a slow network connection
unrelated to Samba. This tittle may keep those with more knowledge about
configuring the interface from viewing the thread.
With that said:
You did not mention just how you are doing name resolution on Samba. The
default name resolution order is a bit unfriendly and may be slowing the
initial connection to some degree.
Make sure that nmbd is running and allowed through the Firewall.
YaST > Security and Users > Firewall > Allowed Services. Make sure that these
three items are allowed: Netbios Server, Samba Server and Samba Client.
Edit, as root, /etc/samba/smb.conf and add to the [global] section:
Thanks all. I’ll take on board your advice and tackle the problem from a broader perspective, to see if it is some sort of network problem rather than anything to do with Samba.
I am afraid it might be the samba client. I used to have mint installed in my laptop and the windows shares at work seemed quite fast, but now it takes ages to even start a download. Nevermind the fact that I need to download the documents I need to see and open them locally (yes, I have read/write permission on that particular share). When I try to open and see them remotely, the notifications area shows that I have initiated a download (probably downloading the file to the /tmp folder, I guess) and after the (long) time it finishes, nothing happens. The file won’t open and I can’t even locate it in the /tmp folder (or anywhere else, for this matter). I haven’t tried to download a large file to measure the speed.
Oh well, I will just keep experimenting. If all goes well, I will post it.
I have to access a remote windows file server (cifs shares) during the course of my work. I don’t use the samba-client. I read/write via Dolphin (kio_smb) using ‘smb://<myusername>@<IP address>/…’ without any noticeable issues. (This includes uploading and viewing photos of siginificant size.)
On 2013-11-05 22:26, bladedemon wrote:
> I am afraid it might be the samba client. I used to have mint installed
> in my laptop and the windows shares at work seemed quite fast, but now
> it takes ages to even start a download.
I read a recent thread on slow samba on certain machine. It has 4 samba
shares, and only one was slow. It seems to be related to file
locking.tdb growing big. He simply deletes it (stop service, delete
file, start service) now and then.