Hi everyone, I’m working on a Node-RED flow where I need to read the same parameter from multiple Modbus slaves (Slave IDs 1 to 100)

Requirements:

  • Read the same register/parameter from each slave (IDs 1 → 100)
  • Optimize the flow for low CPU utilization
  • Ensure efficient polling (avoid unnecessary load or blocking)
  • Insert/store each slave’s data into an SQL database

Current Challenges:

  • Polling all 100 slaves efficiently without overloading CPU
  • Managing timing / scheduling between requests
  • Structuring the flow to scale cleanly
  • Handling database writes without creating bottlenecks

Questions:

  1. What is the best approach to iterate through slave IDs (1–100) efficiently in Node-RED?
  2. Should I use a loop (function node) or split messages with delay/rate limiting?
  3. Is there a recommended pattern for Modbus polling (sequential vs parallel)?
  4. How can I batch or optimize SQL inserts for better performance?
  5. Any best practices for reducing CPU usage in such flows?

Additional Info:

  • Using Modbus TCP
  • Same register address for all slaves
  • Open to using contrib nodes or custom function logic

Any examples, flow designs, or recommendations would be really helpful.

Thanks in advance!

Welcome to the forum @adarshi.

100 modbus slaves sounds like quite a substantial setup.
Is this an industrial project, or perhaps an educational assignment?

Why do you need to minimise CPU usage?

Remember that Node-red is single threaded.
Maybe what you need is a compiled program, C for instance.

Have you considered paying a professional to write something for you?

How often do you need to poll?

I think it very unlikely that CPU usage is going to be a problem. The s/w will be spending most of its time waiting for the slaves.

What sort of hardware will node red be running on?

Is the mysql server running on the same machine as node red?