From: Lars Bensmann on
Hello,

after having no problem with four Windows 2000 workstations and one Samba
2.something server for several years in a medical practice the practice
software (DocComfort) dropped support for Windows 2000 beginning of this
year. So I bought new hardware for the workstations and servers and
installed from scratch. Now there are four Windows 7 Professional 32bit
Workstations (with UAC disabled) and one Debian Lenny Server with Samba
from backports.org (I started with 3.4.3 (2:3.4.3-1~bpo50+2) and just now
upgraded to 3.4.5 (2:3.4.5~dfsg-1~bpo50+2), but this did not make a
difference).

The application works with a lot of database files (*.DBF) and everything
works fine if only one workstation has started the application. Getting
from the main menu to the data for the first patient takes about 3 to 5
seconds which is fine. But every station started after the first one takes
about 35 seconds to get to the data for the first patient. Once the
application is started further requests are fast. Unfortunately the
application cannot be open all the time, so there is always this 30 second
delay which is not acceptable.

I tried for a week to solve this problem but I'm running out of ideas.
My first guess was that this is probably a locking problem and this does
indeed seem to be the case. I disabled oplocks in smb.conf which
unfortunately only had the effect that then even the first station gets
hit with the 30 second penalty.

Tuning different parameters (read/write raw) had no noticable effect on
the delay.

Monitoring the activity in top shows that during these 30 seconds the smbd
process for the client is consuming all processing power it can get (on
one core).

Having set "loglevel = 2 locking:10" the log gets filled up with entries
like these:

[2010/03/05 20:04:30, 8] locking/posix.c:234(posix_fcntl_getlock)
posix_fcntl_getlock 105 4729736 242 0
[2010/03/05 20:04:30, 8] lib/util.c:1832(fcntl_getlock)
fcntl_getlock fd=105 offset=4729736 count=242 type=0
[2010/03/05 20:04:30, 3] lib/util.c:1856(fcntl_getlock)
fcntl_getlock: fd 105 is returned info 2 pid 0
[2010/03/05 20:04:30, 8] locking/posix.c:264(posix_fcntl_getlock)
posix_fcntl_getlock: Lock query call successful
[2010/03/05 20:04:30, 10] locking/brlock.c:1270(brl_locktest)
brl_locktest: posix start=4729736 len=242 unlocked for fnum 5219 file doc2/daten/deziff/EBM2000/ziffer.DBF
[2010/03/05 20:04:30, 10] locking/locking.c:152(strict_lock_default)
strict_lock_default: flavour = WINDOWS_LOCK brl start=4729736 len=242 unlocked for fnum 5219 file doc2/daten/deziff/EBM2000/ziffer.DBF
[2010/03/05 20:04:30, 10] locking/posix.c:284(is_posix_locked)
is_posix_locked: File doc2/daten/deziff/EBM2000/ziffer.DBF, offset = 4729978, count = 242, type = READ
[2010/03/05 20:04:30, 10] locking/posix.c:172(posix_lock_in_range)
posix_lock_in_range: offset_out = 4729978, count_out = 242

This repeats over and over. Only offset is increased by 242 each time.
These entries fill up the 1M log file in about 1 or 2 seconds.

I hope someone has an idea what I can do about this. The company
supporting the practice management application is no help at all and only
suggested switching to Windows Server which I really, really don't want to
do.

I followed the Samba Checklists and did all the test therin. Everything
was fine except two tests (Nr. 5 and 6). Could this be part of the
problem? Everything else is working fine. Domain logons are a bit on the
slow side, but acceptable. Copying large files from Samba to the clients
is at the limit of what's possible with the 100MBit network.

Thanks for any help or pointers to documentation that might help with this
problem,
Lars

Test nr. 5 fails:
$ nmblookup.samba3 -B HINTEN-PC '*'
added interface eth0 ip=fe80::e2cb:4eff:fe39:e8c2%eth0
bcast=fe80::ffff:ffff:ffff:ffff%eth0 netmask=ffff:ffff:ffff:ffff::
added interface eth0 ip=10.121.1.1 bcast=10.121.1.255
netmask=255.255.255.0
added interface lo ip=::1 bcast=::1
netmask=ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
added interface lo ip=127.0.0.1 bcast=127.255.255.255 netmask=255.0.0.0
querying * on 10.121.1.3
name_query failed to find name *

Test nr. 6 only returns the address of the server and no client addresses:
$ nmblookup.samba3 -d 2 '*'
added interface eth0 ip=fe80::e2cb:4eff:fe39:e8c2%eth0
bcast=fe80::ffff:ffff:ffff:ffff%eth0 netmask=ffff:ffff:ffff:ffff::
added interface eth0 ip=10.121.1.1 bcast=10.121.1.255
netmask=255.255.255.0
added interface lo ip=::1 bcast=::1
netmask=ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
added interface lo ip=127.0.0.1 bcast=127.255.255.255 netmask=255.0.0.0
querying * on 10.121.1.255
Got a positive name query response from 10.121.1.1 ( 10.121.1.1 )
10.121.1.1 *<00>

I also captured traffic with wireshark of one startup with no delay and
one startup were the application was already running on another
workstation. As this are too big for the mailing list (16MB and 26MB) I
put them up for download:
http://almosthappy.de/duhLd6Tm1GQoC3j0YyiJ637IS/capture.fast
http://almosthappy.de/duhLd6Tm1GQoC3j0YyiJ637IS/capture.slow
(These were captured with Samba 3.4.3.)

Here is some more output of my configuration:

$ uname -a
Linux server 2.6.26-2-amd64 #1 SMP Thu Feb 11 00:59:32 UTC 2010 x86_64 GNU/Linux

$ testparm.samba3
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[netlogon]"
Processing section "[DocExpert]"
Processing section "[profiles]"
Loaded services file OK.
Server role: ROLE_DOMAIN_PDC
Press enter to see a dump of your service definitions

[global]
workgroup = PRAXIS
server string = %h server
interfaces = eth0, lo
bind interfaces only = Yes
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
log level = 2 locking:10
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
time server = Yes
max open files = 10000
load printers = No
printcap name = /dev/null
disable spoolss = Yes
add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
logon script = logon.cmd
logon path = \\%N\profiles\%U
logon drive = P:
domain logons = Yes
os level = 255
preferred master = Yes
domain master = Yes
panic action = /usr/share/samba/panic-action %d
hosts allow = 10.121.1.1/24, 127.
hosts deny = ALL
printing = bsd
print command = lpr -r -P'%p' %s
lpq command = lpq -P'%p'
lprm command = lprm -P'%p' %j

[homes]
comment = Home Directories
valid users = %S
read only = No
create mask = 0700
directory mask = 0700
browseable = No
browsable = No

[netlogon]
comment = Network Logon Service
path = /home/samba/netlogon
guest ok = Yes

[DocExpert]
comment = Doc Expert
path = /home/samba/docexpert
read only = No
create mask = 0660
force create mode = 0660
directory mask = 0770
force directory mode = 0770

[profiles]
comment = Network Profiles Share
path = /home/samba/profiles
read only = No
create mask = 0600
directory mask = 0700
hide files = /desktop.ini/outlook*.lnk/*Briefcase*/
store dos attributes = Yes
browseable = No
browsable = No


--
I waited and waited and when no message came I knew it must be from you.
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba