# Limits of system.util.sendMessage

**URL:** <https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374>\
**Category:** Ignition\
**Created:** [March 18, 2022, 7:39pm UTC](https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374 "2022-03-18T19:39:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradbarbin](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bradbarbin](https://forum.inductiveautomation.com/u/bradbarbin)\
**Post date:** [March 18, 2022, 7:39pm UTC](https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374/1 "2022-03-18T19:39:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 18, 2022, 7:42pm UTC](https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374/2 "2022-03-18T19:42:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bradbarbin](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bradbarbin](https://forum.inductiveautomation.com/u/bradbarbin)\
**Post date:** [March 18, 2022, 7:44pm UTC](https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374/3 "2022-03-18T19:44:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 18, 2022, 7:50pm UTC](https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374/4 "2022-03-18T19:50:00Z")

</div>

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](https://www.automation-pros.com/ignition/later.py) script for an example of how to make one of those.

{ Also, not Paul. }

---

<div class="post-metadata">

**Author:** ![bradbarbin](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bradbarbin](https://forum.inductiveautomation.com/u/bradbarbin)\
**Post date:** [March 18, 2022, 7:51pm UTC](https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374/5 "2022-03-18T19:51:04Z")

</div>

Oops! You’re the man Phil!

---

<div class="post-metadata">

**Author:** ![bradbarbin](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bradbarbin](https://forum.inductiveautomation.com/u/bradbarbin)\
**Post date:** [March 18, 2022, 7:57pm UTC](https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374/6 "2022-03-18T19:57:16Z")

</div>

@pturmel unrelated note – what do you use this for in practice [tag.py](https://www.automation-pros.com/ignition/tag.py)?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 18, 2022, 7:58pm UTC](https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374/7 "2022-03-18T19:58:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bradbarbin](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bradbarbin](https://forum.inductiveautomation.com/u/bradbarbin)\
**Post date:** [March 18, 2022, 8:16pm UTC](https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374/8 "2022-03-18T20:16:16Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 18, 2022, 9:54pm UTC](https://forum.inductiveautomation.com/t/limits-of-system-util-sendmessage/57374/9 "2022-03-18T21:54:28Z")

</div>

Meh, ok.
