You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vicky <vi...@gmail.com> on 2015/12/21 21:12:48 UTC

Tomcat Executor MBean

Hi,

I am using an embedded version of Tomcat 7.0.42. Using java executor with
either of the connectors i.e. BIO/NIO.

However while monitoring the server via JMX, I see the mbean attributes,

currentThreadCount

currentThreadsBusy

always showing the value "-1".

The only one that shows the appropriate dynamic value is connection count,
which seems to match the count of the client threads that I initiate.

Any idea how to get currentThreadCount and currentThreadsBusy to show the
right values?

Thanks

Re: Tomcat Executor MBean

Posted by Vicky <vi...@gmail.com>.
All i am doing is creating an instance of a connector and setting it with
an java executor with an custom thread pool. Not sure i get it, when you
say registering the executor mbean, thought if connector is just
programmatically created, it shouldn't have really mattered. Moreover, it
does show the connection count accurately.

Do you have any pointers/references about registering of the mbean thing.

-Vikram



On Tue, Dec 22, 2015 at 3:11 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> Vicky,
>
> On 12/21/15 3:12 PM, Vicky wrote:
> > I am using an embedded version of Tomcat 7.0.42. Using java executor with
> > either of the connectors i.e. BIO/NIO.
> >
> > However while monitoring the server via JMX, I see the mbean attributes,
> >
> > currentThreadCount
> >
> > currentThreadsBusy
> >
> > always showing the value "-1".
> >
> > The only one that shows the appropriate dynamic value is connection
> count,
> > which seems to match the count of the client threads that I initiate.
> >
> > Any idea how to get currentThreadCount and currentThreadsBusy to show the
> > right values?
>
> Are you registering the executor MBean with the JMX server? Tomcat will
> auto-register the <Executors> in server.xml when running non-embedded,
> but I'm not sure it will auto-register them if you programmatically add
> Executors in an embedded environment.
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat Executor MBean

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Vicky,

On 12/21/15 3:12 PM, Vicky wrote:
> I am using an embedded version of Tomcat 7.0.42. Using java executor with
> either of the connectors i.e. BIO/NIO.
> 
> However while monitoring the server via JMX, I see the mbean attributes,
> 
> currentThreadCount
> 
> currentThreadsBusy
> 
> always showing the value "-1".
> 
> The only one that shows the appropriate dynamic value is connection count,
> which seems to match the count of the client threads that I initiate.
> 
> Any idea how to get currentThreadCount and currentThreadsBusy to show the
> right values?

Are you registering the executor MBean with the JMX server? Tomcat will
auto-register the <Executors> in server.xml when running non-embedded,
but I'm not sure it will auto-register them if you programmatically add
Executors in an embedded environment.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org