tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <>
Subject Re: backlog measurement
Date Thu, 10 Jan 2008 17:10:48 GMT
I'm a bit confused on how you can measure backlog in Java. Backlog is a 
TCP stack implementation setting.
Also, between TCP implementations, there is no firm definition of what 
backlog actually means. does it mean SYN_RCVD or ESTABLISHED but not yet 

If I read the implementation correct, this has nothing to do with 
backlog, since you are accepting the connections into the process, ie, 
the handshake is done, and the accept call has returned. this connection 
is no longer subject to the TCP backlog (IIRC).

This implementation, would prematurely accept connections, causing the 
system to take up memory for send and receive buffers for the Java process.

Andrew Skiba wrote:
> Hello,
> I want to contribute a custom SocketFactory allowing to analyze the 
> utilization of acceptConnection attribute of a Connector. In a 
> properly configured production system, there should be rare situations 
> where connections wait for a worker thread to be handled. Our client 
> complained on high latency of web requests, but the measurement on 
> servlet did not show high latency. So we wanted to know the number of 
> connections which wait in socket backlog and were not accepted yet.
> I solved this problem by writing a custom SocketFactory, which accepts 
> connections immediately and puts it in my queue until a call to 
> accept() will take them. So the number of waiting connections can be 
> monitored via JMX.
> To activate this factory, the declaration of the corresponding 
> Connector in server.xml should be changed like in the following example.
>  <Connector port="8080" maxHttpHeaderSize="8192"
>                maxThreads="10" minSpareThreads="5" maxSpareThreads="7"
>                enableLookups="false" redirectPort="8443" acceptCount="10"
>                connectionTimeout="2000" disableUploadTimeout="true"
> socketFactory=""/>
> No changes in existing classes are required.
> Please review the code in the attachment.
> Andrew Skiba.
> ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> ------------------------------------------------------------------------
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.19.0/1216 - Release Date: 1/9/2008 10:16 AM

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message