11 Replies Latest reply on Jul 20, 2008 10:14 PM by jasonhu919

    question about DownCacheSize

    jasonhu919

      if Downcachesize is set to 10000 and the messages are cached in the memory in queue until it reaches count=10000, will the messages get lost if the server is restarted in the middle?

        • 1. Re: question about DownCacheSize
          timfox

          Persistent messages never get lost, non persistent messages may get lost (that's why they're called non persistent ;) )

          • 2. Re: question about DownCacheSize
            jasonhu919

            I was talking about database persistent messages.

            when DownCacheSize=10000, client puts 5000 messages in the queue, the client finishes sending, then I check right away, queue size from jmx console shows 5000, but database jbm_msg table shows size still 2000, but it is increasing, so if I restart the jboss now, will all the messages which have not been paged to database get lost? if not, how does it handle it? backed up by disk file?

            • 3. Re: question about DownCacheSize
              ataylor

              If the messages are persistent then they will all get saved to the database, otherwise only paged messages will get saved.

              To ensure that all messages are recovered just make sure you make them persistent.

              • 4. Re: question about DownCacheSize
                jasonhu919

                thanks for the answer. here are my questions again:
                1. are you talking about DeliveryMode.PERSISTENT ? if I choose to use database persistence, why do I still have to set this property?
                as mentioned in your last post, it will get lost if it has not been paged to database yet, if I don't set it to persistent mode.

                2. if I set the message to be DeliveryMode.PERSISTENT, and messages have not been paged to database, the server gets restarted, how does it handle the recovery? backed by disk file?

                3. the message dequeue is fast, but the message enqueue is really slow compared to oracle AQ. any way, I can tune the enqueue performance?

                • 5. Re: question about DownCacheSize
                  ataylor

                   

                  are you talking about DeliveryMode.PERSISTENT ? if I choose to use database persistence, why do I still have to set this property?


                  I'm not sure what you mean when you say "if i choose database persistence". If you're DeliveryMode is Persistent then all messages get saved to the database, if you're DeliveryMode is non persistent then JBM will use the database only to page messages when needed.

                  if I set the message to be DeliveryMode.PERSISTENT, and messages have not been paged to database, the server gets restarted, how does it handle the recovery? backed by disk file?


                  If you use DeliverMode.PERSISITENT then the messages dont have to be paged to the database as they are already persisted.

                  the message dequeue is fast, but the message enqueue is really slow compared to oracle AQ. any way, I can tune the enqueue performance?


                  If you want really fast performance then you should try JBM 2.0 alpha as its really quick

                  • 6. Re: question about DownCacheSize
                    timfox

                     

                    "jasonhu919" wrote:

                    3. the message dequeue is fast, but the message enqueue is really slow compared to oracle AQ. any way, I can tune the enqueue performance?


                    Message consume rate is highly dependent on many factors including what acknowledge mode you are using (e.g. AUTO_ACKNOWLEDGE =slow), if you're using transactions, how many transactions in your batch etc.

                    • 7. Re: question about DownCacheSize
                      jasonhu919

                      It is getting to the point I wanted to know, really appreciate. still some questions.

                      1. so if I set DeliveryMode=Persistent, the DownCacheSize which does the batch paging is not useful any more, since it gets saved to database right away, is it correct?

                      2. why is AUTO_ACKNOWLEDGE =slow ? I can't think of a reason.

                      3. 2.0 is still in alpha, it looks good from the benchmark stats, when will it be released? after jboss 5.0? another 6 month?

                      • 8. Re: question about DownCacheSize
                        ataylor

                         

                        so if I set DeliveryMode=Persistent, the DownCacheSize which does the batch paging is not useful any more, since it gets saved to database right away, is it correct?


                        Wellnot exactly, all messages will actually go in to the down cache however only non persistent messages will get paged to the database.

                        why is AUTO_ACKNOWLEDGE =slow ? I can't think of a reason


                        With AUTO_ACKNOWLEDGE the client will acknowledge every single message on receive. With DUPS_OK for instance the client is allowed to ack the message lazile making it quicker.

                        2.0 is still in alpha, it looks good from the benchmark stats, when will it be released? after jboss 5.0? another 6 month?


                        We'll probably have a release available towards the end of the year.

                        • 9. Re: question about DownCacheSize
                          jasonhu919

                          thanks for the quick response.

                          "Wellnot exactly, all messages will actually go in to the down cache however only non persistent messages will get paged to the database. "

                          I am so confused by this above line. my understanding was : for non-persistent messages, when the DownCache reaches the limit (for example the default 2000), it will gets paged to storage (database) as a batch, so to avoid memory leak. if server crashes in the middle, only paged ones get saved. Persistent messages get paged to storage right away.

                          if what you said is true, the persistent messages are not paged to database, first question is: where does it store the messages then? after the size reaches the DownCacheSize limit, what will happen then?

                          • 10. Re: question about DownCacheSize
                            ataylor

                            ok, again, persistent messages are always saved in the database, i.e 'persistent', non persistent message get saved to the database when paging occurs. When paging occurs all messages are cached, i.e. they are released from memory but only non persistent messages need to be saved.

                            • 11. Re: question about DownCacheSize
                              jasonhu919

                              ok, got it, so the persistent message don't get paged to database, because they are saved to database already..