web stats
Best Practices for Pruning Messages - Page 2 - Mirth Community

Go Back   Mirth Community > Mirth Connect > General Discussion

Reply
 
Thread Tools Display Modes
  #11  
Old 07-18-2013, 11:52 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,228
cory_cole is on a distinguished road
Default

It is probably Postgres but I am not sure where you would look to find that out. We have a contract with Mirth and we have the Mirth Appliance. So we do alot of maintenance from there. We have had issues with PostGres 8 not vaccuming correctly which has caused performance issues (all-round not just on pruning). You may want to try re-indexing the message table.

http://www.postgresql.org/docs/8.3/s...l-reindex.html
Reply With Quote
  #12  
Old 07-18-2013, 11:56 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. Might just pop up a new mirth station and use SQL Server. As of now, I am setting it to 3 AM as that is their slowest time. I might run some tests in the future to see if setting it to prune weekly helps as well. Also might try putting it on faster hardware or splitting the channels across multiple workstations.
Reply With Quote
  #13  
Old 07-19-2013, 03:08 AM
bchirgwin bchirgwin is offline
What's HL7?
 
Join Date: Jun 2011
Posts: 5
bchirgwin is on a distinguished road
Default Enable Batch Pruning

Quote:
Originally Posted by wit-man View Post
Hello All,


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.
Enable Batch Pruning and set Block size to 10000.

100,000+ messages are being deleted nightly. Without the batch the Mirth server comes to a halt. I've never tried increasing the number as it worked well with this value. MS SQL Server is being used.
Reply With Quote
  #14  
Old 07-19-2013, 04: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

Does this allow messages to still go through while it is doing this? Does it run the batches one after the other? Meaning, if I have 40K messages, it will do 10K, then right after that do another 10K, or does it wait for a period of time before doing the next batch?
Reply With Quote
  #15  
Old 07-19-2013, 05:35 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,228
cory_cole is on a distinguished road
Default

I should process messages in between because they would be in queue for the next lock.
Reply With Quote
  #16  
Old 07-19-2013, 05:40 AM
wit-man wit-man is offline
OBX.2 Kenobi
 
Join Date: Apr 2012
Posts: 80
wit-man is on a distinguished road
Default

Thanks! That might be what I need. I already moved it to the slowest time of the day but if i an break it up into ~15 minute intervals, that should help out tremendously.
Reply With Quote
  #17  
Old 08-01-2013, 06:01 AM
santosam santosam is offline
OBX.2 Kenobi
 
Join Date: May 2012
Location: Portugal
Posts: 62
santosam is on a distinguished road
Default

I need to prune my messages but in a different way from the way Mirth does it, I think.
What I need is to prune messages that are, for instance, 4 weeks old and older, running this prune job every Sunday.
Is there a way to prune messages like this?

TYA

Alex

BTW, I have a cron job that will export these messages to a file before the Mirth pruning process.
Reply With Quote
  #18  
Old 08-01-2013, 08:02 AM
wit-man wit-man is offline
OBX.2 Kenobi
 
Join Date: Apr 2012
Posts: 80
wit-man is on a distinguished road
Default

Yes. Open Mirth and go to:

---------------------------------

Settings -> Message Pruner tab

Select "Weekly"

Select the Day of the Week and Time that you want to change

Click "Save"

---------------------------------

On the channel you want to prune, on the "Summary" tab, right above "Description", there are options to Store indefinitely or Prune messages after "x" number of days. Default is already set to "30" days so just changing the options on the Message Pruner tab should work for you.
Reply With Quote
  #19  
Old 08-09-2013, 07:15 AM
wit-man wit-man is offline
OBX.2 Kenobi
 
Join Date: Apr 2012
Posts: 80
wit-man is on a distinguished road
Default

Just an FYI, it doesn't appear that Mirth is breaking up the queues to allow messages to flow during the time when it is pruning.

I checked last night's logs and pruning started at 3 AM and ended at 4:20 AM.

The last message that was sent before pruning started was at 03:00:24 and messages started flowing again at 04:19:55.
Reply With Quote
  #20  
Old 08-09-2013, 07:25 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,228
cory_cole is on a distinguished road
Default

You could turn pruning off and do it yourself with one or more channels that has the messages for each channel start at a different time.

i.e.

delete from message where channel_id = channel_a_id and create_date < today - 30 days;

sleep(X)

delete from message where channel_id = channel_b_id and create_date < today - 30 days;

or

a prune channel for each channel that kicks off at specific time.

The drawback is that you to make sure to update this each time you add a channel.
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 04:26 PM.


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