- Newest
- Most votes
- Most comments
Hi Frank.
How many messages per second can I expect to be able to send through a single Mqtt client connection?
Each MQTT client connection to IoT Core has a hard limit of 100 messages per second and throughput of 512KB/s. These are covered in the message broker limits. Specifically Publish requests per second per connection
and Throughput per second per connection
. With your messages being under 100 bytes, the 100 messages per second limit is what you'll hit first. This limit is the sum of inbound and outbound. This video gives a nice introduction to this limit, and to message throttling: https://www.youtube.com/watch?v=vQRBQ5yhEP0. As you'll see, it's possible to exceed 100 for short bursts, without being throttled. The video also covers how to monitor for thottling, so you know when it happens.
Is it OK if I send the next message without waiting for the result of the previous?
Yes. Per the video though, you will quickly hit the limits.
Because of these limits, a cloud (or mobile) application will often not use an MQTT client connection to interact with a device fleet. You can instead use the AWS SDK (not the IoT device SDK) to interact with the IoT data plane using HTTP: https://docs.aws.amazon.com/iot/latest/apireference/API_Operations_AWS_IoT_Data_Plane.html. With these methods in the Java SDK: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/iotdataplane/IotDataPlaneAsyncClient.html. HTTP is not constrained to 100 messages per second, so you can call the publish method at a higher rate. And there's a separate API/method for updating shadows. Please be aware though that you can't subscribe using HTTP.
it's always one update per thing to a large number of things
In that case, I wonder if shadows is the best way. It's generally suited for 1:1 interaction with devices. If you routinely need to make an update to a large group of devices, or to your whole fleet, then jobs may better suited. They are a 1:many pattern.
Thanks for all the information. In my case it would be easiest to create multiple client connections and make sure they don't exceed the rate limit.
Relevant content
- asked 10 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago
I read somewhere else that there is a fixed quota of 100/second when sending shadow updates. I'm not sure if this is true. I looked at the quotas page and there are hundreds of quotas listed, I don't know which ones apply to my situation. I am using the Mqtt connection to send shadow updates. For example $aws/things/<thing-name>/shadow/update. When I have a large number of updates to send it's always one update per thing to a large number of things, not many updates to one thing.