web stats
Diagnose high processor/memory usage? - Mirth Community

Go Back   Mirth Community > Mirth Connect > General Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2008, 06:09 AM
jbartels jbartels is online now
Mirth Guru
 
Join Date: Oct 2006
Posts: 728
jbartels is on a distinguished road
Default Diagnose high processor/memory usage?

I've got a Mirth instance running on a machine with 2GB of memory and a 2.1ghz dual core Intel processor. I can't remember exactly when we reset statistics but this instance has processed 60K messages since sometime yesterday and some of those are running through some transformers with fairly nasty looping algorithms.

top currently shows this:
Code:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
 3033 root      20   0 1048m 660m  12m S   94 32.8   1709:08 java               
24219 extensio  20   0  240m 118m 4376 R   52  5.9  99:54.38 mongrel_rails      
24234 postgres  20   0  103m  33m  28m S   23  1.7  32:43.08 postgres           
24229 extensio  20   0  178m  67m 3400 S   14  3.4  14:40.25 ruby   
...
Obviously on a machine running Java AND Ruby processes, I'm not expecting to have much free memory. That first java process (PID 3033) is Mirths, and its processor usage regularly runs over 190% (so full use of both cores). Mirth's heap size is set to 512MB, but as you can see its consuming about 1GB of memory.

I'm pretty sure that the high use comes from a channel I'm debugging which is polling more frequently than it will in production, but I'd like to be sure.

We just loaded the Sun Java Monitoring Tools and hope to get some insight into things like thread counts and garbage-collection.

How can I better determine which channel or transformer is causing the high usage? How will Mirth behave if I renice it to a lower priority? What metrics should I be looking at?

As long as my team is in there poking around anyway are there any stats we can send back to the Mirth team that would be useful?

Despite the high utilization the Ruby webapps that Mirth is sharing this box with are reasonably responsive (a bit sluggish, but usable). Its also handling a lot of messages. So we're happy with Mirth, but would like to be able to tune it just a little bit.
__________________
Jon Bartels

Zen is hiring!!!!
http://consultzen.com/careers/
Talented healthcare IT professionals wanted. Engineers to sales to management.
Good benefits, great working environment, genuinely interesting work.
Reply With Quote
  #2  
Old 07-29-2008, 11:51 AM
jbartels jbartels is online now
Mirth Guru
 
Join Date: Oct 2006
Posts: 728
jbartels is on a distinguished road
Default Re:Diagnose high processor/memory usage?

I think we solved this with nothing more than a code review.

We had to code a delay into some channels so that we could slow messages down for a buggy receiving system and we were using an idle loop (get the current time, loop for 15 seconds) which really wastes a lot of CPU time. Apparently you can call java.lang.Thread.sleep and do it correctly to save CPU time.

So if Mirth is slow, its probably bad transformer or filter code and not a setting that needs to be tweaked.
__________________
Jon Bartels

Zen is hiring!!!!
http://consultzen.com/careers/
Talented healthcare IT professionals wanted. Engineers to sales to management.
Good benefits, great working environment, genuinely interesting work.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Problem Use of Pre-Processor in Mirth Tarun Support 1 02-19-2009 09:58 AM
Java heap out of Memory Error! mac_3785 Support 0 03-30-2008 04:58 PM
Java Heap out of memory mac_3785 Support 0 03-30-2008 04:53 PM
Excessive memory usage at idle jbartels Support 5 01-11-2008 05:21 PM
Out of Memory dmerck Support 10 12-18-2006 05:12 AM


All times are GMT -8. The time now is 08:09 AM.


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