SAMBA server speed.

Hi all.

I have the problems with transfer speed between samba and Windows XP clients.

  1. samba server configuration:
    Quad Core 6600 CPU.
    4 Gb RAM

OpenSUSE 11.2 with kernel “2.6.31.12-0.1-desktop”
Samba - samba-3.5.1-1.1.i586


Test: 4 GB File copying. One file.

transfer speed from Samba Server to Windows 7 and XP clients:

(Windows clients copy file from Server share -> to local drive)
From Server to Windows 7 client 1:
85-90 Mb/sec
From Server to Windows 7 client 2:
90-100 Mb/sec
From Server to XP1 client 3
75-100 Mb/sec

transfer speed from Windows 7 and XP clients TO Samba Server:
(client copy file from local drive -> to server Share)
From Server to Windows 7 client 1:
12-20 Mb/sec
From Server to Windows 7 client 2:
30-35 Mb/sec
From Server to Windows XP client 1
20-27 Mb/sec

(copying file from Windows local drive to Windows remote share)
From Window 7 client 1 TO Windows XP client 1
40-50 Mb/sec
From Window 7 client 2 TO Windows XP client 1
50-60 Mb/sec

Copying file from Windows 7 client 2 share -> TO Windows XP client 1 show me 100-120 Mb/sec speed permanent.

= = =

Copying file from Linux hosts to NFS server is stable 50-90
Mb/sec bidirectional.

This part of my smb.conf file


# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2009-10-27
[global]
log level = 1
debug level = 0
max log size = 50

#read prediction = true
#read size = 65536

#strict locking = No
#strict sync = No

#sync always = No

wide links = yes

read raw = yes
write raw = yes

#max protocol = smb2
realm = some.com
# client ntlmv2 auth = yes

socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=65535 SO_RCVBUF=65535

winbind enum groups = Yes
winbind enum users = Yes
idmap uid = 10000-20000
idmap gid = 10000-20000
auth methods = winbind
winbind use default domain = No
case sensitive = No

#client use spnego = Yes
#client signing = Yes


        workgroup = ???????
        server string = ""
        passdb backend = tdbsam
        printing = cups
        printcap name = cups
        printcap cache time = 750
        cups options = raw
        map to guest = Bad User
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        usershare allow guests = Yes
        security = domain
        add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
        domain logons = No
        domain master = No
        netbios name = Server
        wins support = No
#[homes]
#       comment = Home Directories
#       valid users = %S, %D%w%S
#       browseable = No
#       read only = No
#       inherit acls = Yes

Another words: I have very slow WRITE speed when copying file FROM Windows clients TO Samba Share. This is the most problem. Of course i hear many many questions from Windows users.

All possible help is very very appreciated.

p.s. my books now:
SAMBA Documentation

Samba speed is slower than Windows native clients connections ?

I wonder if you have enabled noatime in your mount options for that filesystem.

Also have you tried copying into /dev/null to take the disk write out of the test to see what the baseline speed you can expect from Samba is?

Thanks for answer, ken_yap. My mount options is:
/dev/sdb1 /mnt/RAID ext4 acl,user_xattr 1 2

must be replaced with:
/dev/sdb1 /mnt/RAID ext4 noatime,acl,user_xattr 1 2

Right ?

Right…

tests.

  1. “dd” to Raid 5 (Samba share)
 time dd if=/dev/zero of=/mnt/RAID/Projects/test_file bs=8192 count=331541
331541+0 records in
331541+0 records out
2715983872 bytes (2.7 GB) copied, 17.7783 s, 153 MB/s

real	0m17.881s
user	0m0.111s
sys	0m9.822s

  1. “dd” to “/” Server directory:
time dd if=/dev/zero of=/test_file bs=8192 count=331541
331541+0 records in
331541+0 records out
2715983872 bytes (2.7 GB) copied, 49.9899 s, 54.3 MB/s

Last result is strange, because same test on my computer and on the others linux computers looks different:

My OpenSUSE 11.2 workstation


time dd if=/dev/zero of=/test_file bs=8192 count=331541
331541+0 records in
331541+0 records out
2715983872 bytes (2.7 GB) copied, 19.6755 s, 138 MB/s

real	0m19.696s
user	0m0.043s
sys	0m2.810s

Another linux node:


time dd if=/dev/zero of=/test_file bs=8192 count=331541
331541+0 records in
331541+0 records out
2715983872 bytes (2.7 GB) copied, 29.5517 s, 91.9 MB/s

real	0m29.559s
user	0m0.080s
sys	0m6.772s

===

===

p.s.

Server Share filesystem - is “EXT4” -
My linux desktop “/” filesystem is “XFS”

ken_yap,

  1. i do live remount /dev/sdb RAID

mount -o noatime,remount,rw,acl,user_xattr /dev/sdb1

  1. i do some tests 3 times again:

time dd if=/dev/zero of=/mnt/RAID/Projects/test_file bs=8192 count=331541
331541+0 records in
331541+0 records out
2715983872 bytes (2.7 GB) copied, 13.681 s, 199 MB/s

real	0m14.334s
user	0m0.095s
sys	0m10.180s


time dd if=/dev/zero of=/mnt/RAID/Projects/test_file bs=8192 count=331541
331541+0 records in
331541+0 records out
2715983872 bytes (2.7 GB) copied, 12.7281 s, 213 MB/s

real	0m13.306s
user	0m0.121s
sys	0m9.649s


time dd if=/dev/zero of=/mnt/RAID/Projects/test_file bs=8192 count=331541
331541+0 records in
331541+0 records out
2715983872 bytes (2.7 GB) copied, 13.3636 s, 203 MB/s

real	0m13.939s
user	0m0.110s
sys	0m9.703s

Disk I/O looks much faster now.

old test values: 153 Mb/sec

new values is: 213 MB/s, 203 MB/s, 199 MB/s

i need do some tests with samba again.

No good results. :frowning:

But i see strange performance difference between protocols.

Look to test results. This is the file transfer test. From Linux Desktop - to server trough SMB, NFS, and FTP protocols:

  1. Linux Desktop -> Server (SMB)
    upload to Server:
    14 MB/s , 19 Mb/s, 20 Mb/s
    download from Server:
    28 MB/s, 34 MB/s

  2. Linux Desktop -> Server (NFS)
    upload to Server:
    10 Mb/s, 12 MB/s, 14 MB/s
    download from Server:
    40 MB/s, 35 MB/s, 60 MB/s

  3. Linux Desktop -> Server (FTP)
    upload:
    94 MB/s, 100 MB/s, 105 MB/s
    download:
    103 MB/s, 105 MB/s, 107 MB/s

wow. :confused:

= = = =

FTP connection is pretty fast in both directions instead of NFS and SMB…

something is really wrong with Server preferences.
any possible opinions ?


some test for server disks:

  1. Shared disk test (raid 5):
    time dd if=/dev/zero of=/mnt/RAID/test_file bs=8192 count=331541
    331541+0 records in
    331541+0 records out
    2715983872 bytes (2.7 GB) copied, 13.8833 s, 196 MB/s

real 0m13.900s
user 0m0.064s
sys 0m8.336s

  1. Root partition test ( /dev/sda1 on / type ext4 (rw,noatime,acl,user_xattr,acl,user_xattr) ):

time dd if=/dev/zero of=/test_file bs=8192 count=331541
331541+0 records in
331541+0 records out
2715983872 bytes (2.7 GB) copied, 47.9228 s, 56.7 MB/s

real 0m47.926s
user 0m0.092s
sys 0m8.498s

System work on disk with slow I\O performance. Can this affect SAMBA ?

Maybe because when you treat the share as a disk, Samba makes sure the data is synced to disk before returning from the write. whereas FTP gives no such guarantees? Have you tried increasing the write size? Why 8kB only? Samba can handle much larger writes.

1.ken_yap what you think about this ?


some test for server disks:

  1. Shared disk test (raid 5):
    time dd if=/dev/zero of=/mnt/RAID/test_file bs=8192 count=331541
    331541+0 records in
    331541+0 records out
    2715983872 bytes (2.7 GB) copied, 13.8833 s, 196 MB/s

real 0m13.900s
user 0m0.064s
sys 0m8.336s

  1. Root partition test ( /dev/sda1 on / type ext4 (rw,noatime,acl,user_xattr,acl,user_xattr) ):

time dd if=/dev/zero of=/test_file bs=8192 count=331541
331541+0 records in
331541+0 records out
2715983872 bytes (2.7 GB) copied, 47.9228 s, 56.7 MB/s

real 0m47.926s
user 0m0.092s
sys 0m8.498s

System work on disk with slow I\O performance. Can this affect SAMBA ?

i edit smb.conf and set SO_SNDBUF=65535 SO_RCVBUF=65535, but after tests, i don`t see any major differences.

I`m sure, samba MUST work with speed 100 MB/s, like FTP. And NFS - too. I think - something is really wrong with server. Difference between 100-107 MB/s (FTP) and 17-20 MB/s (SMB) - is really huge.

May be because my system disk is slow, and samba try to make some operations with slow system disk ( caching may be)…

I try now setup SAMBA server on another machine - and compare speeds.

Ha ha:

[Appendix B] Samba Performance Tuning](http://oreilly.com/catalog/samba/chapter/book/appb_01.html)

However, you should see similar ratios of Samba to FTP, probably in the range of 68 to 80 percent. It’s not a good idea to base all of Samba’s throughput against FTP. The golden rule to remember is this: if Samba is much slower than FTP, it’s time to tune it.

Yes… This is not funny, but i need to setup another SAMBA server on ANOTHER hardware and make tests :confused:

As I already said, why don’t you do some tests where you direct the output of samba into /dev/null to take the disk out of the equation. You can do this using smbclient.

Thank you for details. I will bee test on openSUSE 11.2

As i understand, i need to run this test on SAMBA server machine? Ok - look please to results:


Server:/ # smbclient '\\server\projects' -U 'someuser' -E -d1 -Tca /dev/null 'test_file'
Enter someuser's password: 
Domain=[XXX] OS=[Unix] Server=[Samba 3.5.1-1.1-2323-SUSE-SL11.2]
  2715983872 (254176.1 kb/s) 	est_file
tar: dumped 1 files and directories
Total bytes written: 2715984384

What you think about ? I don`t understand what this test showing. This is test SAMBA speed without disk using ? Disk IO independent SAMBA test ?

Very interesting…

Yes, that tests the protocol speed. If it’s much faster than with disk I/O, then you know something.

Sorry, but i think i have not ideas anymore. I setup another linux samba server, and speed results is same, just a little bit faster, but… Ugly SLOW anyway…

Server 2 specification:

  1. MemTotal: 8191812 kB
  2. CPU: Intel Xeon E5440 @ 2.83GH - 8 cores
  3. Disks:

System disk - file system XFS:
/dev/sda:
Timing cached reads: 12150 MB in 2.00 seconds = 6081.51 MB/sec
Timing buffered disk reads: 204 MB in 3.02 seconds = 67.57 MB/sec

Share disk - file system XFS:
/dev/sdb:
Timing cached reads: 11648 MB in 2.00 seconds = 5829.63 MB/sec
Timing buffered disk reads: 240 MB in 3.02 seconds = 79.37 MB/sec

LAN adapter:

$
$ethtool eth0
Settings for eth0:
Supported ports: TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbag
Wake-on: g
Current message level: 0x00000001 (1)
Link detected: yes

======================

======================

Test copying 4GB file from another linux node (simple copying from Midnight Commander(mc)):

SMB upload to Server2:
17 MB/s, 21 MB/s, 22 MB/s
SMB download from Server 2
20 MB/s, 23 MB/s, 25 MB/s

And for comparing:

NFS upload from Linux Client to Server2
65 MB/s 70 MB/s
NFS download from Server 2 to Linux Client
91 MB/s, 103 MB/s, 86 MB/s

(so. this is about LAN cables and switches - FTP and NFS work pretty fast)


i have 2 different computers with same SAMBA speed results. And this transfer speed is really slower than NFS or FTP speed. I have no ideas anymore.


I`m confused with this problem, and i have question to all SAMBA users. Somebody have seen transfer rate more than 20-25 MB/s ? SAMBA can work with Gigabit LAN with transfer speed 70-80-90 Mb/sec or this is possible only between Windows Server and Windows Clients ?

And… I must write to samba developers. I can`t understand the logic. May be 3.5 is slower… But Windows 7 domain users can properly authorize only with 3.5. May be samba is not ready for VFX work ?

Some News.

Today i make tests with my home OpenSUSE 11.2 with Samba 3.5 (No optimized!) and Windows XP HOME Edition OEM (notebook) and windows XPPro - 32 bit.

I have 100 Mb LAN, but i connect 2 computers with direct cable, w/o routers and switches.

copying 1 file - 1.7 Gb.

Win XP HOME ===> Win XP Pro 32 bit
6.8 Kb/s, 7.0 Kb/s, 7.5 Kb/s
(when start - 15 Kb/s 1 or 2 seconds then slowdown to 6.8)

Time = 3 Min 20 Sec

Win XP HOME <==== Win XP PRO 32 bit
9.9 Kb/s 10 Kb/s

Win XP HOME ===> Linux SAMBA 3.5 Open SUSE 11.2
10 Kb/s, 10 Kb/s, 9.9 Kb/s

Time = 2 Min 23 sec

Win XP HOME <=== Linux SAMBA 3.5 Open SUSE 11.2
10 Kb/s, 10 Kb/s, 10.1 Kb/s




And so. I not understand the logic of situation:

On my work i have slow samba+windows connections, but very fast, as never, FTP and NFS connections between Linux boxes. FTP connections from Windows to Linux Server is Slow.

This look`s like SAMBA is slow. But my home test - direct connection between 2 computers w/o switches, hubs, routers - Samba is up to 1.5 times faster.

I do this test 4 times - because it broke all my understanding of situation. All results is always the same - samba for home local LAN is faster and have nice and stable transfer speed.

I don`t know what i can do with this situation.

**All done. **

Absolutely crazy and idiotic situation…

This was problem of extremely chaotic LAN topology, and very disorder switches connections (6-7 switches 2 - 100 MB, all other - 1Gb)

I don`t say anything about topology, because peoples which worked earlier, have told me, that with LAN, with switches, and with hardware - all perfectly.

This case is one more acknowledgment of an Old Rule - that ALL Should be … must be checked Personally… ALWAYS!

**All absolutely good with SAMBA speed. **