You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ruslan Gainutdinov <ru...@gmail.com> on 2010/10/21 22:58:00 UTC
Is there any JMX property which indicates no requests is being processed?
Hello!
Is there any JMX property which indicates no requests is being processed, and
no requests are waiting in the queue?
I am trying to develop a way to gracefully shutdown tomcat as part of
mod_jk cluster.
Because requests can be long (up to 1 hour) and must be successfully processed,
there must be separate way to ensure no requests are in queue before
shutting down server.
With kindest personal regards,
Ruslan Gainutdinov
<ru...@gmail.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Is there any JMX property which indicates no requests is being processed?
Posted by David Fisher <df...@jmlafferty.com>.
Hi,
I was just playing with the correct jmx properties. My purpose is to see what are the maximum requests and watch the health of my servers.
MBeanServerConnection mbs = jmxpool.getConnection(host);
ObjectName query = new ObjectName("Catalina:type=RequestProcessor,worker=*,name=*");
Set<ObjectInstance> set;
try {
set = mbs.queryMBeans(query, null);
} catch (Exception e) {
continue;
}
for (ObjectInstance inst : set) {
Integer cnt = (Integer) mbs.getAttribute(inst.getObjectName(), "requestCount");
if (cnt == 0) continue;
String name = inst.getObjectName().getKeyProperty("worker") + "/" + inst.getObjectName().getKeyProperty("name");
// I haven't tried the following parameters, but this what is there in jconsole.
String currentUri = (String) mbs.getAttribute(inst.getObjectName(), "currentUri");
String currentQueryString = (String) mbs.getAttribute(inst.getObjectName(), "currentQueryString");
Long sent = (Long) mbs.getAttribute(inst.getObjectName(), "requestBytesSent");
Long received = (Long) mbs.getAttribute(inst.getObjectName(), "requestBytesReceived");
Long total = (Long) mbs.getAttribute(inst.getObjectName(), "requestProcessingTime");
// Do whatever you want.
}
Good luck.
Regards,
Dave
On Oct 21, 2010, at 1:58 PM, Ruslan Gainutdinov wrote:
> Hello!
>
> Is there any JMX property which indicates no requests is being processed, and
> no requests are waiting in the queue?
>
> I am trying to develop a way to gracefully shutdown tomcat as part of
> mod_jk cluster.
>
> Because requests can be long (up to 1 hour) and must be successfully processed,
> there must be separate way to ensure no requests are in queue before
> shutting down server.
>
> With kindest personal regards,
> Ruslan Gainutdinov
> <ru...@gmail.com>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Is there any JMX property which indicates no requests is being
processed?
Posted by Pid <pi...@pidster.com>.
On 21/10/2010 21:58, Ruslan Gainutdinov wrote:
> Hello!
>
> Is there any JMX property which indicates no requests is being processed, and
> no requests are waiting in the queue?
Implement the Executor element, then examine it using JConsole.
You'll see the properties you need.
p
> I am trying to develop a way to gracefully shutdown tomcat as part of
> mod_jk cluster.
>
> Because requests can be long (up to 1 hour) and must be successfully processed,
> there must be separate way to ensure no requests are in queue before
> shutting down server.
>
> With kindest personal regards,
> Ruslan Gainutdinov
> <ru...@gmail.com>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>