oplocks causing more trouble than benefit ?

Marcello Romani mromani at ottotecnica.com
Thu Nov 9 07:13:21 GMT 2006

Volker Lendecke ha scritto:
> On Tue, Nov 07, 2006 at 01:42:57PM +0100, Marcello Romani wrote:
>> I didn't notice any slowdown after disabling oplocks, but this might be
>> because our network and fileserver are usually underloaded.
> How did you measure it? Clients tend to behave radically
> differently if oplocks are granted. In particular you will
> see a lot less round-trips for opening/closing files.

I didn't actually measure anything. I just saw no slowdown in everyday use.
This is of course by no means an objective "measure". I only meant to
say that in our setup oplocks are probably not needed in the first place.

>> So my question is: why are oplocks on by default ? Wouldn't it be safer 
> Because they reduce load on the server and make client
> operations faster.

We have an hyperthreaded 3G+ Pentium IV server with 2 raid1 scsi drives
and 1GB RAM. Most of the time it's waiting for something to happen.
Several hundred megs are system cache.
I don't really see a point in lowering the load on this server.

I don't mean oplocks are useless: I just say that in our setup they
don't provide any benefit as we are already underloaded.
OTOH, they've proved troublesome in some circustances.

>> (and more trouble-free) to turn them off by default and specify under 
>> which circumstances they might give the performance improvements that 
>> justify their adoption ?
> I don't think that oplocks per se are unsafe. If you google
> for oplock problems then you will see that 99% of problems
> with oplocks have to do with network problems that Samba can
> not do much against.

As I said im my op, our problems were _not_ caused by the network, it
was the client PC that was occasionally freezing.

> Volker

Marcello Romani
Responsabile IT
Ottotecnica s.r.l.

More information about the samba-technical mailing list