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


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

Extra configuration required to enable the limits is described below.


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.0)

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.

A set of users to be exempted from limits can be specified in unlimited_jids. If present in both the Global section and the relevant VirtualHost section, both are merged.