On some kernels and/or filesystems, if there are files opened simultaneously for reading and writing, the buffer cache algorithms may cause the write I/O to swamp the read I/O, causing processes that are reading files to slow down because of buffer cache misses. The Linux 2.4 kernel, for example, suffers from this problem.
mod_fsync module attempts to prevent such bottlenecks
by forcibly flushing to disk the buffers used for files open for writing
after a certain number of bytes have been written (for example, after
128 KB has been written to a file). This prevents the buffer cache from
being dominated by data from files being written, freeing up space for
data for files being read.
This module is contained in the
mod_fsync.c file for ProFTPD
1.2.10rc1 and later, and is not compiled by default. Installation instructions
are discussed here.
The most current version of
mod_fsync can be found at:
Please contact TJ Saunders <tj at castaglia.org> with any questions, concerns, or suggestions regarding this module.
FsyncEngine directive enables or disables the module's
runtime sync engine. If it is set to off this module does no
flushing of data outside of the normal I/O usage. Use this directive to
disable the module.
FsyncLog directive is used to a specify a log file for
mod_fsync reporting and debugging. The path parameter
must be the full path to the file to use for logging. Note that this path
must not be to a world-writeable directory and, unless
AllowLogSymlinks is explicitly set to on
(generally a bad idea), the path must not be a symbolic link.
FsyncThreshold directive configures a threshold value,
in bytes. When this number of bytes has been written,
mod_fsync will walk the list of files currently open for
writing, and will forcibly flush the data for those files to disk.
Note: This directive is required for
mod_fsync, copy the
proftpd-dir/contrib/after unpacking the latest proftpd-1.2.x source code. Then follow the usual steps for using third-party modules in proftpd:
./configure --with-modules=mod_fsync make make install
<IfModule mod_fsync.c> FsyncEngine on FsyncLog /etc/ftpd/var/fsync.log FsyncThreshold 131072 # 128KB </IfModule>