Limits of system.util.sendMessage

Is there a known throughput limit for receiving messages to a single project with message handlers in Ignition?

In Vision, messages sent to clients from the gateway are delivered when the client requests tag updates for its subscriptions. So it will be bursty at that pace.

Not sure about Perspective. That should only be limited by the gateway’s CPU allocation.

Thanks Phil! I’m specifically interested in the case where many gateway scripts send messages (via system.util.sendMessage) to a single gateway message handler (on a remote server). Any thoughts there?

IIRC, message handlers are process one message at a time per handler. So that will likely be your limit if you need replies (system.util.sendRequest). If you are sending fire-and-forget type messages, the handler could accommodate higher rates by delegating actual execution to a custom thread pool. See my later.py script for an example of how to make one of those.

{ Also, not Paul. }

1 Like

Oops! You’re the man Phil!

@pturmel unrelated note – what do you use this for in practice tag.py?

Haven’t used it in ages. It is collecting dust. (:

I have an idea for a thread pool. Do you think this approach would work for maximizing message throughput?

In my single project that receives all the messages, I create (for the sake of example) 10 message handlers that all do the same thing (pass the payload to a function) in their own dedicated thread. I name them thread1, thread2, etc. because I’m not very creative.

In the many projects that use system.util.sendMessage to send the messages to the single receiver project, I write some code like this:

messageHandler = 'thread' + str(random_between(1,10))
results=system.util.sendMessage(project, messageHandler, payload)

Meh, ok.