Search code examples
mqttmosquitto

What is maximum connection of Mosquitto?


I'm programming chat app with MQTT protocol

You can see here mqtt.org about MQTT

My used broker is mosquito

What struck my mind is that

How many users can connect to Mosquito broker?

I saw 100k in some website but i am not sure


Solution

  • This is dependent on a number of factors:

    • What OS your running on
    • The size of the machine(s) you run the broker on
    • What broker you choose to use
    • How much and what type of load you are generating:
      • How many clients subscribed to each topic
      • How big the messages are
      • How many retained messages you are generating
      • What the message rates is
      • Are you queuing message for offline clients

    You also need to configure the broker/OS to get the most out of it, e.g. for mosquitto you need to set the number of open file handles on Linux to the maximum.

    For a large scale app you may want to look at one of the brokers that supports federation/clustering to spread the load and allow fail over.