Changes

From SME Server
Jump to navigationJump to search
2,053 bytes added ,  21:25, 13 April 2019
Created page with "<span id="_top">Qpsmtpd#Plugins</span> = NAME = loadcheck = DESCRIPTION = Only takes email transactions if the system load is at or below a spec..."
<span id="_top">[[Qpsmtpd#Plugins]]</span>
= [[#___top|NAME]] =

loadcheck

= [[#___top|DESCRIPTION]] =

Only takes email transactions if the system load is at or below a specified level.

If this is running on a system that provides /kern/loadavg or /proc/loadavg it will be used instead of the 'uptime' command.

Once a load value is determined, it is cached for a period of time. See the cache_time below.

Since fork/exec is expensive in perl, if using the 'uptime' method, use cache_time to avoid increasing your load on every connection.

= [[#___top|CONFIG]] =

max_load

<pre> This is the 1 minute system load where we won't take transactions
if our load is higher than this value. (Default: 7)</pre>
cache_time

<pre> A recently determined load value will be cached and used for the
assigned number of seconds. (Default: 10)</pre>
uptime

<pre> The path to the command 'uptime' if different than the default.
(Default: /usr/bin/uptime)</pre>
Example:

loadcheck cache_time 30

loadcheck max_load 7 uptime /usr/bin/uptime

= [[#___top|SEE ALSO]] =

Original version: http://www.nntp.perl.org/group/perl.qpsmtpd/2006/01/msg4422.html

Variant with caching: http://www.nntp.perl.org/group/perl.qpsmtpd/2006/03/msg4710.html

Steve Kemp's announcement of an alternate load limiter: http://www.nntp.perl.org/group/perl.qpsmtpd/2008/03/msg7814.html

= [[#___top|AUTHOR]] =

Written by Peter Eisch &lt;peter@boku.net&gt;.

= [[#___top|CHANGES]] =

v0.03 - msimerson - 2014-03-21

<pre> * refactored &quot;find the way to get load avg&quot; out of loadcheck (every
connection) into get_load_method which is run in register. If we can't
get the load average, don't register the hook.

* added BSD::getloadavg method (tested on FreeBSD)</pre>
v0.02 - github@rsiddall - resurrected from list archives

<!-- Generated Sat Apr 13 15:24:18 EDT 2019 using
perldoc -T -ohtml $plugins/$1 \|pandoc -f html -t mediawiki \|sed '1 i\\n\n\n<span id="_top">[[Qpsmtpd#Plugins]]</span>' \|sed -e 's#</d.>##'
-->
----
[[Category:Qpsmtpd|loadcheck]]

Navigation menu