4 Replies Latest reply on Oct 14, 2008 1:39 AM by justinwalsh

    Which thread pool services SLSB requests in AS?

      Hi,

      Not sure if this is a JBoss AS question or a remoting question - will be glad to move the post if required.

      Basically I am trying to find out which thread pool contains the worker threads which service incoming (remote) requests made to stateless session beans in JBoss AS so that I can configure it.

      The only references to thread pools in jboss-service.xml that I can see are for the NamingService and WebService. The naming service reference appears to be a pool for bootstrap lookups. Not sure if this is what I'm after.

      NamingService:

      <mbean code="org.jboss.naming.NamingService"
       name="jboss:service=Naming"
       xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
      ...
      <!-- The thread pool service used to control the bootstrap lookups -->
       <depends optional-attribute-name="LookupPool"
       proxy-type="attribute">jboss.system:service=ThreadPool</depends>
      ...
      
      </mbean>
      ...
      


      This is a stack at the point of a breakpoint in the SLSB

      Thread [WorkerThread#0[127.0.0.1:3398]] (Suspended (breakpoint at line 95 in FooBean))
       FooBean.save(ApplicationContext, Object) line: 95
       NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
       NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
       DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
       Method.invoke(Object, Object...) line: 585
       MarshalledInvocation(Invocation).performCall(Object, Method, Object[]) line: 359
       StatelessSessionContainer$ContainerInterceptor.invoke(Invocation) line: 237
      .....
      
       Invocation.invoke() line: 86
       XMBean(AbstractMBeanInvoker).invoke(String, Object[], String[]) line: 264
       MBeanServerImpl.invoke(ObjectName, String, Object[], String[]) line: 659
       UnifiedInvokerHA.invoke(InvocationRequest) line: 146
       SocketServerInvoker(ServerInvoker).invoke(InvocationRequest) line: 769
       ServerThread.processInvocation(SocketWrapper) line: 573
       ServerThread.dorun() line: 387
       ServerThread.run() line: 166


      Any pointers in the right direction apprectiated

      Thanks

        • 1. Re: Which thread pool services SLSB requests in AS?
          ron_sigal

          Hi Justin,

          You're in the right forum - the ServerThread you're looking at is an org.jboss.remoting.transport.socket.ServerThread, and the pool of ServerThreads is configured in the org.jboss.remoting.transport.socket.SocketServerInvoker that services EJB3s. The configuration is found in file $JBOSS_HOME/server/$CONFIG/deploy/ejb3.deployer/META-INF/jboss-service.xml, in particular, the lines

           <mbean code="org.jboss.remoting.transport.Connector"
           name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
           <depends>jboss.aop:service=AspectDeployer</depends>
           <attribute name="InvokerLocator">socket://${jboss.bind.address}:3873</attribute>
           <attribute name="Configuration">
           <handlers>
           <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
           </handlers>
           </attribute>
           </mbean>
          


          If, for example, you want to increase the number of worker threads, append the "maxPoolSize" parameter to the InvokerLocator attribute:

           <attribute name="InvokerLocator">socket://${jboss.bind.address}:3873/?maxPoolSize=500</attribute>
          


          For more information, see the Remoting Guide (http://www.jboss.org/jbossremoting/docs/guide/2.2/html/index.html), particularly Section 5.4.5. "Socket Invoker".

          -Ron

          • 2. Re: Which thread pool services SLSB requests in AS?

            Hi Ron,

            Thanks for your reply - appreciate it.

            I probably should have mentioned that I'm using 2.1 EJBs and not EJB3. So I assume that the the equivalent of the $JBOSS_HOME/server/$CONFIG/deploy/ejb3.deployer/META-INF/jboss-service.xml is $JBOSS_HOME/server/$CONFIG/deploy/ejb-deployer.xml file

            Problem is that I don't see any invokers defined in this file.

            Digging a little deeper, on the jmx-console in the jboss.remoting domain I have:

             * dataType=invocation,enableTcpNoDelay=true,host=10.0.0.85,marshaller=org.jboss.invocation.unified.marshall.InvocationMarshaller,port=4446,service=invoker,socketTimeout=600000,transport= socket,unmarshaller=org.jboss.invocation.unified.marshall.InvocationUnMarshaller
             * handler=ejb3,name=DefaultEjb3Connector,type=Connector
             * host=10.0.0.85,port=3873,service=invoker,transport=socket
             * service=Connector,transport=socket
             * service=NetworkRegistry
            
            


            Is this invoker the one that I am after?
            service=Connector,transport=socket
            


            Which is defined (and configured) as follows in jboss-service.xml
            <mbean code="org.jboss.remoting.transport.Connector"
             name="jboss.remoting:service=Connector,transport=socket"
             display-name="Socket transport Connector">
            ...
             <!--<attribute name="maxPoolSize">303</attribute> -->
            ...
            </mbean>
            


            Which I can configure by un-commenting (and customising) the above maxPoolSize setting. If so, any idea what the default is?

            Thanks,
            Justin

            • 3. Re: Which thread pool services SLSB requests in AS?
              ron_sigal

              Hey Justin,

              "justinwalsh" wrote:

              So I assume that the the equivalent of the $JBOSS_HOME/server/$CONFIG/deploy/ejb3.deployer/META-INF/jboss-service.xml is $JBOSS_HOME/server/$CONFIG/deploy/ejb-deployer.xml file


              Good guess, but as you know, nothing is ever that simple. :)

              Actually, 2.x EJBs are part of the older, somewhat more monolithic structure of the Application Server, whereas EJB3s are just another component. Consequently, the 2.x EJB transport is configured in $JBOSS_HOME/server/$CONFIG/conf/jboss-service.xml in the "jboss.remoting:service=Connector,transport=socket" MBean, as you correctly guessed.

              The default value for "maxPoolSize" is 300.

              -Ron

              • 4. Re: Which thread pool services SLSB requests in AS?

                Thanks Ron, much appreciated