[Mimedefang] flock vs. fcntl

David F. Skoll dfs at roaringpenguin.com
Wed Nov 15 15:18:35 EST 2006


Jason Bertoch [Electronet] wrote:

> I googled for info on these two locking methods and am hard up to
> find any recent information on which to use on my RedHat and Fedora
> systems.  It appears that fnctl works better for NFS but is there a
> performance difference for local file systems?  Does the above
> suggestion apply to MD, Sendmail, or for all software compiled on my
> system?  If only MD, is that set at compile time, or in the filter?

I believe the lock_method is used by SpamAssassin to lock the Bayes
databases.  flock is older and fcntl is more POSIX-standard.

As for performance differences, I don't think you'll see any.  What
with all the horrible SpamAssassin code, six bazillian DNS lookups for
URIBL rules, etc., the difference in overhead between flock and fcntl
will almost certainly be unnoticeable.

Note, however, that if you have different programs locking the same
file, they had better all use the same method, because on Linux
at least, flock locks and fcntl locks are completely separate.

Regards,

David.



More information about the MIMEDefang mailing list