Thursday, April 12, 2012

The real meaning of the ActiveTime PMI statistic in WebSphere

For thread pools, WebSphere has a PMI statistic called ActiveTime. According to the documentation it is defined as the average time in milliseconds the threads are in active state. There is also a statistic called ActiveCount that measures the number of concurrently active threads. E.g. on the WebContainer thread pool this statistic enables one to determine the number of servlet requests being processed simultaneously at a given point in time.

One would expect that correspondingly, ActiveTime measures the average time it takes to execute a task on the thread pool and that on the WebContainer thread pool this would be the average time to process a servlet request. However, this is not the case at all. Although the documentation of the two metrics both refer to "active threads", they measure two completely different things. In fact, ActiveTime measures the average time that threads declared hanging have been active [For the readers not familiar with how WebSphere thread pools work, a thread is flagged as hanging after it has been active for longer than a configurable amount of time (10 minutes by default)]. Obviously this definition renders the ActiveTime statistic pretty much useless in most cases.

2 comments:

  1. how about the "WebContainer > COUNTER:, name=PoolSize" ... the highWaterMark value; where exactly does that come from ? Is it a buffer of waiting threads to jump into action, or a real number ? Because the "Active" counter sometimes never reaches as high as the highWaterMark counter.

    ReplyDelete
  2. Normally, the highWaterMark (resp. lowWaterMark) gives the maximum value (resp. minimum value) of the statistic since the start of the server (or the last time the statistic has been reset). However, it looks like for the PoolSize statistic, WebSphere initializes the highWaterMark incorrectly. It is initially set to the minimum pool size instead of zero. This would make sense if the thread pool pre-created threads, but this is not the case (at least not in developer mode): the thread pool only creates threads on demand.

    ReplyDelete