mosquitto-users team mailing list archive
-
mosquitto-users team
-
Mailing list archive
-
Message #00186
Re: Topic-per-device style model using Mosquito
Eurig,
I am also looking into using Mosquitto for the same exact purpose.
You need to realize that in for the purpose of push notifications, the clients will have to be **constantly** connected to the broker. This means opening 2-3 million TCP connections and keeping them open with heartbeats. the problem you (and I) are facing is with OS limitations, rather than MQTT or Mosquitto. You will reach the limit of 100K (according to my load tests, some reports are of 200K – this is w/o SSL) of concurrent TCP connections per server machine.
I am planning to setup multiple Mosquitto instances on multiple VMs (It is going to be EC2 instances on Amazon Web Services), and one "controller" Java application. Each device will initiate a "register" request to the controller. The controller will send back the URL of the broker that's available and the device will subscribe to its own topic on that broker. The controller will subscribe to the $SYS topics and will monitor the load of each broker and will scale up new instances if required. I am planning for avg of 20 concurrent Mosquitto instances.
Hope this helps,
Sharon.
From: mosquitto-users-bounces+sharon.ben-asher=avg.com@xxxxxxxxxxxxxxxxxxx [mailto:mosquitto-users-bounces+sharon.ben-asher=avg.com@xxxxxxxxxxxxxxxxxxx] On Behalf Of Eurig Jones
Sent: Thursday, February 21, 2013 10:19 AM
To: mosquitto-users@xxxxxxxxxxxxxxxxxxx
Subject: [Mosquitto-users] Topic-per-device style model using Mosquito
Hey,
I'm looking into Mosquito as a back-end for a push notification system that would be designed to scale well to support 2 or 3 million concurrent users. For the clients (mobile devices) the service would be read only and authenticated. For a single client (the server that sends the messages to the MQTT) it would be read/write.
I'm thinking that there could be a topic for each device connected to the server, as I can't envisage us ever having multiple clients subscribed to the same topic. Basically it's a "one(client) to many" style of communication.
My questions are (for the Mosquito implementation of MQTT specifically):
- Is it a good idea to have this style model in terms of performance and resources?
- Is there a better way of doing this?
- Does a topic have a large footprint?
- Will it take time for the broker to find a topic if there are millions in its database?
Thanks
Eurig
Follow ups
References