4 Replies Latest reply on Aug 24, 2012 3:07 AM by Alexey Volkov

    JBoss 7.1.1 problem with EJB timer threads

    Eugene Osipov Newbie

      Hello! Sorry for my english.

      My application uses ejb single-action timers very intensively, so i created separate thread pool for that in standalone.xml:

       

      {code}

      <subsystem xmlns="urn:jboss:domain:ejb3:1.2">

      .....

          <timer-service thread-pool-name="TIMERS">

              <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>

          </timer-service>

      .....

          <thread-pools>

              <thread-pool name="TIMERS">

                  <max-threads count="200"/>

                  <keepalive-time time="1000" unit="milliseconds"/>

              </thread-pool>

          </thread-pools>

      </subsystem>

      {code}

       

      I assumed that unused threads, must die after 1 second idle time, but jboss keeps alive all 200 threads (in waiting state) infinitely.

      That wrong in my configuration? Maybe it's an issue?

      Thanks.

        • 1. Re: JBoss 7.1.1 problem with EJB timer threads
          Nicklas Karlsson Master

          Looking at the scema docs it says

           

          The nested "keepalive-time" element may used to specify the amount of time that pool threads should be kept running when idle; if not specified, threads will run until the executor is shut down.

           

          so I'm not sure if they are supposed to actually get killed off completetly

          • 2. Re: JBoss 7.1.1 problem with EJB timer threads
            Eugene Osipov Newbie

            Nicklas Karlsson wrote:

             

            Looking at the scema docs it says

             

            The nested "keepalive-time" element may used to specify the amount of time that pool threads should be kept running when idle; if not specified, threads will run until the executor is shut down.

             

            so I'm not sure if they are supposed to actually get killed off completetly

             

            Thanks, it seems as good explanation, but why when i had used default pool (default configuration):

             

            <subsystem xmlns="urn:jboss:domain:ejb3:1.2">
            .....
                 <timer-service thread-pool-name="default">
                      <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
                 </timer-service>
            .....
                 <thread-pools>
                      <thread-pool name="default">
                           <max-threads count="10"/>
                           <keepalive-time time="100" unit="milliseconds"/>
                      </thread-pool>
                 </thread-pools>
            </subsystem>

             

            idle threads were removed from the pool? When i connected by JConsole, i saw that count of timer threads  depends on application loading.

            • 3. Re: JBoss 7.1.1 problem with EJB timer threads
              Nicklas Karlsson Master

              Again, guessing here but perhaps the default implementation does stuff differently. Perhaps jboss-as-threads_1_1.xsd  can give some clues as there appear to be a ref over there (thread-factory)

              • 4. Re: JBoss 7.1.1 problem with EJB timer threads
                Alexey Volkov Newbie

                If I correctly understand what you mean server behavior of timer service thread pool with name "default" differs to timer service thread pools with another names?

                 

                Also I don't know how I can create reference from ejb subsystem to thread subsystems. Can you give any advice of how to do that?