MQTT is a publish/subscribe protocol. Whenever a publisher publishes to a topic, all the subscribers that have subscribed to that topic will get the message via an MQTT broker. I would like to know the maximum number of clients an MQTT broker can handle. Is there any upper limit for that?
1
votes
2 Answers
3
votes
The only way to work this out is to test depending on your specific workload.
It will be entirely dependent on the following:
- The size of the machine you run the broker on.
- The size of the messages you send.
- The rate of messages.
- The number of clients (both subscribers and publishers).
- The performance characteristics you need to meet.
- Which broker you are using.
And possibly many more factors.
3
votes
How many clients an MQTT broker can serve depends on the MQTT broker software you're using. Most MQTT brokers will likely only be limited by the amount of memory available (each socket uses a chunk of memory) and it therefore becomes a question of which broker software utilizes the memory (and other resources) in the most efficient manner. Of course some brokers might have other limitations.
In practice you'd also have to look at what you can do with the connected clients - some brokers may behave differently (performance wise) depending on how many clients are connected etc.