1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
<!-- $Id: mod_fsync.html,v 1.1 2004/11/04 20:19:35 tj Exp tj $ -->
<!-- $Source: /home/tj/proftpd/modules/doc/RCS/mod_fsync.html,v $ -->
<html>
<head>
<title>ProFTPD module mod_fsync</title>
</head>
<body bgcolor=white>
<hr>
<center>
<h2><b>ProFTPD module <code>mod_fsync</code></b></h2>
</center>
<hr><br>
<p>
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.
<p>
The <code>mod_fsync</code> 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.
<p>
This module is contained in the <code>mod_fsync.c</code> file for ProFTPD
1.2.10rc1 and later, and is not compiled by default. Installation instructions
are discussed <a href="#Installation">here</a>.
<p>
The most current version of <code>mod_fsync</code> can be found at:
<pre>
<a href="http://www.castaglia.org/proftpd/">http://www.castaglia.org/proftpd/</a>
</pre>
<h2>Author</h2>
<p>
Please contact TJ Saunders <tj <i>at</i> castaglia.org> with any
questions, concerns, or suggestions regarding this module.
<h2>Directives</h2>
<ul>
<li><a href="#FsyncEngine">FsyncEngine</a>
<li><a href="#FsyncLog">FsyncLog</a>
<li><a href="#FsyncThreshold">FsyncThreshold</a>
</ul>
<hr>
<h2><a name="FsyncEngine">FsyncEngine</a></h2>
<strong>Syntax:</strong> FsyncEngine <em>on|off</em><br>
<strong>Default:</strong> FsyncEngine off<br>
<strong>Context:</strong> server config<br>
<strong>Module:</strong> mod_fsync<br>
<strong>Compatibility:</strong> 1.2.10rc1 and later
<p>
The <code>FsyncEngine</code> directive enables or disables the module's
runtime sync engine. If it is set to <em>off</em> this module does no
flushing of data outside of the normal I/O usage. Use this directive to
disable the module.
<p>
<hr>
<h2><a name="FsyncLog">FsyncLog</a></h2>
<strong>Syntax:</strong> FsyncLog <em>path</em><br>
<strong>Default:</strong> None<br>
<strong>Context:</strong> server config<br>
<strong>Module:</strong> mod_fsync<br>
<strong>Compatibility:</strong> 1.2.10c1 and later
<p>
The <code>FsyncLog</code> directive is used to a specify a log file for
<code>mod_fsync</code> reporting and debugging. The <em>path</em> parameter
must be the full path to the file to use for logging. Note that this path
must <b>not</b> be to a world-writeable directory and, unless
<code>AllowLogSymlinks</code> is explicitly set to <em>on</em>
(generally a bad idea), the path must <b>not</b> be a symbolic link.
<p>
<h2><a name="FsyncThreshold">FsyncThreshold</a></h2>
<strong>Syntax:</strong> FsyncThreshold <em>size</em><br>
<strong>Default:</strong> None<br>
<strong>Context:</strong> server config<br>
<strong>Module:</strong> mod_fsync<br>
<strong>Compatibility:</strong> 1.2.10rc1 and later
<p>
The <code>FsyncThreshold</code> directive configures a threshold value,
in bytes. When this number of bytes has been written,
<code>mod_fsync</code> will walk the list of files currently open for
writing, and will forcibly flush the data for those files to disk.
<p>
<b>Note</b>: This directive is required for <code>mod_fsync</code> to
operate.
<p>
<hr>
<h2><a name="Installation">Installation</a></h2>
To install <code>mod_fsync</code>, copy the <code>mod_fsync.c</code> file
into:
<pre>
<i>proftpd-dir</i>/contrib/
</pre>
after unpacking the latest proftpd-1.2.<i>x</i> source code. Then follow the
usual steps for using third-party modules in proftpd:
<pre>
./configure --with-modules=mod_fsync
make
make install
</pre>
<p>
<hr>
<h2><a name="Usage">Usage</a></h2>
<p>
<b>Example Configuration</b><br>
<pre>
<IfModule mod_fsync.c>
FsyncEngine on
FsyncLog /etc/ftpd/var/fsync.log
FsyncThreshold 131072 # 128KB
</IfModule>
</pre>
<p>
<hr><br>
Author: <i>$Author: tj $</i><br>
Last Updated: <i>$Date: 2004/11/04 20:19:35 $</i><br>
<br><hr>
<font size=2><b><i>
© Copyright 2004 TJ Saunders<br>
All Rights Reserved<br>
</i></b></font>
<hr><br>
</body>
</html>
|