6 Replies Latest reply on Jan 19, 2004 4:43 AM by mustermann

    message cache questions

      Hi,

      I've started experimenting with the message cache settings and I have a few questions. These questions are in the context of an application that has ~10 concurrent jms clients running on seperate machines, each receiving ~20,000 messages per day. All the messages are sent via non-durable topics, making extensive use of selectors. The jdbc2 persistence/cache manager is used with postgres, and I am running Jboss3.2.

      - How does jbossmq determine if the message needs to be cached? The server running jboss is using a relatively small amount of the processing available, yet the message cache grows under load. Are my clients the bottleneck?

      - How does the number of clients effect the messagecache? If one message is published to a topic to which 3 clients subscribe, how many messages are held in the messagecache?

      - My application has message volume spikes, which invariably fill the memory allocated to the messagecache. I'm currently using a JVM with 1024M max memory. The default 500M message cache pushed the JVM very close to its limit, so overall performance degraded very badly. Currently, I am using a 250/300 setting and getting better memory usage and performance stability (meaning it is steadily mediocre). Has anyone experimented with the JVM and MessageCache memory settings. I hypothesize that there is an optimum ratio for a given load.

      - Lastly, once messages exceed the memory limit of the cache they are spooled, in my case, into the database. The number in the database fluctuates as the messagecache grows and shrinks. However, if the server is shutdown with messages in the cache, those messages never seem to be cleaned out of the DB during shutdown or during subsequent server sessions.

        • 1. Re: message cache questions

          > Hi,
          >
          > I've started experimenting with the message cache
          > settings and I have a few questions. These questions
          > are in the context of an application that has ~10
          > concurrent jms clients running on seperate machines,
          > each receiving ~20,000 messages per day. All the
          > messages are sent via non-durable topics, making
          > extensive use of selectors. The jdbc2
          > persistence/cache manager is used with postgres, and
          > I am running Jboss3.2.
          >
          > - How does jbossmq determine if the message needs to
          > be cached? The server running jboss is using a
          > relatively small amount of the processing available,
          > yet the message cache grows under load. Are my
          > clients the bottleneck?
          >

          Once memory goes above the high mark it tries
          to keep memory below the max mark.

          > - How does the number of clients effect the
          > messagecache? If one message is published to a topic
          > to which 3 clients subscribe, how many messages are
          > held in the messagecache?
          >

          3

          > - My application has message volume spikes, which
          > invariably fill the memory allocated to the
          > messagecache. I'm currently using a JVM with 1024M
          > max memory. The default 500M message cache pushed the
          > JVM very close to its limit, so overall performance
          > degraded very badly. Currently, I am using a 250/300
          > setting and getting better memory usage and
          > performance stability (meaning it is steadily
          > mediocre). Has anyone experimented with the JVM and
          > MessageCache memory settings. I hypothesize that
          > there is an optimum ratio for a given load.
          >
          > - Lastly, once messages exceed the memory limit of
          > the cache they are spooled, in my case, into the
          > database. The number in the database fluctuates as
          > the messagecache grows and shrinks. However, if the
          > server is shutdown with messages in the cache, those
          > messages never seem to be cleaned out of the DB
          > during shutdown or during subsequent server sessions.

          This sounds like a bug. They should be deleted
          when the server restarts.
          The problem is it only deletes TXOP='T' messages
          with no transaction id. It should remove them all.
          If the server is stopped, you can safely remove
          all messages that have TXOP='T'

          Regards,
          Adrian

          • 2. Re: message cache questions

            I cannot reproduce the behavior you describe.
            The 'T' records always have a null TXID
            and are deleted at server restart.

            They are also deleted if the nondurable subscription is removed.

            Regards,
            Adrian

            • 3. Re: message cache questions

              I produced this effect with an unclean shutdown. I was developing in eclipse and instead of shutting the server down I just killed the jboss java process. The messages in the database had no TXID and flag was T. Is the table checked for cleanup at startup, or just at shutdown?

              • 4. Re: message cache questions

                At startup the persistence manager runs the sql:

                delete from jms_messages where txid=null and txop='T'

                Maybe you have the same problem as postgres?
                It didn't like the "create table"s running in a transaction
                when the table already existed.

                In 3.2.2 the recovery is run in a separate transaction to
                the create tables.

                Regards,
                Adrian

                • 5. Re: message cache questions

                  ahhh. I saw your earlier post on this point, but didn't appreciate what you meant by the table create running in the same transaction. Looks like I have another reason to upgrade to jb3.2.2.

                  thanks,
                  fawce

                  • 6. Re: message cache questions
                    mustermann

                     

                    "mustermann" wrote:
                    I faced also problems with message-cache deletion at startup, even with Rel3.2.3.

                    The problem is that the cleanup code

                    delete from jms_messages where txid=null and txop='T'

                    doesn't return any result with my oracle database...

                    The correct code would be:
                    delete from jms_messages where txid IS null and txop='T'


                    The problem is how to configure it in the oracle-jdbc-service.xml for the jdbc2.PersistenceManager

                    <mbean code="org.jboss.mq.pm.jdbc2.PersistenceManager" "jboss.mq:service=PersistenceManager">
                    ....
                    DELETE_MARKED_MESSAGES = DELETE FROM JMS_MESSAGES WHERE (TXID=? OR TXID IS NULL) AND TXOP=?

                    is not really correctly but works in my environment...

                    thx.
                    heinz