Skip to content

Rate Limiter

Limiter is a new feature introduced in EMQX 5.0, it is a mechanism to restrict the number of messages that a client or topic can publish or subscribe to in a specified time period. For more information on the Limiter and how it works, see Rate limit.

For the moment, you can restrict the message rates from the following perspectives:

TypeDashboard UIDescriptionRecovery Behavior
bytes_rateData Publish Rate per ClientIncoming message size in bytes per second per clientPause receiving client messages
messages_rateMessages Publish Rate per ClientIncoming messages per second per clientPause receiving client messages
max_conn_rateMaximum Connection Rate per ListenerConnections per second per listenerPause receiving new connections

For example, to set a limiter for the default TCP listener, you can work with the code below:

bash
listeners.tcp.default {
  bind = "0.0.0.0:1883"
  max_conn_rate = "1000/s"
  messages_rate = "1000/s"
  bytes_rate = "1MB/s"
}

TIP

EMQX has offered more configuration items to better serve customized needs, you can continue to read Configuration Manual.