3 Replies Latest reply on Jun 7, 2013 5:39 PM by Kristina Clair

    Thread pool question in AS 7

    Jacob Marcus Newbie



      One thing I noticed in the tests I did with AS 7 is that threads created hang around. They don't seem to go away after they are idle and not doing anything for a very long time. Ideally I would like to have a smaller number in this ready and waiting state. My application has bursty traffic. So I expect additional threads to be created on a need basis as long as they are < max-connections specified at the connector level. But I expect these extra threads to be killed/removed after the burst and have only a smaller number remaining in the ready state.



      Here is an example config I used for testing purposes.


      <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" max-connections="20"/>


      Once 20 threads are created, all 20 of them remain.


      I understand that I can use an executor configuration like this to get close to what I want. But  am reading in some messages that using the executor may impact throughput/performance.


      <subsystem xmlns="urn:jboss:domain:threads:1.1">

                  <bounded-queue-thread-pool name="test" allow-core-timeout="false">

                      <core-threads count="5"/>

                      <queue-length count="1"/>

                      <max-threads count="20"/>

                      <keepalive-time time="10" unit="seconds"/>




      In this I am able to keep 5 threads in a waiting state. Another 15 can be created on demand and discarded after use. I gave a small queue length as I found that a larger queue seemed to make the server hesitate to create additional threads and thus impacted throughput.


      1) Is there anyway to achieve what I am looking for without using an executor in AS 7?

      2)  I like the queue concept but would like it to come into play after the max-threads have reached. I saw documentation of the org.apache.catalina.core.StandardThreadExecutor in jboss 7?