-
1. Re: ThreadLocalPool - Is it working the way we think?
alrubinger Sep 21, 2009 5:49 PM (in response to andy.miller)Do you feel this is more in part due to the ThreadLocal implementation of the pool, or the fact that it's unbounded (==we spread things too thin)?
S,
ALR -
2. Re: ThreadLocalPool - Is it working the way we think?
andy.miller Sep 21, 2009 6:57 PM (in response to andy.miller)"ALRubinger" wrote:
Do you feel this is more in part due to the ThreadLocal implementation of the pool, or the fact that it's unbounded (==we spread things too thin)?
S,
ALR
Actually, I think its because of the ThreadLocal implementation. For example, in one of the cases where we switched the configuration to use the StrictMaxPool, I had to set it to 6 million to get rid of the timeouts, and throughput still went up. In the other case, the configuration was only 100 (on both ThreadLocalPool and StrictMaxPool), and throughput increase by 300 transactions per second. -
3. Re: ThreadLocalPool - Is it working the way we think?
wolfc Sep 22, 2009 5:53 AM (in response to andy.miller)Two issues:
1. the original ThreadlocalPool was designed incur zero thread contention. This changed when statistics were implemented. Right now that uses sync blocks, but it could be changed to atomics. Still it would incur a penalty.
2. a ThreadlocalPool servicing a ThreadPool with a size > 100 will always have a lower throughput than a StrictMaxPool with maximum size 100. The maximum size of ThreadlocalPool is not applicable.
To really identify performance bottlenecks within enterprise beans you would need to know:
- average queue size
- average execution time
- average wait time
We also need to microbench all the pool implementations to see their effect on throughput & average response time. -
4. Re: ThreadLocalPool - Is it working the way we think?
andy.miller Sep 22, 2009 10:41 AM (in response to andy.miller)"wolfc" wrote:
Two issues:
1. the original ThreadlocalPool was designed incur zero thread contention. This changed when statistics were implemented. Right now that uses sync blocks, but it could be changed to atomics. Still it would incur a penalty.
2. a ThreadlocalPool servicing a ThreadPool with a size > 100 will always have a lower throughput than a StrictMaxPool with maximum size 100. The maximum size of ThreadlocalPool is not applicable.
To really identify performance bottlenecks within enterprise beans you would need to know:
- average queue size
- average execution time
- average wait time
We also need to microbench all the pool implementations to see their effect on throughput & average response time.
Yes, the statistics require synchronization, which is part of the point. If you need the statistics, then you lose the benefits of it being a ThreadLocal.
I also seem to remember that it also synchronizes on the ArrayList for the instance references too though.