ActiveCount versus PoolSize for Thread Pool Statistics in WAS PMI
kgibm 0600027VAP Visits (8243)
WebSphere Application Server comes with the "Basic" level enabled in the Performance Monitoring Infrastructure (PMI) on every server by default. This usually has an overhead of about 2-3%. The Basic level comes with one statistic for all thread pools: PoolSize (see the "Level" column in the link). This is defined as "the average number of threads in pool." This is a bit confusing: it is quite literally just the number of thread objects in the thread pool; those thread objects may or may not actually be doing something. To see how many concurrent threads in the thread pool are actually in use (on average), then you need the ActiveCount statistic, which is defined as "the number of concurrently active threads." To enable this, you'll need to use either the Extended or Custom levels (see "Update" above).
I've done a quick demonstration of this: I have a servlet which sleeps for X seconds. I used Apache bench (ab, which is shipped with IHS) to send 20 concurrent requests to a server, all of which sleep for 120 seconds. The server's WebContainer thread pool was set to min=10, max=50. Here is the graph from the built-in Tivoli Performance Viewer (TPV) in the administrative console:
As the requests are running, both ActiveCount and PoolSize go up to about 20 (there is usually an extra thread counted because of AIO). As the requests finish, ActiveCount goes down to about 0 and PoolSize goes down to about 10. The latter occurs because the minimum thread pool size for the WebContainer thread pool was 10.
This demonstrates that ActiveCount is the more useful statistic to monitor thread pool activity.