2 Replies Latest reply on Nov 13, 2017 1:55 AM by singh.vishal

    Jboss6 MDB pools and WorkManager thread count are not in sync

    singh.vishal

      We have Jboss6 application server 23 different MDBs listening 23 different queues are deployed and All MDBs have minSession=1 and maxSession=1. StrictMaxPool in is set to 15.

      Queues are created in  HornetQ Server version 2.2.14.Final (HQ_2_2_14_FINAL, 122)  and running in separate jvm

      And WorkManagerThreadPool is set as below.

       

      <bean name="WorkManagerThreadPool"
      class="org.jboss.util.threadpool.BasicThreadPool">
      <!-- Expose via JMX -->
      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.jca:service=WorkManagerThreadPool", exposedInterface=org.jboss.util.threadpool.BasicThreadPoolMBean.class)</annotation>
      <!-- The name that appears in thread names -->
      <property name="name">WorkManager</property>
      <!-- The maximum amount of work in the queue -->
      <property name="maximumQueueSize">1024</property>
      <!-- The maximum number of active threads -->
      <property name="maximumPoolSize">100</property>
      <!-- How long to keep threads alive after their last work (default one minute) -->
      <property name="keepAliveTime">60000</property>
      </bean>

      I go through https://access.redhat.com/documentation/en-us/jboss_enterprise_application_platform/5/html/performance_tuning_guide/sect-performance_tuning_guide-message_driven_beans

      What I understood is that

       

      1. There can be max 15 MDBs instances say mdb1 to mdb15 in mdb instance pool.
      2. If all these MDBs mdb1 to mdb15 are busy in processing messages and
      a
      new message comes to queue say Q16, a new instance of mdb16 will be created.
      3. 16 Thread form WorkManagerThreadPool will be used by jboss to executed 16 MDB instances.
      4. If any MDB has misSession > 1 then there will be as many mdb instances of
      that MDB in MDB pool
      . For eg. say mdb1 and mdb2 have minSession=2, then
      there will be
      2 instances of mdb1 + 2 instance of mdb2 + 11 other mdb
      instances say mdb3 to mdb mdb11 in mdb pool
      .
      5. WorkManagerThreadpool maximumPoolSize can be set equal to sum of 
      maxSessions
      for all the mdbs assuming that all the mdbs maxsession will be busy in processing.

       

      Did I understood the stuff correctly or missing/misunderstood the concept?

      What I could not understand

       

      1. How this MDB pool is maintained. Is it LRU or something else. For eg in
      case of point 2 above, when all the mdbs finished there work, will mdb16
      remain in pool and which mdb will be removed from pool
      .
      2. If an MDB has minSession > 1 point 4 above, will it's one instance will
      be removed and mdb16 will be in pool
      .
      3. From logs I could see msg-consumer 2017-11-08 08:22:52,544
      DEBUG
      (Thread-1574 (group:HornetQ-
      client
      -global-threads-271245552):) [mdb.mdb1] Incoming message
      {HornetQMessage[ID:a1b494dd-c455-11e7-9db5-1866daf41c0c]:PERSISTENT} from
      queue
      {HornetQQueue[Q1]} with properties {{JMSXDeliveryCount=1}}.

      4. From Chapter 32. Application Server Integration and Java EE paragraph 32.3. MDB and Consumer pool size,  if I do not configure

      maxSession, will 15 sessions per MDB will be created? If yes where will those instances resides? In MDB pool (Resource Adaptor implementation knows nothing about the application servers MDB implementation?

       

       

      From where Thread-1574 is coming if we have set Thread Pool as 100? is it some "global" thread pool? If so in which configuration file it is configured?

      I read HornetQ threads  and comment from jbertram Well, these threads come from a pool (i.e. the "global" pool as you can see by the name) which means you aren't guaranteed to get the same thread everytime.

      I could not find where this global thread pool is configured. On client consuming messges or on HornetQ server?

      Also from logs I could see that some mdbs stop consuming messages for a while and then start again. For eg. mdb1 to mdb6 listen for some time and then stop. Then after some time again start listening.

      This happens even if there are thousands of messages in queue.
      Can someone please spare some time to explain the above points? and also refer some good tutorial/book to understand these configuration and there impact deeply.

      Thanks.

        • 1. Re: Jboss6 MDB pools and WorkManager thread count are not in sync
          jbertram

          Couple of things:

          1. You are asking questions about application server implementation details in the HornetQ (i.e. message broker) forum.  HornetQ specific questions can be answered here, but questions about the application server really should be asked on the application server forum.
          2. Your comment has so many questions that it will take an extremely long time to research and answer them all.  I recommend you ask short, specific questions rather than combining lots of general questions into a single comment.
          3. You are asking questions about software that is really old.  JBoss AS 6 was released almost 7 years ago now.  HornetQ 2.2.14.Final came out over 5 years ago.  Most people on these forums are willing to donate their time to help users with current releases, but you probably won't find much help for stuff as old as you are using.

           

          As for your HornetQ threading questions, the documentation is pretty clear about how to configure the various pools.  Also, just because you see a thread named something like "Thread-1574" don't assume that means you have over 1500 threads running concurrently and pooling isn't working.  The number there is just an implementation detail.

          • 2. Re: Jboss6 MDB pools and WorkManager thread count are not in sync
            singh.vishal

            Thanks jbertram,

             

            1. I am new to this thread. I just saw the main URL https://developer.jboss.org/ so thought it place for jboss . Misssed [ All Places > HornetQDiscussions ] 

            Sorry for that. Next time surely I will take care of this.

            2. Yes, There are many questions.And I am trying to find out answer for these questions, but meanwhile if someone has answer and time please post.

            3. Yes, but it is legacy product and these are used in that.

             

            Also I find out "why some mdbs stop consuming messages". There were some corrupt messages in queue that were halting the consumer from processing.