I am having an IOT application. Where for communication i am using mqtt protocol. I am using Emqttd (http://emqtt.io/) As mqtt Broker. Now all my devices as well as my node server is connected to MQTT Broker as client. Whenever a device needs to update it's status it publish on a specific topic and my node server is listening to all the topics. But i am afraid that what if no. of messages per second increases, will my server be able to handle all those messages and update there statuses in database ? is there any limit for no. of messages that can be handled by a client every second ? Or is there a better way to update status of my device into database.
2
votes
Depends on the specs of your client. I have a 1 core 400Mhz ARM device, which is able to send ~1000 messages via mqtt per second. Code is written in C++, but on a more powerful device i guess you will be able to reach better results with node. If you think your server won't be able to handle incoming messages you might want to look at clustering your node mqtt client.
- Tobi
You will have to test its performance/throughput in a deployment representative of your target environment. Nothing unusual about that - it's what you would need to do for any server/networking system/service that you want to scale.
- DisappointedByUnaccountableMod
1 Answers
0
votes
MQTT broker can handle unlimited number of connections. This can be achieved by fine-tuning the server on which broker is installed. The following parameter should be consider while tuning the system: 1. Number of open port : You can achieve this by increasing ulimit of server. 2. Number of background process running should be less as much as possible.