Skip to content

Commit 493a053

Browse files
Meggielqkwivwiv
authored andcommitted
fix(mqtt config): Update Keep Alive Settings in v5.6
1 parent 9c0fa1e commit 493a053

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

en_US/configuration/mqtt.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,17 @@ Where,
9292

9393
## Keep Alive Settings
9494

95-
Keep Alive is the mechanism that ensures that a connection between an MQTT client and EMQX remains active even if no data is transmitted. This is how it works: when an MQTT client creates a connection to EMQX, it can set the Keep Alive variable header field in the connection request protocol packet to a non-zero value. For details about how Keep Alive works, see [What is the MQTT Keep Alive parameter for?](https://www.emqx.com/en/blog/mqtt-keep-alive).
95+
The Keep Alive is a Two Byte Integer, a time interval measured in seconds. It is a mechanism to ensure that an MQTT client and EMQX connection remain active even if no data is transmitted. When an MQTT client establishes a connection with EMQX, setting a non-zero value in the Keep Alive variable header field of the CONNECT packet can enable the Keep Alive mechanism between both parties. For details about how Keep Alive works, see [What is the MQTT Keep Alive parameter for?](https://www.emqx.com/en/blog/mqtt-keep-alive).
9696

97-
For clients with Keep Alive enabled, you can continue to customize the coefficient EMQX uses to confirm whether the keep alive duration of the client expires.
97+
According to the MQTT 5.0 protocol, for clients with Keep Alive enabled, if the server does not receive an MQTT Control Packet from the client within 1.5 times the Keep Alive duration, it must close the network connection with the client. Therefore, EMQX introduces a configuration option `keepalive_multiplier` to periodically check clients' Keep Alive timeout status. The default value for `keepalive_multiplier` is `1.5`:
9898

9999
```bash
100-
keepalive_backoff = 0.75
100+
keepalive_multiplier = 1.5
101101
```
102102

103-
Where, **Keep Alive Backoff** (`keepalive_backoff`) is the coefficient EMQX uses to confirm whether the keep alive duration of the client expires. Default: `0.75`. The calculation formular is as follows:
103+
The timeout calculation formula is as follows:
104104
$$
105-
Keep Alive * Backoff * 2
105+
\text{Keep Alive} \times \text{keepalive\_multiplier}
106106
$$
107107

108108
## Session Settings

zh_CN/configuration/mqtt.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,17 @@ delay {
9090

9191
## Keep Alive 设置
9292

93-
Keep Alive 是一种机制,确保即使没有数据传输,MQTT 客户端和 EMQX 之间的连接仍然保持活动。其工作原理如下:当 MQTT 客户端创建到 EMQX 的连接时,可以在连接请求协议包的 Keep Alive 变量头字段中设置非零值。有关 Keep Alive 工作原理的详细信息,请参见 [MQTT 协议 Keep Alive 详解](https://www.emqx.com/zh/blog/mqtt-keep-alive)
93+
Keep Alive 是是一个两字节整数,表示以秒为单位的时间间隔。它是一种机制,确保即使没有数据传输,MQTT 客户端和 EMQX 之间的连接仍然保持活动。当 MQTT 客户端创建和 EMQX 的连接时,在连接请求协议包的 Keep Alive 变量头字段中设置非零值就可以在通信双方之间启用 Keep Alive 机制。有关 Keep Alive 工作原理的详细信息,请参见 [MQTT 协议 Keep Alive 详解](https://www.emqx.com/zh/blog/mqtt-keep-alive)
9494

95-
对于启用了 Keep Alive 的客户端,您可以继续自定义 EMQX 用来确认客户端 Keep Alive 时长是否过期的系数。
95+
根据 MQTT 5.0 协议,对于启用了 Keep Alive 的客户端,如果服务器在 Keep Alive 时长的 1.5 倍时间内没有收到来自客户端的 MQTT 控制报文,它必须关闭与客户端的网络连接。因此,EMQX 引入了一个配置项 `keepalive_multiplier`,用来周期性地检查客户端的 Keep Alive 超时状态。`keepalive_multiplier` 的默认值是 `1.5`
9696

97-
```bash
98-
keepalive_backoff = 0.75
97+
```
98+
keepalive_multiplier = 1.5
9999
```
100100

101-
其中,**Keep Alive Backoff**`keepalive_backoff`)是 EMQX 用来确认客户端 Keep Alive 时长是否过期的系数。默认值:`0.75`。计算公式如下
101+
超时计算公式如下
102102
$$
103-
Keep Alive * Backoff * 2
103+
\text{Keep Alive} \times \text{keepalive\_multiplier}
104104
$$
105105

106106
## 会话设置

0 commit comments

Comments
 (0)