You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dan Checkoway <dc...@gmail.com> on 2011/07/21 18:12:37 UTC

AccessLogValve %D and acceptCount tuning

http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
*%D* - Time taken to process the request, in millis

What does %D in the actually represent?  Let's say the stack trace looks
like:

       at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:403)
       at
org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:369)
       at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:317)
       at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1532)
       at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
       at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

Does %D represent the time spent in .run(), or .process(), or .service(), or
something else?

Assume non-keepalive for the moment.  What happens if a client
connects...but waits some period of time after connecting before the thread
pool can service the request?  Is there a way to see (log) that amount of
time?

For example, I'm trying to tune my acceptCount.  I understand the default is
100, but I'm interested in possibly cranking that up.  I'd like to be able
to quantify this experiment somehow, to see how much time a client spent
waiting *after* the socket connection was established, but before the thread
pool actually serviced the request.

Any advice?

Thanks,
Dan

Re: AccessLogValve %D and acceptCount tuning

Posted by Dan Checkoway <dc...@gmail.com>.
Gotcha, makes sense.  Thanks Mark!

On Thu, Jul 21, 2011 at 6:52 PM, Mark Thomas <ma...@apache.org> wrote:

> On 21/07/2011 23:01, Pid wrote:
> > On 21/07/2011 17:16, Dan Checkoway wrote:
> >> Also forgot to ask...is there an MBean attribute that I can check via
> JMX to
> >> see how many established connections are waiting to be serviced?  i.e.
> if
> >> there's a backlog in the accept queue?
> >
> > Yes.  There is an attribute.
>
> Not for the current backlog there isn't (because it isn't visible to
> Java). There is an enhancement request for this in BZ that I don't see
> getting implemented any time soon.
>
> Mark
>
> > Have a nose around Tomcat using JConsole or VisualVM.
> >
> >
> > p
> >
> >
> > ---------------------------------------------------------------------
> > 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: AccessLogValve %D and acceptCount tuning

Posted by Mark Thomas <ma...@apache.org>.
On 21/07/2011 23:01, Pid wrote:
> On 21/07/2011 17:16, Dan Checkoway wrote:
>> Also forgot to ask...is there an MBean attribute that I can check via JMX to
>> see how many established connections are waiting to be serviced?  i.e. if
>> there's a backlog in the accept queue?
> 
> Yes.  There is an attribute.

Not for the current backlog there isn't (because it isn't visible to
Java). There is an enhancement request for this in BZ that I don't see
getting implemented any time soon.

Mark

> Have a nose around Tomcat using JConsole or VisualVM.
> 
> 
> p
> 
> 
> ---------------------------------------------------------------------
> 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: AccessLogValve %D and acceptCount tuning

Posted by Dan Checkoway <dc...@gmail.com>.
Can you point me in the right direction?  I'm using 7.0.19, poked with
JConsole before my original post and can't see anything that indicates a
current count of accepted connections.  I've looked at Connector, Engine,
GlobalRequestProcessor, Host, ProtocolHandler, Server, Service...you name,
I've tried looking at its attributes.

If it's there it's probably staring me right in the face...help?

i.e. let's say I do something stupid like maxThreads="1" acceptCount="10000"
and my one thread is occupied.  How can I find out how many connections are
established and waiting to be handled?

I suppose I can try using netstat to count ESTABLISHED connections
instead...

Dan

On Thu, Jul 21, 2011 at 6:01 PM, Pid <pi...@pidster.com> wrote:

> On 21/07/2011 17:16, Dan Checkoway wrote:
> > Also forgot to ask...is there an MBean attribute that I can check via JMX
> to
> > see how many established connections are waiting to be serviced?  i.e. if
> > there's a backlog in the accept queue?
>
> Yes.  There is an attribute.
> Have a nose around Tomcat using JConsole or VisualVM.
>
>
> p
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: AccessLogValve %D and acceptCount tuning

Posted by Pid <pi...@pidster.com>.
On 21/07/2011 17:16, Dan Checkoway wrote:
> Also forgot to ask...is there an MBean attribute that I can check via JMX to
> see how many established connections are waiting to be serviced?  i.e. if
> there's a backlog in the accept queue?

Yes.  There is an attribute.
Have a nose around Tomcat using JConsole or VisualVM.


p


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


Re: AccessLogValve %D and acceptCount tuning

Posted by Dan Checkoway <dc...@gmail.com>.
Also forgot to ask...is there an MBean attribute that I can check via JMX to
see how many established connections are waiting to be serviced?  i.e. if
there's a backlog in the accept queue?

On Thu, Jul 21, 2011 at 12:12 PM, Dan Checkoway <dc...@gmail.com>wrote:

> http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
> *%D* - Time taken to process the request, in millis
>
> What does %D in the actually represent?  Let's say the stack trace looks
> like:
>
>        at org.apache.catalina.connector.CoyoteAdapter.service
> (CoyoteAdapter.java:403)
>        at
> org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:369)
>        at
> org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:317)
>        at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1532)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>
> Does %D represent the time spent in .run(), or .process(), or .service(),
> or something else?
>
> Assume non-keepalive for the moment.  What happens if a client
> connects...but waits some period of time after connecting before the thread
> pool can service the request?  Is there a way to see (log) that amount of
> time?
>
> For example, I'm trying to tune my acceptCount.  I understand the default
> is 100, but I'm interested in possibly cranking that up.  I'd like to be
> able to quantify this experiment somehow, to see how much time a client
> spent waiting *after* the socket connection was established, but before the
> thread pool actually serviced the request.
>
> Any advice?
>
> Thanks,
> Dan
>
>