Samba Performance - Slow writes to 95 - Slow "puts" - etc.
Steve Arntzen
sjarntzen at esi-il.com
Mon May 10 21:23:10 GMT 1999
This is in response to a large number of you having
similar problems with Samba performance as I.
I have tracked these symptoms back to Digest 1709!
(I didn't go back any further)
I have created a few entries in the digest myself.
Only one person ever responded to me (Thanks Jan K.),
but that suggestion didn't help.
After many late hours of tweaking last Friday night,
with little benefit, and re-reading the digests I
finally succeeded. I thought I would share this with
all of you.
My Samba problem was with slow writes to the network
(slow "puts" as some of you may call it, or slow reads
from the server). I have learned many things about
Samba performance. Some of these affected 95 clients
but not NT clients. These problems existed using a
533 Mhz. Alpha server and 450 Mhz. Intel clients
running directly through a fast switch. On an idle
network (i.e.. late Friday night) you wouldn't expect
performance problems. Maybe some of these problems
aren't noticed on standard ethernet.
First make sure you get good network performance using
other tools (ftp, NFS, etc.). I found that my SMC
switch and some of my fast ethernet cards were set to
auto-negotiate and were actually negotiating the type
of link on the fly (thanks to the folks at SMC).
Read your log files! One of the first things I learned
is the permissions on your lock dir tree must be set
properly. I have seen a lot of performance complaints
with certain applications that are most likely file
locking problems.
Check your config with testparm to see what's going on.
READ RAW and READ BMPX on my systems were set to true
by default (which is good). Setting either one to
false would add almost 10 minutes to the read time of
a 10 MB file with a 95 client. Setting both would
double that time!
I have played with READ SIZE, READ PREDICTION, MAX XMIT,
TCP_NODELAY and READ PREDICTION with minor performance
changes. I even tried IPTOS_LOWDELAY and variations
of SO_SNDBUF and SO_RCVBUF.
The final and best advice was from Juan Carlos Castro
in a recent mailing (digest 2069) not so obviously
named "Open Letter to the Samba Team". In this mailing
Juan suggested :
socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
That did it! As many values as I tried (in powers of 2),
I didn't try 8K. Thank you Juan!
Although setting the debug value to zero didn't help (mine
defaulted to 2), I think if your done diagnosing, it's a
good idea.
Misc. notes:
One thing I have noticed on a 200 Mhz. pentium NT
client with Samba or ftp was that NT would start
writing to disk while the file is still being transferred
over the network noticeably slowing down the network task.
Linux, FreeBSD etc. clients would cache the entire file,
then write to disk, thus achieving full network bandwidth.
Although I could get full network bandwidth with NT, It
was on files less than 2MB.
I have disabled ALL WINS at our site and run strictly
DNS (on Linux of course).
As I stated in digest 2042, "This is the final snag in
replacing our last NT server with a Samba machine".
Bye-bye NT!
Thank you to all of the Samba team for a great product
for the "open" software industry.
Thank you to all who use (and respond) to this list.
I hope my this helps some of you to overcome what I
fought with for months.
I am not trying to be an authority on Samba, but have
found what works for me. If any of the Samba team see
errors in what I have done, or good reasons not to do
something I have done, please correct me.
Sorry for the large mailing.
Although I always hate reading through them on the
mailing list, I thought somebody might benefit...
My abbreviated smb.conf (some things obviously changed):
;======================= Global Settings =====================================
[global]
debug level = 0
config file = /etc/smb.conf
workgroup = mydomain.com
comment = Samba Server
hosts allow = 192.168.0. 127.0.0.1
security = user
smb passwd file = /etc/smbpasswd
password level = 1
encrypt passwords = yes
printing = bsd
printcap name = /etc/printcap
load printers = yes
log file = /var/log/samba/%m
max log size = 50
short preserve case = yes
preserve case = yes
lock directory = /var/lock/samba
locking = yes
share modes = yes
read prediction = yes
socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
os level = 32
domain master = yes
name resolve order = host bcast
dead time = 15
;============================ Share Declarations ==============================
[database]
comment = Access Database
path = /mnt/drive2/database
public = no
read only = no
create mask = 0777
[public]
comment = Public Data
path = /mnt/drive2/public
public = yes
read only = no
users = @users
force group = users
write list = @users
map archive = yes
map hidden = yes
map system = yes
create mask = 0777
directory mask = 777
force create mode = 444
force directory mode = 444
[graphics]
comment = graphics drive
path = /mnt/drive2/graphics
public = no
writeable = yes
users = @users
force group = users
write list = @users
map archive = yes
map hidden = yes
map system = yes
create mask = 0777
directory mask = 777
force create mode = 444
force directory mode = 444
valid users = user1, user2, user3, user4
[HP3D]
comment = Tech area HP IIID
printer name = HP3D
printable = yes
browseable = yes
writeable = no
postscript = no
[FieryXJ]
comment = Color Xerox on EFI Fiery
printer name = FieryXJ
printable = yes
browseable = yes
writeable = no
postscript = yes
More information about the samba
mailing list