emqx / emqx

The most scalable open-source MQTT broker for IoT, IIoT, and connected vehicles
https://www.emqx.com/
Other
13.53k stars 2.17k forks source link

feat: improve keepalive_multiplier and keepalive_check_interval #13315

Closed zhongwencool closed 3 days ago

zhongwencool commented 1 week ago

Fixes https://emqx.atlassian.net/browse/EMQX-11151

https://github.com/emqx/emqx/issues/11685

Add a new keepalive config: mqtt.keepalive_check_interval(default is 30s) The time interval to check for mqtt packets. range is [1s, Interval(in connect packet) div 2 s].

So the time to determine if a timeout is needed is:

eg: interval = 60s, multiplier = 1.5, check_interval = 30s should be keepalive_timeout between 90s(60*1.5) and 120s(60*1.5+30)

If the user expects to reduce this section. You can reduce the factor: interval = 60s, multiplier = 1.5, check_interval = 10s should be keepalive_timeout between 90s(60 * 1.5) and 100s(60 * 1.5+10)

Release version: v/e5.7.2

Summary

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

Checklist for CI (.github/workflows) changes