I have approximately 15 message handlers in one of my projects, I used message handlers so that I could use tag event scripts to call local project scripts. This was a choice made so that I could use a single Ignition project and replicate it without having to create a new project for each instance, I just create a new UDT instance and pass my unique parameters in and the rest is a template with tag event scripts in the UDT.
My issue is with performance, this worked great with 1,5, or even 20 of my instances, but now I have roughly 200 instances and I am seeing performance bottlenecks with my message handlers. I selected “Dedicated” for the threading option in the gateway events, which gives each message handler it’s own dedicated thread so that it doesn’t wait on the others, however I interpreted this incorrectly. I understood it as, every time the message event handler is called, it spawns a new thread for it to execute in, but the reality is that it is a single thread that process all of the events for this specific message handler. So what I end up with is a single congested message handler, while the other “less-used” message handlers can continue to execute.
Is there a way that I can spawn a thread for each call of the message handler rather than have one thread process them all? At this point the project is so large and widely distributed it’s hard to make a large framework change. I guess I could add more message handlers and use a memory tag to index through them for each time it is called to distribute the load to different threads.
Thanks for any help