annotate mod_limits.wiki @ 352:31eb570f6bc0

Add alpha label
author Kim Alvefur <zash@zash.se>
date Mon, 13 May 2013 20:02:51 +0200
parents 5999d2eb2149
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
289
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
1 #summary Connection-level rate limiting
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
2 #labels Stage-Beta
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
3
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
4 = Introduction =
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
5
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
6 On some servers, especially public ones, it is desired to make sure that everyone gets their fair share of system resources (and no more).
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
7
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
8 mod_limits allows you to specify traffic bandwidth limits, preventing any single connection hogging the server's CPU, RAM and bandwidth.
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
9
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
10 = Details =
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
11
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
12 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.
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
13
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
14 = Configuration =
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
15 Currently mod_limits is configured per connection type. The possible connection types are:
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
16
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
17 * c2s
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
18 * s2sin
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
19 * s2sout
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
20 * component
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
21
290
d4e87d2b4ba1 Edited wiki page mod_limits through web user interface.
MWild1@gmail.com
parents: 289
diff changeset
22 The limits are specified like so in the *global* section of your config (they cannot be per-host):
289
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
23
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
24 {{{
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
25 limits = {
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
26 c2s = {
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
27 rate = "3kb/s";
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
28 burst = "2s";
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
29 };
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
30 s2sin = {
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
31 rate = "10kb/s";
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
32 burst = "5s";
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
33 };
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
34 }
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
35 }}}
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
36
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
37 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.
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
38
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
39 = Compatibility =
291
5999d2eb2149 Fix compatibility info
MWild1@gmail.com
parents: 290
diff changeset
40 || 0.9 || Works ||
5999d2eb2149 Fix compatibility info
MWild1@gmail.com
parents: 290
diff changeset
41 || 0.8 || Doesn't work(`*`) ||
289
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
42
291
5999d2eb2149 Fix compatibility info
MWild1@gmail.com
parents: 290
diff changeset
43 (`*`) This module can be made to work in 0.8 if you do two things:
5999d2eb2149 Fix compatibility info
MWild1@gmail.com
parents: 290
diff changeset
44
289
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
45 # Install [http://hg.prosody.im/0.9/raw-file/d46948d3018a/util/throttle.lua util.throttle] into your Prosody source's util/ directory.
f777a248b321 New wiki page for mod_limits
MWild1@gmail.com
parents:
diff changeset
46 # If you use libevent apply [http://prosody.im/patches/prosody08-mod-limits-fix.patch this patch] to net/server_event.lua.