10 Replies Latest reply on Jul 1, 2009 10:03 AM by gaohoward

    Thread Pool questions

    andy.miller

      Within AS 5.1.0 and JBM 1.4.3, I'm curious how the various pools interact. When I have an EJB 3 application with stateless session beans that enqueue a message and it gets dequeued by an EJB 3 MDB, what pools are actually being used?

      In my specific case, everything is within the VM, so I have a servlet calling the SSB, which enqueues a message, and an MDB consumes the message.

      So, what appears to be happening is the thread pool in the servlet container runs the servlet that calls the SSB, and the SSB call, since its in VM stays executing on that thread (http thread pool), and then when the message is enqueued from the SSB, it is running on the JCA WorkManager thread (inflow), and when its dequeued from the MDB its on the JCA WorkManager thread as well, and I don't see that the thread pool for JBM is being used, but maybe it is.

      Also, in looking through the documentation, there appears to be two pools for JBM. One is the TCP connection pool, controlled in the remoting-bisocket-service.xml with the JBM_clientMaxPool setting, which would seem to only be used if the client was remote, and the documentation states a clientMaxPool which seems to be an actual thread pool for execution, but I don't find it in the actual configuration anywhere.

      So, are either of those two pools actually used in my example case?

        • 1. Re: Thread Pool questions
          gaohoward

          Inside the AS container, a MDB's connection to JBM is handled by JCA layer, which has its own pooling of connections.

          JBM_clientMaxPool is not about connection pool, it's about thread pool size at the remoting client side.

          I don't see what do you refer to the TCP connection pool, can you clarify it? thanks

          • 2. Re: Thread Pool questions
            andy.miller

             

            "gaohoward" wrote:
            Inside the AS container, a MDB's connection to JBM is handled by JCA layer, which has its own pooling of connections.

            JBM_clientMaxPool is not about connection pool, it's about thread pool size at the remoting client side.

            I don't see what do you refer to the TCP connection pool, can you clarify it? thanks


            Well, the JBM_clientMaxPool is a thread pool for TCP connections, so that is what I was referring to, and you confirmed it.

            I was under the impression that there was a thread pool for JBM underneath the JCA pool, and that the clientMaxPool setting in the documentation is how you configure that.

            • 3. Re: Thread Pool questions
              andy.miller

               

              "andy.miller@jboss.com" wrote:
              "gaohoward" wrote:
              Inside the AS container, a MDB's connection to JBM is handled by JCA layer, which has its own pooling of connections.

              JBM_clientMaxPool is not about connection pool, it's about thread pool size at the remoting client side.

              I don't see what do you refer to the TCP connection pool, can you clarify it? thanks


              Well, the JBM_clientMaxPool is a thread pool for TCP connections, so that is what I was referring to, and you confirmed it.

              I was under the impression that there was a thread pool for JBM underneath the JCA pool, and that the clientMaxPool setting in the documentation is how you configure that.


              I meant maxPoolSize in the documentation.

              • 4. Re: Thread Pool questions
                gaohoward

                The maxPoolSize is the max number of server threads that process requests. It's a remoting configuration parameter.

                • 5. Re: Thread Pool questions
                  andy.miller

                   

                  "gaohoward" wrote:
                  The maxPoolSize is the max number of server threads that process requests. It's a remoting configuration parameter.


                  It appears to be something set in jms-ds.xml and nothing to do with remoting correct?

                  Or in the case where the client is remote, you set it in the remoting configuration as well?

                  • 6. Re: Thread Pool questions
                    gaohoward

                    Hi,

                    I don't know if jms-ds.xml has such a parameter, you can ask the JCA forum about it. JBoss remoting does has such a parameter, you can read about it in the jboss remoting's doc. The remoting configuration file is set at the JBM server side only.

                    • 7. Re: Thread Pool questions
                      andy.miller

                       

                      "gaohoward" wrote:
                      Hi,

                      I don't know if jms-ds.xml has such a parameter, you can ask the JCA forum about it. JBoss remoting does has such a parameter, you can read about it in the jboss remoting's doc. The remoting configuration file is set at the JBM server side only.


                      I know there is a JCA thread pool, as I already talked to them, and that's not what I'm after.

                      I find maxPoolSize in jms-ds.xml in the current releases of AS, so I also know about that.

                      So, what I'm trying to make sure I understand is what parameter does what? The remoting configuration seems an unlikely place to be setting a thread pool for an in JVM invocation.

                      For example, in EJB 3 land, there is a thread pool for remote clients that make EJB calls, but that is bypassed when the call comes from within the same JVM.

                      I would expect the same behavior from messaging, where the remoting configuration would be only for remote clients, and there would be different behavior for the in JVM calls.

                      • 8. Re: Thread Pool questions
                        gaohoward

                        I know in JBoss Remoting there is difference in handling VM local and remote calls. But I don't know about the details. You can ask the remoting forum or the remoting doc. In JBM doc, you can also find some of the key remoting parameters too.

                        Howard

                        • 9. Re: Thread Pool questions
                          andy.miller

                           

                          "gaohoward" wrote:
                          I know in JBoss Remoting there is difference in handling VM local and remote calls. But I don't know about the details. You can ask the remoting forum or the remoting doc. In JBM doc, you can also find some of the key remoting parameters too.

                          Howard


                          Since my case is in JVM I really don't see how remoting has anything to do with it, and right in the jms-ds.xml file is the maxPoolSize parameter.

                          Right now, my assumption is the maxPoolSize paramter in jms-ds.xml is controlling the server thread pool for in JVM calls, but it would be nice to know that without digging through the source.

                          • 10. Re: Thread Pool questions
                            gaohoward

                            Hi,

                            About the maxPoolSize, i think it's the max size of JCA connection pool, I found this wiki that may help to understand this param.

                            http://www.jboss.org/community/wiki/ConfigJCACommon