# HG changeset patch # User MWild1@gmail.com # Date 1341579553 0 # Node ID f777a248b32186253939e7083e314a837e81b776 # Parent 118f44d63e25344d4956d5621a4dc6e593b436cf New wiki page for mod_limits diff -r 118f44d63e25 -r f777a248b321 mod_limits.wiki --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_limits.wiki Fri Jul 06 12:59:13 2012 +0000 @@ -0,0 +1,45 @@ +#summary Connection-level rate limiting +#labels Stage-Beta + += Introduction = + +On some servers, especially public ones, it is desired to make sure that everyone gets their fair share of system resources (and no more). + +mod_limits allows you to specify traffic bandwidth limits, preventing any single connection hogging the server's CPU, RAM and bandwidth. + += Details = + +mod_limits detects when a connection has exceeded its traffic allowance and temporarily ignores a connection. Due to the way TCP and the OS's network API works no data is lost, only slowed. + += Configuration = +Currently mod_limits is configured per connection type. The possible connection types are: + + * c2s + * s2sin + * s2sout + * component + +The limits are specified like so: + +{{{ + limits = { + c2s = { + rate = "3kb/s"; + burst = "2s"; + }; + s2sin = { + rate = "10kb/s"; + burst = "5s"; + }; + } +}}} + +All units are in terms of _bytes_, not _bits_, so that "kb/s" is interpreted as "kilobytes per second", where a kilobyte is 1000 bytes. + += Compatibility = +| 0.9 | Works | +| 0.8 | Doesn't work(*) | + +(*) This module can be made to work in 0.8 if you do two things: + # Install [http://hg.prosody.im/0.9/raw-file/d46948d3018a/util/throttle.lua util.throttle] into your Prosody source's util/ directory. + # If you use libevent apply [http://prosody.im/patches/prosody08-mod-limits-fix.patch this patch] to net/server_event.lua. \ No newline at end of file