Fileserver: Don't sync every 10 seconds
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Mon, 17 May 2010 19:15:46 +0000 (20:15 +0100)
committerDerrick Brashear <shadow@dementia.org>
Tue, 18 May 2010 13:08:30 +0000 (06:08 -0700)
commit5ea24a7c5534b4fda7904284d21d34b6e52a3f27
treede4caf03a07956bfae79423eea4077899d49902e
parent54bf41004b901ca090d63e239768588fa90bc806
Fileserver: Don't sync every 10 seconds

The patch which moved our calls to fsync into the background, added
a sync prior to each batch of fsync calls. This is an incredibly bad
idea.

POSIX says that sync "shall cause all information in memory that
updates file systems to be scheduled for writing out to all file
systems". On Linux this means that we in effect perform an fsync()
on every open filehandle on the entire system, and in addition flush
all superblocks and journals out to disk. This makes the following
fsync() calls superfluous - sync() will have already written out
all of the data.

Add to this the fact that the fileserver is doing this every 10
seconds, and this becomes a major performance bottleneck,
particularly if the machine uses a journalled fs - as any disk
operations will end up blocking whilst the journal is written to
disk.

Change-Id: Id06cb99ae83af2e4a82e7b20fb14b8457dc16883
Reviewed-on: http://gerrit.openafs.org/1977
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Rainer Toebbicke <rtb@pclella.cern.ch>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/vol/ihandle.c