moscajs / mosca

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

New connection issue while performing benchmark script #674

Open Jaykishan-KaPatel opened 6 years ago

Jaykishan-KaPatel commented 6 years ago

Hello,

we are using mosca on linux platform please find below configuration RAM: 16GB 8 Core CPU

we are using this benchmark script https://github.com/mqttjs/MQTT.js/blob/master/benchmarks/bombing.js

we found that we are not able to connect new connection while doing this benchmark test.

when we stopped bombing.js, we can connect new connection.

what should be an issue there. ???

Jaykishan-KaPatel commented 6 years ago

We are using RabbitMQ as a backend.

mcollina commented 6 years ago

I don't understand what's the problem. What error are you seeing?

uvshah commented 6 years ago

I am having similar problem. I have been using Mosca since quite a while and it is working fine. I also read that "aedes" has advantage over Mosca in performance. But as I am using RMQ in Mosca backend and did RMQ cluster in two servers. It is much more time consuming to switch from Mosca to Aedes. So i would stick to Mosca. I came across few benchmark scripts of yours : https://github.com/mcollina/aedes/tree/master/benchmarks

I have tried to run below two scripts in Mosca 1) https://github.com/mcollina/aedes/blob/master/benchmarks/bombing.js 2) https://github.com/mcollina/aedes/blob/master/benchmarks/throughputCounter.js

When i run above scripts in Mosca, i get 8k to 10k message rate per second. But at same time,when i try to connect another connection, i can connect it after around 20S. (Note: when benchmark script stops, i can connect it immediately)

Same test i have done in "aedes", where i get message rate around 50k-60k per second and i can connect another connection immediately.

Is there any setting I have missed in mosca to achieve this?

It would be great if you could help me in it.

mcollina commented 6 years ago

@urmik you should really use aedes. It has more features than mosca, and when I have time I will migrate Mosca on top of Aedes itself.

uvshah commented 6 years ago

Thanks for your response. I will definitely switch to aedes but for now I have to stick with Mosca as I am using Mosca in production with backend RMQ clustered in multiple servers. Two questions 1) Is it known issue in Mosca? Means at continuously publishing message in publish callback, does mosca server causing delay for another client connection and pub/sub messaging? https://github.com/mcollina/aedes/blob/master/benchmarks/bombing.js 2) Can you suggest me any quick and dirty fix for this issue?