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
  • From: "Lemburg, Martin" <martin.lemburg@xxxxxxxxxxx>
  • Date: Mon, 25 Sep 2023 15:41:14 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fiprxihnj569IJhbMpXUfJZgo8Nu6wSYuRsrenBbs9Q=; b=JQ6X6QdleAXww1hlEdKVztUZSGNa7f3ta7H/sIZGVJyykNY8lW3vAvUMCGRZ7b8RdH2GiKPzYGVI3ICjNgh0S6cmQ6pSrlfC7fHh2Ze//9mj0sRSsf8BCBGr0dNWdovf/uksa2Y3l+y5MQUKoIVnojDX/veWewf9dyBrL+/jox6DuvmrLLWEOGEciNi5sd30wKdmn53p0v1Rqx8wg9X2dckCDaDnh02yxjx14ZfRCRlftVmvv+2JnAlQHg1kGI7XKRaGcXVGU+HAOX9kcLrI51MnukXPA03hZUQZlVZVH9WN+JGaBOnGY1pV+5Oeb/fuqW4s2tsLe02R708ZPUHuMw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xfdl09l+VIDlO0pXH8d6GTFD3A3XikaFsQpQbNZcjGnDRwJqg+gItOnZDajto33pDqHinsoWctyRYJ+C1lNlMomZlOIiDoKnhMcGbbDwiY6l5iaG26HHohr/ksFMpeOUq84aUFN73W6dIaJ18xtaEVsecY2jxVYYYOXRroRTEV9iPb8V9JcjgLZuHXBU/ZsxLS7iaYD5EAWbwmriMmeKa+EZoKaMOK1S4q61MJ1Z5U+o72w2gV13PZDNYmR64RSFvW4oH7xbpb7tQo8LziEGheVQfGnCtE8QcBNHTr02icHFDnsH/8Hh4Su9RYUH6N6nJzgUQp5o1FAZOQxscOVtXg==
  • Delivered-to: mosquitto-dev@xxxxxxxxxxx
  • Document_confidentiality: Restricted
  • List-archive: <https://www.eclipse.org/mailman/private/mosquitto-dev/>
  • List-help: <mailto:mosquitto-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/mosquitto-dev>, <mailto:mosquitto-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/mosquitto-dev>, <mailto:mosquitto-dev-request@eclipse.org?subject=unsubscribe>
  • Msip_labels: MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Enabled=true; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_SetDate=2023-09-25T15:41:14Z; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Method=Standard; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_Name=restricted; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_SiteId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_ActionId=581cd1eb-be7b-4714-8b05-4ba6b64189d3; MSIP_Label_9d258917-277f-42cd-a3cd-14c4e9ee58bc_ContentBits=0
  • Thread-index: AdnvsSNTIxiQmp5qQc6GFal0M7PddAAC8hKAAAIr6tA=
  • Thread-topic: [mosquitto-dev] keep-alive in Mosquitto and in MQTT v5/v3.1.1

Hi Frank,

 

Thanks for your “immediate” response!

 

Sorry, I was too unspecific in my question.

 

If I understood it correctly, a keep-alive value of zero, would switch off the broker-sided test for receiving PINGREQ packets to decide, if a connection is alive or should be closed.

 

To switch of the PINGREQ test for connection closure at the broker, the client needs to specify the keep-alive interval to be zero.

But the Mosquitto API allows only a keep-alive interval of five or more seconds.

 

I’m with you and I don’t think, that it mostly makes no sense to specify values lower then five, but zero is valid and as a semantic!

 

That’s why I’m asking.

 

Best regards

Martin

 

From: mosquitto-dev <mosquitto-dev-bounces@xxxxxxxxxxx> On Behalf Of Frank Pagliughi via mosquitto-dev
Sent: Monday, September 25, 2023 4:31 PM
To: mosquitto-dev@xxxxxxxxxxx
Cc: Frank Pagliughi <fpagliughi@xxxxxxxxxxxxxx>
Subject: 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