mod_limits

This module adds rate-limiting for XMPP sessions, limiting excessive bandwidth usage by clients and remote servers.

Usage

    modules_enabled = {
        -- Other modules
        "limits"; -- Enable rate-limiting module
    }

Extra configuration required to enable the limits is described below.

Configuration

Option Default Notes
limits {} Sets the limits for each session type
limits_resolution 1 Sets the time that an over-limit session is suspended for
unlimited_jids {} Set of JIDs exempt from limits (added in 0.12)

Currently mod_limits is configured per connection type. The possible connection types are:

  • c2s
  • s2sin
  • s2sout
  • component

The limits are specified like so in the global section of your config (they cannot be per-host):

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.