We have a number of devices (around 50-60 devices) connecting via MQTT to IoTHub. To save battery, our devices wake up once every 5 min, stay awake for 1 sec to get any messages and if there is nothing they goes back to sleep. This was working fine until about 2 weeks ago when this stopped working.
After trying a few things, we found that if we increase our Stay-Awake time to 3 sec, then when devices connect, the IoTHub pushes the messages to the devices. On average the IoT hub is taking about 2.5 sec to push messages once the devices connect. This will drain our battery very quick and we cannot use this as a solution. It seems to be too long to wait for messages to be dispatched considering that the devices are in the same region as the IoTHub.
We have also noticed that sometimes connection timeout needed to be increased to nearly 10 sec to get a successful connection, which seems to be far too long.
On our IoT devices, we are using MQTT protocol and due to limited hardware resources we could not use the Azure IoT sdk
So the questions here are:
Is it normal for the IoTHub to take 2-3 seconds to push mqtt messages once the device connect?
And is it normal to take up to 10 seconds to establish a connection with IoTHub?
Update 1 - 5th May 2017 10:11 AM
I have raised this question with Microsoft via MSDN, here is the link to the question: https://social.msdn.microsoft.com/Forums/en-US/9d24c261-2280-4515-8e89-8097625307ee/azure-iothub-is-taking-more-than-23-seconds-to-dispatch-messages-via-mqtt-to-the-devices-when?forum=azureiothub
We are using the Azure sdk on our cloud services. However on the IoT devices we could not use the sdk due to hardware limitation, so we are just using MQTT protocol to connect, subscribe, process messages, then disconnect. We are located in Australia (Melbourne SE) and we have multiple deployments that we are testing against, some are here in AU and some in East US, all deployments are giving us similar extended wait time to connect and to dispatch / push messages to the IoT devices