[Samba] small files poor performance

Robert Jakab robert.jakab at gmail.com
Wed Jan 11 13:38:22 GMT 2006


Hello,
I've read a lot of information and forums concerning the samba
performance question, but nothing was helpful. I'm desperate of
the situation so I'm writing here hoping somebody could help me.

When copying cca 330MB file from server - I can reach rate about
8-11MB/s depending on some mysticals factors, which I can't identify.
To eliminate possible network problems, I've tried ftp for the same file
- I've got little bit over 11.5MB/s but the transfer rate was rock solid
(understand only plus minus few kB/s) all the time. I would accept the
performance, but the problem came with many small files. When trying
to copy directory with 5500 files and a size of 330MB, the speed was
about 5-5.5MB/s. With ftp, the result was even worse, but the protocol
itself is not suited for such type of transfers.
I'd like to know if it is even possible to reach at least the speed of
10MB/s with those small files.

To eliminate server load issues, almost all services on the server were
down, no firewall was active and I was testing on network with only one
client connected to server. The CPU load remained under 5%. The
amount of free RAM was over 700MB. Server is attached to network
through 1Gbit LAN connection. It's running debian sarge 3.1 with samba
3.0.14a-Debian installed from distribution package with kernel 2.6.14-5
(no patches applied). You can think this could be HDD performance limit,
but it is not: I have 3 SATA HDDs in RAID5 array, which gave me 100MB/s
when I was copying the big file locally to /dev/null. And I've got  
25MB/s
when copying the directory with small files from one partition to  
another
(so I expect over 50MB/s when only reading this data). As you can see,
the HDD subsystem is not the bottleneck for sure. Just for info, the XFS
filesystem is used.

In samba configuration, I was playing with socket options, (un)setting
TCP_NODELAY, IPTOS_LOWDELAY and trying to set SO_RCVBUF
and SO_SNDBUF parameters to different values starting from 8192 to
65535 in steps of 16k. These changes had almost no influence on the
performance. As a last step I've also tried using the case sensitivity
option for the concrete share (the 4 commented lines in the "mks" share
in smb.conf file attached). This also didn't help.

I don't know whether the problem lies in server or client station. I'm
using WinXP Home SP2 on my clients. If you have any idea how to
make samba go faster I'd be very grateful.
thanks

Here's part of my samba configuration file:

[global]
    workgroup = weldex
    server string = Aquarius server
    dns proxy = no

    log file = /var/log/samba/log.%m
    max log size = 1000
    log level = 2
    syslog = 0

    panic action = /usr/share/samba/panic-action %d

    security = user
    encrypt passwords = true
    passdb backend = tdbsam guest
    obey pam restrictions = yes
    invalid users = root

    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew 
\sUNIX\spassword:* %n\n .

    preserve case = yes
    short preserve case = yes

    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=16384  
SO_SNDBUF=16384

[homes]
    comment = Home Directories
    browseable = no
    writable = yes
    create mask = 0700
    directory mask = 0700

[mks]
    comment = MK-Soft (win+dos)
    path = /home/mks
    browseable = yes
    writable = yes
    create mode = 0660
    directory mode = 0770
    force user = samba
    force group = samba
    ;case sensitive = true
    ;default case = upper
    ;preserve case = no
    ;short preserve case = no



More information about the samba mailing list