Announcement

Collapse
No announcement yet.

Best Practices for Pruning Messages

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    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.

    Comment


    • #17
      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.

      Comment


      • #18
        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.

        Comment


        • #19
          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.

          Comment


          • #20
            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.

            Comment


            • #21
              Regarding the answer from cory_cole, I have a question: is it better to write a shell script that runs on the Linux cron service that deletes messages from the Postgres database than to have Mirth prunning messages?

              TYA

              Alex

              Comment


              • #22
                Depends...

                Is the DB on the same server as Mirth?

                If not then you would want to go with the Cron job (shorter distance travelled and less chance of communication errors).

                If they are on the same server, it depends on your (your IT group) level of comfort with either one. There are pros and cons to either way.

                Comment


                • #23
                  Load Balancing

                  Just a note to this topic: to prevent downtime during the pruning I have two mirth connect instances running and use crossroads as a load balancer.

                  Alexandre

                  Comment


                  • #24
                    What is crossroads?

                    Comment


                    • #25
                      Originally posted by wit-man View Post
                      What is crossroads?
                      Sorry :-)

                      I've been using this software and it's very light, easy to configure and comes with a lot of nice options.

                      http://crossroads.e-tunity.com/index.xr

                      Comment


                      • #26
                        Interesting. Would you happen to have a document of how you configured it that you would be willing to share?

                        Comment


                        • #27
                          Well, it's rather simple for LLP. After installing crossroads you just need to configure a xml file and save it in /etc. If you use HTTP, crossroads can handle it too but needs more configuration.

                          You just need to choose the <dispatchmode> and the <backend><address>.
                          I use round-robin in some scenarios and the default (least-connections) on others. It depends of how you want to balance your mirth.
                          In the backend, you just put the IP:Port of your mirth instances.

                          The rest is pretty simple and you can keep the default. Attention to the port of the <webinterface>, must be unique for each service.

                          I attach an example. For LLP, simply delete the <service> entries for HTTP.

                          Alexandre
                          Attached Files

                          Comment


                          • #28
                            Thanks! I'll give it a try.

                            Comment

                            Working...
                            X