moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 507 forks source link

Maximum number of routing keys bind with Rabbitmq queue #438

Closed uvshah closed 8 years ago

uvshah commented 8 years ago

Hello,

I have been testing mosca with Rabbitmq as backend. I am not using "persistence" setting. I have few questions. 1) i have observed that there is only one exchange ,one queue and all subscribers are binding with single queue only. What is maximum number of routing keys those can bind with RMQ single queue? If in future I have 1M subscribers(routing keys), then single queue can handle 1 M subscribers? In scalability point of view, is this right way to do it? 2) How can I do clustering/load balancing in mosca with RabbitMQ? 3) If i am not publish/subscribe any message to "$SYS/*" , will it occur any issue? it is for monitoring purpose only rite?
4) How can I pass my RMQ host,port,username,passord,Vhost?

Thanks in advance

Regards, Urmik

mcollina commented 8 years ago

Hi Urmik.

It seems you are a better expert than me on RabbitMQ, let me know your findings on 1). 2) just put a TCP/TLS load balancer in front of Mosca, I had great success with HaProxy or AWS ELB. 3) No issue at all, I would recommend setting up authorization rules to avoid normal clients to publish/subscribe under $SYS, as some topics are used internally 4) see https://www.npmjs.com/package/amqp#connection-options-and-url and pass all options as 'client', like { backend: { client: { login: 'aaa', password: 'bbb' } }.

uvshah commented 8 years ago

Hello, Many thanks for your reply. Regarding point 1,I have came across following from rabbitmq user group: https://groups.google.com/forum/#!searchin/rabbitmq-users/binding$20keys/rabbitmq-users/9Etlwfxo4NA/LNrwZIv7AgAJ https://groups.google.com/forum/#!searchin/rabbitmq-users/binding$20keys/rabbitmq-users/pV8ViugMFn8/fzjPIrJUlHwJ https://groups.google.com/forum/#!searchin/rabbitmq-users/binding$20keys/rabbitmq-users/u2fhsLHXULQ/QHQgOldjDQAJ

As per above, RabbitMQ doesn't have any limit of routing keys but they recommended to use multiple queues. I really want to have a one queue with many bindings but later if there are millions of bindings than will it effect in performance? I will surely do benchmark testing on this but have you came across with any benchmark testing result about this?

mcollina commented 8 years ago

I have not done any :(.