web stats
Best Practices for Pruning Messages - Mirth Community

Go Back   Mirth Community > Mirth Connect > General Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2013, 08:31 AM
wit-man wit-man is offline
OBX.2 Kenobi
 
Join Date: Apr 2012
Posts: 80
wit-man is on a distinguished road
Default Best Practices for Pruning Messages

Hello All,

I appear to be having an issue with Mirth. Every day at midnight, Mirth halts for ~1 hour as it prunes out old messages. This causes significant problems for our ER and Radiology departments as they have to wait over an hour for 1 study to come across.

My question is: Are there best practices for pruning to minimize this?

Currently pruning is set at the defaults of starting at midnight and pruning messages older than 30 days. Last night's batch pruned ~39,000 messages. Is there a way to split this out or another setting to change that will make this smoother? Mirth version is 2.1.1.5490. Thanks.
Reply With Quote
  #2  
Old 07-18-2013, 09:19 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,235
cory_cole is on a distinguished road
Default

We try to do it at the least active time.

Are you doing backups? The default time for that is also midnight. So, you could be doing backups, pruning and usual business @ the same time.

If you wanted to batch it, you could create a channel that deletes old messages that kicks of every X amount of time.
Reply With Quote
  #3  
Old 07-18-2013, 09:47 AM
wit-man wit-man is offline
OBX.2 Kenobi
 
Join Date: Apr 2012
Posts: 80
wit-man is on a distinguished road
Default

If backing it up is part of a default configuration in Mirth, then probably. I have never seen anywhere to backup on a schedule, though. Where would that be?

These messages are currently set to prune after 30 days. Batch Pruning is enabled and the Pruning block size is "0". These settings were already in there.
Reply With Quote
  #4  
Old 07-18-2013, 10:35 AM
wit-man wit-man is offline
OBX.2 Kenobi
 
Join Date: Apr 2012
Posts: 80
wit-man is on a distinguished road
Default

Can you set individual times for pruning for each channel? I see that you can set the number of days to retain for each channel, but not times. Would that slow it down or speed it up?
Reply With Quote
  #5  
Old 07-18-2013, 10:43 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,235
cory_cole is on a distinguished road
Default

You can't do it by channel but you can change the time. Under 'Mirth Connect' select 'Settings' then the 'Message Pruner' tab. Changing the days of pruning would make it slightly faster. You are pruning 39,000 messages set at 30 days. That would be and averate of 1300 messages per day that are coming in. If you changed the pruning days to 25, you would be only 32,500 messages. Your best bet would be to change the time that the pruning occurs.
Reply With Quote
  #6  
Old 07-18-2013, 10:43 AM
wit-man wit-man is offline
OBX.2 Kenobi
 
Join Date: Apr 2012
Posts: 80
wit-man is on a distinguished road
Default

Ok, so another question. Does pruning take roughly the same amount of time regardless of whether you do it daily, weekly, or monthly? The reason i ask is because i have this currently set to daily at midnight but the end time is almost exactly the same every day and sometimes messages pruned will be 40K and sometimes the messages pruned will be 10K. So the time for it to run appears to be the same regardless of the amount of messages actually pruned.
Reply With Quote
  #7  
Old 07-18-2013, 10:52 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,235
cory_cole is on a distinguished road
Default

Usually the difference in time to delete a 10K - 40K SQL records is relatively insignifigant. Because Mirth stores the message 3 times for each record (raw, transformed and encoded) the records tend to be large. I have not done any benchmarks with Mirth to see how that effects the delete.

I believe the majority of the time is spent rebuilding indexes. Which depends on how the re-indexing is done. If just changes the indexes for deleted records, there will be a difference based on number of records. If it does a complete re-index, it won't make a difference.

Last edited by cory_cole; 07-18-2013 at 10:54 AM.
Reply With Quote
  #8  
Old 07-18-2013, 11:17 AM
wit-man wit-man is offline
OBX.2 Kenobi
 
Join Date: Apr 2012
Posts: 80
wit-man is on a distinguished road
Default

Ok, thanks. My guess based upon what you said below is that it does a complete re-index because the times are so close whether it is 10K or 40K messages.
Reply With Quote
  #9  
Old 07-18-2013, 11:37 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,235
cory_cole is on a distinguished road
Default

Which database are you using (Postgres, SQL Server, etc.)?
Reply With Quote
  #10  
Old 07-18-2013, 11:41 AM
wit-man wit-man is offline
OBX.2 Kenobi
 
Join Date: Apr 2012
Posts: 80
wit-man is on a distinguished road
Default

I don't see a SQL Server instance so i am guess Postgres? I believe I just took the defaults but it has been a while since this was originally set up. Is there a way to see for sure or are those the only two options?
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 06:12 PM.


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