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:
Type | Dashboard UI | Description | Recovery Behavior |
---|---|---|---|
bytes_rate | Data Publish Rate per Client | Incoming message size in bytes per second | Pause receiving client messages |
messages_rate | Messages Publish Rate per Client | Incoming messages per second | Pause receiving client messages |
max_conn_rate | Maximum Connection Rate per Listener | Connections per second | Pause receiving new connections |
Limiter can work on the listener level, for example, to set a Limiter for the default TCP listener, you can work with the code below:
listeners.tcp.default {
bind = "0.0.0.0:1883"
max_conn_rate = "1000/s"
messages_rate = "1000/s"
bytes_rate = "1000MB/s"
}
TIP
EMQX has offered more configuration items to better serve customized needs, you can continue to read Configuration Manual.