# Node-RED Virtual device instances

**URL:** <https://discourse.nodered.org/t/node-red-virtual-device-instances/45333>\
**Category:** General\
**Created:** [7 May 2021 11:04 UTC](https://discourse.nodered.org/t/node-red-virtual-device-instances/45333 "2021-05-07T11:04:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tetrived](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tetrived](https://discourse.nodered.org/u/tetrived)\
**Post date:** [7 May 2021 11:04 UTC](https://discourse.nodered.org/t/node-red-virtual-device-instances/45333/1 "2021-05-07T11:04:54Z")

</div>

Hello,

We are planning to simulate multiple devices to simulate load on mqtt broker. What would be the best approach ? We have came across " node-red-contrib-iot-virtual-device" node which help to generate multiple virtual device but not sure how ?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [7 May 2021 15:33 UTC](https://discourse.nodered.org/t/node-red-virtual-device-instances/45333/2 "2021-05-07T15:33:48Z")

</div>

I think you could do that just with a flow, no need for a special node.

Just set up multiple MQTT connections. Though you don't really even need to do that, a single connection with an estimate of the number, frequency and complexity of the MQTT messages that your IoT network would send would be sufficient for most tests. Having a large number of simultaneous connections only really tests that.

You should also monitor Node-RED's memory and CPU usage though to make sure you haven't hit any bounds.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 May 2021 15:57 UTC](https://discourse.nodered.org/t/node-red-virtual-device-instances/45333/3 "2021-05-07T15:57:15Z")

</div>

Unless you are running multiple instances of Node-RED then you are unlikely to overload/stress many brokers unless they are running on limited hardware. Node.js and thus Node-RED are single threaded so will only ever send one message at a time even if that is fairly fast.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 July 2021 15:58 UTC](https://discourse.nodered.org/t/node-red-virtual-device-instances/45333/4 "2021-07-06T15:58:11Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
