1782
|
1 #summary Impose rate-limits on a MUC
|
|
2 #labels Stage-Beta
|
|
3
|
|
4 = Introduction =
|
|
5
|
|
6 This module allows you to control the maximum rate of 'events' in a MUC room. This makes it useful to prevent room floods (whether malicious or accidental).
|
|
7
|
|
8 = Details =
|
|
9
|
|
10 This module limits the following events:
|
|
11
|
|
12 * Room joins
|
|
13 * Nick changes
|
|
14 * Status changes
|
|
15 * Messages (including private messages)
|
|
16
|
|
17 The limit is for the room as a whole, not individual occupants in the room. Users with an affiliation (members, admins and owners) are not limited.
|
|
18
|
|
19 = Configuration =
|
|
20
|
|
21 Add the module to the MUC host (not the global modules_enabled):
|
|
22
|
|
23 {{{
|
|
24 Component "conference.example.com" "muc"
|
|
25 modules_enabled = { "muc_limits" }
|
|
26 }}}
|
|
27
|
|
28 You can define (globally or per-MUC component) the following options:
|
|
29
|
|
30 || *Name* || *Default value* || *Description* ||
|
|
31 || muc_event_rate || 0.5 || The maximum number of events per second. ||
|
|
32 || muc_burst_factor || 6 || Allow temporary bursts of this multiple. ||
|
|
33
|
|
34 For more understanding of how these values are used, see the algorithm section below.
|
|
35
|
|
36 = Algorithm =
|
|
37
|
|
38 A certain number of events are allowed per second, given by muc_event_rate. An event rate of 1 allows one event per second, and event rate of 3 allows three events per second, and 0.5 allows one event every two seconds, and so on.
|
|
39
|
|
40 Obviously MUC conversations are not exactly steady streams of events. Sometimes multiple people will talk at once. This is handled by the muc_burst_factor option.
|
|
41
|
|
42 A burst factor of 2 will allow 2 times as many events at once, for 2 seconds, before throttling will be triggered. A factor of 5, 5 times as many events for 5 seconds.
|
|
43
|
|
44 When the limit is reached, an error response will be generated telling the user the MUC is overactive, and asking them to try again.
|
|
45
|
|
46 = Compatibility =
|
|
47 || Trunk || Works ||
|
|
48 || 0.8 || Doesn't work`*` ||
|
|
49
|
|
50 `*` This module can be made to work in 0.8 (and _maybe_ previous versions) of Prosody by copying the new [http://hg.prosody.im/trunk/raw-file/fc8a22936b3c/util/throttle.lua util.throttle] into your Prosody source directory (into the util/ subdirectory). |