You are not logged in.

#1 2015-04-01 16:23:40

blubbblubb
Member
Registered: 2015-04-01
Posts: 4

Samba Performance Linux->Windows slow

Hi,

i have a problem with the Transfer speeds of Samba.

If i start to copy files on my Linux Machine i get a max transfer rate of ~50MB/s with an average speed of ~40MB/s, it does not matter if i am copying local files to a Windows Share or if i copy from a Windows share to my local harddrive

If i start to copy files on a Windows Machine: i get a max transfer rate of ~110MB/s with an average speed of ~100MB/s, again both for copying local files to a linux share and copying files from a linux share to the local windows harddrive

So both ways are faster when copying is initiated on the Windows Machine, is there some sort of speed limit in Samba i need to raise?


adding:
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
or
write cache size with different values to the smb.conf did not help

Here is a my smb.conf

[global]
workgroup = WORKGROUP
server string = XXX
netbios name = XXX
security = user
map to guest = Bad User
;security = share
; the line below is important! If you have permission issues make
; sure the user here is the same as the user of the folder you
; want to share
guest account = XXX
usershare allow guests = Yes
usershare max shares = 100
usershare owner only = False
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536

[public]
comment = Public Share
path = /home/XXX/Public
available = yes
browsable = yes
public = yes
writable = yes

Im not sure if there are any relevant log files i could provide, if so please tell me

Last edited by blubbblubb (2015-04-01 16:27:50)

Offline

#2 2015-04-02 09:44:57

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 623

Re: Samba Performance Linux->Windows slow

I think that it is related to ntfs (ntfs-3g) driver so in my opinion there is not much to do about this if you want to have mixed lin-win shares. The same problem occurs with usb drives connected to lin machines with ntfs (i have usb 3.0 external hdd: when i copy files with ext4 partition i have around 110MB/s, when i used ntfs i had around 30-40MB and speed was dropping while copying files).

BTW - win and lin are connected trough fast network connection (1GB lan or something similar?), right?

Last edited by firekage (2015-04-02 09:47:14)

Offline

#3 2015-04-02 11:28:16

Maesto
Member
Registered: 2014-06-23
Posts: 6

Re: Samba Performance Linux->Windows slow

Samba is a bit tricky. I like to test throughput either directly with smbclient or with smbnetfs.
Smbclient I always need to look how to use it. But with smnbetfs it's easy as mounting a USB stick. Just look out that you add "-o big_writes" to your smbnetfs cli because else it's slow as fuck.

As for the smb.conf here's a running example from my Workplace. Some config options come from the bad SMB implementation of OSX. (But I have to support it).
Also you should for ext4 add these options to your fstab "user_xattr,acl,barrier=1" those are recommendations from the Samba docs.

And if you aren't only running with guest accounts you should take a look at ACLs (getfacl, setfacl) it isn't as hard as it seems, and you can specify rights really detailed.

[global]
        server max protocol = SMB2
        encrypt passwords = yes 
        dns proxy = no
        strict locking =no 
        deadtime = 15
        max log size = 51200
        max open files = 116921
        load printers = no
        getwd cache = yes 
        guest account = nobody
        map to guest = bad user
        obey pam restrictions = yes 
        directory name cache size = 0 
        kernel change notify = no
        hostname lookups = no
        server string = Samba Server Running Version %v
        ea support = yes 
        store dos attributes = yes 
        time server = yes 
        acl allow execute always = true
        acl check permissions = true
        dos filemode = yes 
        domain logons = no
        local master = yes 
        server role = member server
        time server = yes 
    
        netbios name = <HOSTNAME>
        workgroup = <WORKGROUP>
        security = user
        client ntlmv2 auth = yes 

# ==== LDAP CONFIG ==== 
#       passdb backend = ldapsam:ldap://<LDAPSERVER>
#        ldap admin dn = cn=<SAMBA_LDAP_USER>,dc=<DOMAIN>,dc=<TLD>
#       ldap suffix = dc=<DOMAIN>,dc=<TLD>
#       ldap ssl = off
#       ldap replication sleep = 1000
#       ldap passwd sync = yes
#       ldapsam:trusted = yes
#       domain logons = yes
#       idmap config <DOMAIN>: backend = ldap
#       idmap config <DOMAIN>: range = 10000-90000000
    
        create mode = 0660
        directory mode = 0760
        force create mode = 0660
        force directory mode = 0760
    
        hide files = /._*/.DS_Store/.Trashes/.TemporaryItems/
        veto files = /._*/.DS_Store/.Trashes/.TemporaryItems/
        delete veto files = yes

        [homes]
        comment = Home Directories
        path = /home/%U
        browseable = no
        valid users = %S
        create mode = 0600
        directory mode = 0700

        [MyShare]
        comment = media
        path = <MYPATH>
        browseable = yes

Edit: since your problem seems to be only on lin it could be a problem with a missing "-o big_writes" somewhere. Test the througput on the server then rsync then samba to find the problem.

#create test file
dd if=/dev/urandom of=/tmp/test.rnd bs=1M count=1024

#test on local server
rsync -P /tmp/test.rnd /path/where/share/is/

#rsync that data from remote pc
rsync -P /tmp/test.rnd user@server:/path/where/share/is/

#test with smbnetfs
smbnetfs -o big_writes ~/sshfs
rsync -P /tmp/test.rnd ~/sshfs/workgroup/share/

Last edited by Maesto (2015-04-02 11:34:53)

Offline

#4 2015-04-02 17:53:32

blubbblubb
Member
Registered: 2015-04-01
Posts: 4

Re: Samba Performance Linux->Windows slow

It does appear to be connected to the ntfs-3g Driver, i did a Test with an external USB3.0 Harddrive and it starts around 103MB/s but drops down to ~40MB/s after a few seconds.

Its just that i could swear, that i was once able to copy to my external NTFS Drive with around 100MB/s as well as to/from the Windows Shares.

Maybe they changed something in a newer update?

Offline

#5 2015-04-02 20:43:49

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 623

Re: Samba Performance Linux->Windows slow

I dont remember having bigger speed under linux (arch) with ntfs-3g driver even when connection is done not by an usb but an sata cords directly to motherboard. NTFS on Arch or rather linux, is poor. Normal speed will be achieved using native linux filesystems, i use ext4.

BTW - of course, speed will be different, not much of a differenct, for big files or massive amounts of the small one (it will be pain in the...to copy something like this over ntfs-3g).


Something more funny - in my case, if i try to copy large amount of files (big files) than dolphin will...frezee after a while (it looks like the job is being done but it is not, because file size has not been changed at all) and stop respond that's why i copy only using terminal or...different manager like thunar...lol for KDE.

Last edited by firekage (2015-04-02 20:46:45)

Offline

Board footer

Powered by FluxBB