Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to monitor Tomcat 6.0 using JMX. Specifically, I want to monitor the number of active threads servicing requests so I can get an alert if it approaches the maximum. While I have JMX monitoring working in general, I can't seem to get the number of threads. Everything I have read suggests looking at:

Catalina:type=ThreadPool,name=http-8080

And examining the currentThreadsBusy attribute. Unfortunately, I only ever seem to get -1 as a value. I've tried it on five different Tomcat instances and I always get -1.

Is there something I'm missing? Should I be looking at a different value?

EDIT #1

I'm using an Executor, so I checked the activeCount attribute in the Executor and it always returns 0.

share|improve this question
add comment

1 Answer

The value can become negative if you're using an Executor, i.e. a thread pool shared between components. If you have configured an Executor (verify this in the server.xml), you can get the value you're interested in from the Executor's attribute activeCount.

With Tomcat 7 you wouldn't have this problem, I believe.

share|improve this answer
    
I am using an Executor, so that's helpful to know. Unfortunately, activeCount always returns 0. –  organicveggie Mar 8 '11 at 0:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.