4 Replies Latest reply on Dec 19, 2013 12:23 PM by Clebert Suconic

    Scheduled messages and memory consumption

    Guillaume Grossetie Newbie

      Hi,

       

      I know that JMS is not a scheduling system but scheduled messages are a very convenient and easy way to implement such system. We did some load testing and found that the class ScheduledDeliveryHandler [1] keeps a reference on scheduled messages.

      I wanted to know if all the scheduled messages will be "stored" in memory ? Is there a configuration to set a limit ?

       

      We are currently using HornetQ 2.3.5.Final with JBoss EAP 6.1.1.GA and we are scheduling approximately 10K messages from 1 to 45 days.

       

      Cheers.

      Guillaume.

       

      [1] hornetq/hornetq-server/src/main/java/org/hornetq/core/server/impl/ScheduledDeliveryHandlerImpl.java at master · hornetq/…

        • 1. Re: Scheduled messages and memory consumption
          Andy Taylor Master

          scheduled messages are handled no different to non scheduled messages with regard to memory consumption as any paging, blocking or dropping of messages is done at routing time.

          1 of 1 people found this helpful
          • 2. Re: Scheduled messages and memory consumption
            Guillaume Grossetie Newbie

            Hi Andy,

             

            Thanks for your reply.

            I will adjust addresses settings and do some more testing

             

            So at the routing time, if the <max-size-bytes> is exceeded the scheduled message will be paged ? But is ScheduledDeliveryHandlerImpl#runnables attribute will contains all scheduled messages or just scheduled messages "in memory" (I paged to disk) ?

             

            Cheers,

            Guillaume.

            • 3. Re: Scheduled messages and memory consumption
              Clebert Suconic Master

              The Runnables don't contain any references.. they are just scheduling Queue.deliver and scanning over the scheduled references.

               

               

              This was much improved on 2.4.0.Final BTW. Now we only schedule if there aren't any runnable scheduled at the same time you're scheduling. That way if you have 1000 messages scheduled to be delivered in 10 seconds, you will only have one runnable at 2.4.0.

              1 of 1 people found this helpful
              • 4. Re: Scheduled messages and memory consumption
                Clebert Suconic Master

                BTW: Scheduling with paging... we schedule as we depage and memory frees up.

                 

                 

                If you have an address with only scheduled, it should be ok.

                 

                If you have a redelivery, it will be scheduled right away. In case of restart the redelivery will be on the beggining of the available messages, so it should be ok as well.

                 

                 

                There could be some miss use where scheduled messages would take a while to be delivered. (One I could think is... Say if you have 1 million messages scheduled for 2 days from ... and than 1 million messages to be delivered now).. you won't deliver any messages for 2 days on that case.  for regular uses this shouldn't be any problem.