This is most likely me not doing it right, but i got it running on a pine64 and in nodered with the mosquitto broker, after a day or 2 i can see that the cpu is reaching 100% on the broker process and when i look at the mosquitto config file to see what's going on there are many many request from different mqt session/clients that this script spawns.
What i'm doing in node-red is calling a new pull every minute to get new data that then gets sent to influxdb and presented in graphana, that part works great but the mqtt sessions seem to accumulate over time and essentially DoS'ing my small SBC :)