Bug #601
major samba slow down in R6/no log files
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | jams | % Done: | 0% |
|
Category: | - | Spent time: | - | |
Target version: | - |
Description
Xfers via SAMBA slow by a factor 25x compared to sftp under R6. When I sftp files from my Linux workstation to my R6 box, speeds are on the order of 50-55 MB/sec. When I xfer via samba I'm lucky if they hit 2 MB/sec. I also have Arch-i686 on my R6 box - on the same hardrive on an 8 gig partition (/dev/sda4). When I boot into Arch on the R6 box and use samba, xfers are in the 50-55 MB/sec range so there is clearly something amiss with the samba/samba conf that R6 is using.
Here is my R6 smb.conf
#======================= Global Settings =====================================
[global]
workgroup = WORKGROUP
server string = mythtv
socket options = TCP_NODELAY
# Security mode. Defines in which mode Samba will operate. Possible
# values are share, user, server, domain and ads. Most people will want
# user level security. See the Samba-HOWTO-Collection for details.
security = share
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
hosts allow = 192.168.1. 127.
load printers = no
# you may wish to override the location of the printcap file
; printcap name = /etc/printcap
; guest account = pcguest
# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
# Put a capping on the size of the log files (in Kb).
max log size = 50
# Use password server option only with security = server
# The argument list may include:
# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
# or to auto-locate the domain controller/s
# password server = *
; password server = <NT-Server-Name>
# Use the realm option only with security = ads
# Specifies the Active Directory realm the host is part of
; realm = MY_REALM
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.
; passdb backend = tdbsam
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting.
# Note: Consider carefully the location in the configuration file of
# this line. The included file is read at that point.
; include = /usr/local/samba/lib/smb.conf.%m
# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
; interfaces = 192.168.12.2/24 192.168.13.2/24
# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
; local master = no
# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
; os level = 33
# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
; domain master = yes
# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
; preferred master = yes
# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
; domain logons = yes
# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
; logon script = %m.bat
# run a specific logon batch file per username
; logon script = %U.bat
# Where to store roving profiles (only for Win95 and WinNT)
# %L substitutes for this servers netbios name, %U is username
# You must uncomment the [Profiles] share below
; logon path = \\%L\Profiles\%U
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
; wins support = yes
# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z
# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one WINS Server on the network. The default is NO.
; wins proxy = yes
# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The default is NO.
dns proxy = no
# These scripts are used on a domain controller or stand-alone
# machine to add or delete corresponding unix accounts
; add user script = /usr/sbin/useradd %u
; add group script = /usr/sbin/groupadd %g
; add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
; delete user script = /usr/sbin/userdel %u
; delete user from group script = /usr/sbin/deluser %u %g
; delete group script = /usr/sbin/groupdel %g
#============================ Share Definitions ==============================
include = /home/mythtv/templates/user.shares
include = /etc/samba/smb.conf.media
Here is my Arch smb.conf (remember this runs on the same exact box as R6):
[global]
workgroup = test
server string = test
security = user
hosts allow = 192.168.1. 127.
log file = /var/log/samba/%m.log
max log size = 50
socket options = TCP_NODELAY
[myth]
comment = files
path = /myth
valid users = hope
force user = hope
force group = hope
writable = yes
create mask = 0755
I would include a log file but /var/log/samba is empty!
Link to discussion thread: http://knoppmyth.net/phpBB2/viewtopic.php?p=125924
History
Updated by graysky almost 15 years ago
I removed my custom MTU size from the service screen (I was using jumbo frame size of 4000) and I added the following to my /etc/rc.local and after a reboot, I'm back up to the usual 50-ish MB/sec on xfers.
. /etc/rc.d/functions
stat_busy "Setting 4k Jumbo Frames"
/sbin/ifconfig eth0 mtu 4000
stat_done
Can anyone on the dev team explain how the user entered value from the service menu gets parsed and entered into the system? I can't explain this behavior but I can confirm that is it reproducible. In other words, if I add the custom size into the service menu and reboot, the same horrible speeds are back.
P.S. I still don't have any log files out of samba.
Updated by jams almost 15 years ago
Are you certain that the mtu is being set by the lines added in rc.local?
You can check the mtu by running ifconfig and looking for the mtu in the output.
Updated by graysky almost 15 years ago
@jams - Damn. you're right. LH doesn't seem to be reading my /etc/rc.local at all. `ifconfig eth0` shows the default mtu size of 1500. The odd thing is that when I set the mtu to 4000 manually from the shell (eg `ifconfig eth0 mtu 4000`), my samba xfer speeds are back in the 50-55 MB/s range:
{{http://img686.imageshack.us/img686/8140/samba.jpg}}
If I go back to the service menu and setup the mtu size there (and reboot), they drop down to the 1-2 MB/sec:
{{http://img192.imageshack.us/img192/8518/screenshot2ek.png}}
I found that the value I enter into the service menu's mtu field gets placed into /etc/net/ifaces/eth0/iplink. This some how differs from setting it via the ifconfig command. I have a temporary workaround by having ~/.fluxbox/apps call a one line script that sets the mtu to 4000. Two questions: #1 Why doesn't LH honor any lines I enter into /etc/rc.local? #2 Any ideas why my samba doesn't give log files?
$ ls -l /var/log/samba
total 4
drwx------ 4 root root 4096 2009-12-19 11:14 cores
Updated by mihanson almost 15 years ago
@graysky: Put any custom startup scripts/routines in /etc/runit/1.local (That's One[dot]local)
Updated by graysky almost 15 years ago
@mh - thanks for the reminder about /etc/runit/1.local. You have any thoughts as to my lack of log files?
Updated by nharris almost 15 years ago
To get log files, edit the file /etc/sv/smbd/run.
change the line:
exec smbd -F -S -d3 2>/dev/null >/dev/null
to:
exec smbd -F 2>/dev/null >/dev/null
Updated by graysky almost 15 years ago
@nharris - cool, log files are enabled, thanks! Is it normal to have entries complaining about CUPS?
$ cat /var/log/samba/smbd.log
[2010/01/07 16:41:08, 0] printing/print_cups.c:cups_connect(103)
Unable to connect to CUPS server localhost:631 - Connection refused
[2010/01/07 16:41:08, 0] printing/print_cups.c:cups_connect(103)
Unable to connect to CUPS server localhost:631 - Connection refused
[2010/01/07 16:41:08, 0] smbd/server.c:main(1313)
standard input is not a socket, assuming -D option
Updated by nharris almost 15 years ago
@graysky: Yep. Ignore the cups stuff... no print services in LinHES (that I know of). Should probably edit the smb.conf to disable printing.
Updated by graysky almost 15 years ago
@nharris - I don't have any print services defined in my config. Is one assumed until implicitly disabled?
[global]
workgroup = media
server string = mythtv
security = user
hosts allow = 192.168.1. 127.
log file = /var/log/samba/%m.log
max log size = 50
socket options = TCP_NODELAY
[myth]
comment = myth files
path = /myth
valid users = mythtv
force user = mythtv
force group = mythtv
writable = yes
create mask = 0755
Updated by nharris almost 15 years ago
@graysky: Yes and cups is the default.
Adding this to your [global] may get rid of the cups warning messages. Everything should work either way.
load printers = no
You may also need to add the lines below. This is the old way to do it (it's been a long time since I messed with samba much), but the newer version of samba might do all this by default when you disable loading printers.
printing = bsd
printcap name = /dev/null
disable spoolss = yes
Updated by jams over 14 years ago
@graysky..are you still having this problem?
Updated by graysky over 14 years ago
@jams - nope, logging is fine after nharris' mod in the ticket. I still get the print server errors though.
Updated by jams over 14 years ago
updated to 3.4.5
removed cups printing/changed to bsd
moved control of logging to conf file, this could have accounted for some slowness.