configurable MQTT keepalive/ping interval for cloud connections
Opened this issue · 0 comments
Is your feature improvement request related to a problem? Please describe.
Allow control over the ping interval so that it is aligned with the different cloud requirements and it could be used to reduce some of the traffic for idle connections for those users who want to reduce the bandwidth by reducing the number of pings sent on idle connections.
It must also be noted that increasing the MQTT PING interval also affects how quickly the MQTT client detects whether the MQTT connection has been lost. Users should adjust the value with care, and they should verify that the interval is compatible with the cloud's requirements, as generally each cloud could also have additional settings on the load balancer to also disconnect idle connections after a period of time, and if the PING interval is above the idle connection setting, then it will also lead to the connection being closed by the server resulting in more traffic due to the reestablishment of the connection and the associated TLS handshake.
Describe the solution you'd like
A new tedge configuration value which is used by the bridge functionality (either mosquitto or the built-in bridge) to set MQTT PING keep-alive/ping interval:
- On mosquitto: set the
keepalive_interval seconds
value in the<mapper>-bridge.conf
file. See mosquitto docs - On built-in: use the value in the MQTT client which is connected to the cloud to control how often a MQTT PING_REQ is sent on idle connections
Describe alternatives you've considered
Additional context