web stats
Max Processing Threads - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2019, 02:05 PM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 955
StickyBandit is on a distinguished road
Exclamation Max Processing Threads

When setting a channel to max processing 400 threads. How many processing threads is mirth actually creating when let's say it is only getting 5 messages?
What I mean: Is there a minimum number of threads that Mirth connect
instantiates and has waiting in memory? Does the number affect this?


a) I would think these are created when needed, but using htop in linux showed a lot of threads with S-Sleep status.

Mirth Connect Server 3.8.0
Built on May 22, 2019
Java version: 1.8.0_181
Reply With Quote
  #2  
Old 10-17-2019, 09:19 AM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 955
StickyBandit is on a distinguished road
Thumbs down

Apparently mirth connect actually instantiates the entire thread max count into memory.
Since I set this to a high number like 400 or 800. The CPU was so busy with managing all these resting threads that it became a bottleneck and our system kept failing.

Mirth need to rename that field to Instantiated threads instead of Max thread count.

We have been fighting with this issue for days because we also have a lot of channels and added multi-threading.
Reply With Quote
  #3  
Old 10-17-2019, 11:37 AM
pacmano pacmano is offline
OBX.3 Kenobi
 
Join Date: Oct 2009
Location: Texas
Posts: 117
pacmano is on a distinguished road
Default

What's the use case for such a large number of threads?
__________________
Mirth 3.8.0 / PostgreSQL 11 / Ubuntu 18.04
Diridium Technologies, Inc.
https://diridium.com
Reply With Quote
  #4  
Old 10-17-2019, 12:22 PM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 955
StickyBandit is on a distinguished road
Default

That's not the point. The issue is that we thought we were setting
a maximum possible threads in a thread pool.

Just like in a database connection pool you set the maximum number
of connections. This does not mean that the system ever uses that much.

Your database connection pool max could be 500, but you may only be using 5 normally, but if the system gets super busy, it won't fail because it has enough connections. It does not mean create 500 connections at startup that are resting and always ready.

This is why I think the label and hint are terrible.
Reply With Quote
  #5  
Old 10-17-2019, 01:02 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,159
agermano is on a distinguished road
Default

I don't see anything wrong with the hint, but "Max Processing Threads" could be renamed to just "Processing Threads."
Reply With Quote
  #6  
Old 10-17-2019, 01:26 PM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 955
StickyBandit is on a distinguished road
Default

It says nothing about how they are all instantiated at startup.
I thought they were only added to memory as needed.
Reply With Quote
  #7  
Old 10-17-2019, 06:25 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,159
agermano is on a distinguished road
Default

Even so, setting a number that high seems very excessive. If your system is having issues when the threads are mostly idle, can you imagine how quickly it would die if they were actually all busy?

Your server can only do as many simultaneous tasks as it has cores. The idea behind threading is that some threads can keep working while others are waiting. If you have too many busy threads, all of the context switching just slows everything down.
Reply With Quote
  #8  
Old 10-18-2019, 06:13 AM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 955
StickyBandit is on a distinguished road
Default

Yep! This tool can help one monitor the threads in linux. https://www.maketecheasier.com/power-user-guide-htop/

Last edited by StickyBandit; 10-18-2019 at 06:16 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:45 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation