| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ProFTPD module mod_load</title> |
| 5 | </head> |
| 6 | |
| 7 | <body bgcolor=white> |
| 8 | |
| 9 | <hr> |
| 10 | <center> |
| 11 | <h2><b>ProFTPD module <code>mod_load</code></b></h2> |
| 12 | </center> |
| 13 | <hr><br> |
| 14 | |
| 15 | This module is contained in the <code>mod_load.h</code> and |
| 16 | <code>mod_load.c</code> files for ProFTPD 1.2.<i>x</i>, and is not compiled by |
| 17 | default. Installation instructions are discussed |
| 18 | <a href="#Installation">here</a>. There are also some interesting notes |
| 19 | on the <a href="#Usage">usage</a> of this module. |
| 20 | |
| 21 | <p> |
| 22 | The code for determining load average on a given system is hairy, to say the |
| 23 | least. Unfortunately, it is necessary to do it this way, as there is no |
| 24 | standard method for extracting such information from the kernel. This module |
| 25 | uses code from GNU's <code>make</code> application, which should function |
| 26 | properly. If not, please contact the author as soon as possible. |
| 27 | |
| 28 | <p> |
| 29 | The most current version of <code>mod_load</code> is distributed with the |
| 30 | ProFTPD source code. |
| 31 | |
| 32 | <h2>Author</h2> |
| 33 | <p> |
| 34 | Please contact TJ Saunders <tj <i>at</i> castaglia.org> with any |
| 35 | questions, concerns, or suggestions regarding this module. |
| 36 | |
| 37 | <h2>Directives</h2> |
| 38 | <ul> |
| 39 | <li><a href="#MaxLoad">MaxLoad</a> |
| 40 | </ul> |
| 41 | |
| 42 | <hr> |
| 43 | <h3><a name="MaxLoad">MaxLoad</a></h3> |
| 44 | <strong>Syntax:</strong> MaxLoad <em>number|"none" [message]</em><br> |
| 45 | <strong>Default:</strong> None<br> |
| 46 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 47 | <strong>Module:</strong> mod_load<br> |
| 48 | <strong>Compatibility:</strong> 1.2.2 and later |
| 49 | |
| 50 | <p> |
| 51 | The <code>MaxLoad</code> directive configures the server to refuse to accept |
| 52 | connections if the system load is at or above the configured number. An |
| 53 | optional message can be specified, which will be displayed to clients who have |
| 54 | been rejected. The rejection is also logged. |
| 55 | |
| 56 | <p> |
| 57 | The number can also be "none", which is used to override any |
| 58 | inherited load limits, as from a <code><Global></code> context. |
| 59 | |
| 60 | <p> |
| 61 | The system load is the average number of processes ready to run during the |
| 62 | last minute; this number varies from system to system. |
| 63 | |
| 64 | <p> |
| 65 | Example: |
| 66 | <pre> |
| 67 | # Reject connections to our busy server |
| 68 | MaxLoad 10.0 "Server busy, seek elsewhere" |
| 69 | </pre> |
| 70 | |
| 71 | <p> |
| 72 | <hr> |
| 73 | <h2><a name="Usage">Usage</a></h2> |
| 74 | <p> |
| 75 | The <code>mod_load</code> module is very straightforward, providing only |
| 76 | the single configuration directive. |
| 77 | |
| 78 | <p> |
| 79 | <b><code>Display</code> Variables</b><br> |
| 80 | The following variables are provided by <code>mod_load</code>, and |
| 81 | can be used in any <code>Display</code> file <i>e.g.</i> |
| 82 | <code>DisplayConnect</code> and <code>DisplayLogin</code>. |
| 83 | <pre> |
| 84 | %{mod_load.curr_load} |
| 85 | %{mod_load.max_load} |
| 86 | </pre> |
| 87 | |
| 88 | <p> |
| 89 | <hr> |
| 90 | <h2><a name="Installation">Installation</a></h2> |
| 91 | To install <code>mod_load</code>, follow the usual steps for using third-party |
| 92 | modules in ProFTPD: |
| 93 | <pre> |
| 94 | $ ./configure --with-modules=mod_load |
| 95 | $ make |
| 96 | $ make install |
| 97 | </pre> |
| 98 | |
| 99 | <p> |
| 100 | <hr> |
| 101 | <font size=2><b><i> |
| 102 | © Copyright 2000-2005 TJ Saunders<br> |
| 103 | All Rights Reserved<br> |
| 104 | </i></b></font> |
| 105 | <hr> |
| 106 | |
| 107 | </body> |
| 108 | </html> |