Samba slow (sometimes)

Have searched a bit and not seen this one so…

I have an OpenSuse11.1 server recently upgraded from 10.2 having previously been SLES9, running Samba.

From a WinXP w/s I can map the shared drives and read/write/create.

I do Delphi development which has quite a few files open on one of the shares and writes at unknown times (like if I set a breakpoint it seems).

Problem is, I get sporadic delays of 10secs-or-so before a file responds. This seems to be observable in Explorer as well on occasions - most times (perhaps when listings are cached?) it is very fast. It happens every time I open a Delphi project and often when viewing a file for the first time. If I build the project, the delays are multiplied so it becomes intolerable.

I suspect that writes may be being delayed for some reason. Only had the problem since re-install with 11.1.

I pinched some smb.conf lines from this forum that sounded promising, but to no effect.

Any ideas please?

P.S. Since fiddling with the configuration I am now getting Windows warnings of ‘Delayed write failures’ on another application that writes log files to the same server.

On Fri June 11 2010 06:06 am, Chrisharwood wrote:

>
> Have searched a bit and not seen this one so…
>
> I have an OpenSuse11.1 server recently upgraded from 10.2 having
> previously been SLES9, running Samba.
>
> From a WinXP w/s I can map the shared drives and read/write/create.
>
> I do Delphi development which has quite a few files open on one of the
> shares and writes at unknown times (like if I set a breakpoint it
> seems).
>
> Problem is, I get sporadic delays of 10secs-or-so before a file
> responds. This seems to be observable in Explorer as well on occasions
> - most times (perhaps when listings are cached?) it is very fast. It
> happens every time I open a Delphi project and often when viewing a file
> for the first time. If I build the project, the delays are multiplied
> so it becomes intolerable.
>
> I suspect that writes may be being delayed for some reason. Only had
> the problem since re-install with 11.1.
>
> I pinched some smb.conf lines from this forum that sounded promising,
> but to no effect.
>
> Any ideas please?
>
> P.S. Since fiddling with the configuration I am now getting Windows
> warnings of ‘Delayed write failures’ on another application that writes
> log files to the same server.
>
>
Chrisharwood;

It might help to see the contents of the [global] section of
your /etc/samba/smb.conf. Conceal any sensitive values such as public IPs
with substitute values.


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

smb.conf (mildly edited)…

# Samba config file created using SWAT
# from UNKNOWN ()
# Date: 2010/06/11 11:29:31

[global]
	netbios name = LINUX2
	map to guest = Bad User
	name resolve order = bcast host lmhosts wins
	socket options = SO_KEEPALIVE TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192
	printcap name = cups
	add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
	logon path = \\%L\profiles\.msprofile
	logon drive = P:
	logon home = \\%L\%U\.9xprofile
	preferred master = Yes
	domain master = No
	idmap uid = 1000-20000
	idmap gid = 1000-20000
	cups options = raw

[homes]
	comment = Home Directories
	valid users = %S, %D%w%S
	read only = No
	inherit acls = Yes
	browseable = No
<snip>

[general]
	comment = General files on Samba
	path = /mnt/General/
	read only = No
	inherit acls = Yes
	write cache size = 1024

<snip>

Thanks for your reply:)

Chris

On Fri June 11 2010 11:36 am, Chrisharwood wrote:

>
> smb.conf (mildly edited)…
>
>
> Code:
> --------------------
> # Samba config file created using SWAT
> # from UNKNOWN ()
> # Date: 2010/06/11 11:29:31
>
> [global]
> netbios name = LINUX2
> map to guest = Bad User
> name resolve order = bcast host lmhosts wins
> socket options = SO_KEEPALIVE TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192
SO_RCVBUF=8192
> printcap name = cups
> add machine script = /usr/sbin/useradd -c
Machine -d /var/lib/nobody -s /bin/false %m$
> logon path = \%L\profiles.msprofile
> logon drive = P:
> logon home = \%L%U.9xprofile
> preferred master = Yes
> domain master = No
> idmap uid = 1000-20000
> idmap gid = 1000-20000
> cups options = raw
>
> [homes]
> comment = Home Directories
> valid users = %S, %D%w%S
> read only = No
> inherit acls = Yes
> browseable = No
> <snip>
>
> [general]
> comment = General files on Samba
> path = /mnt/General/
> read only = No
> inherit acls = Yes
> write cache size = 1024
>
> <snip>
> --------------------
>
>
> Thanks for your reply:)
>
> Chris
>
>
Chris;

For modern kernels, the only socket option that makes much sense is
TCP_NODELAY, which is the default. In fact setting “SO_RCVBUF=8192” is
reported to be down right harmful.
See the writeup on Socket Options here:
http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/speed.html

I’m not sure about setting the write cache size. You might want to play with
that to see if it really makes a difference and look at different sizes. e.g.
266144 for a 256k write cache. I would tend to leave it out, but it may make
a difference in your situation.

Under certain conditions the disabling oplocks can improve performance, i.e.
multi user data bases. See the write up on Oplocks here:
http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/locking.html

Be a bit careful about what you pickup from Google, some of these entries go
back to the days of Samba2. Many are just plain outdated or wrong. Even
the Official HowTo cited above is getting a little long in the tooth.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Thanks for the advice. I’ll strip out what’s not needed. I actually copied those settings off this site <G>!

There’s nothing like asking someone for making you see the light. I had lmhosts enabled on the Xp w/s and the server name had changed with the version-up. Disabled it and we are flying (for now).

Thanks again

Chris