Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] keep-alive in Mosquitto and in MQTT v5/v3.1.1

Keep in mind that the value of zero for Keep Alive is a special indicator to turn it off (i.e. don't use Keep Alive).

So don't think of the specs as saying you can "go down to zero". Technically, I guess, a 1-sec Keep Alive should be supported, but practically, this would induce a huge overhead on the broker. If you had ten thousand clients pinging at that rate, it would be hitting the broker with 10k msgs/sec just to maintain otherwise quiet connections.

So you will find that many clients won't let you set a Keep Alive of less than 5 or 10, and default to something like 30, 45, or 60.

Whether a _client_ is required to support all values 1-65535 is debatable. Technically, a _broker_ probably should, to be 100% compliant, but allowing really low values would let some clients put a large burden on the broker.

Frank

On 9/25/23 09:06, Lemburg, Martin via mosquitto-dev wrote:

Hello,

 

May be a naive question, but why I can only connect with Mosquitto to a broker with a keep-alive greater or equal to 5, while the protocols allow a zero keep-alive?

 

That’s all for the beginning.

 

Best regards

Martin


_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev


Back to the top