Bug 38332 - Documented AJP Connector configuration for pending request queue size in error
Summary: Documented AJP Connector configuration for pending request queue size in error
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Connector:AJP (show other bugs)
Version: 5.5.9
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL: http://tomcat.apache.org/tomcat-5.5-d...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-20 16:35 UTC by James McClure
Modified: 2007-01-06 06:39 UTC (History)
1 user (show)



Attachments
Patch against svn tomcat/connectors/trunk (1.23 KB, patch)
2007-01-05 00:24 UTC, Takayoshi Kimura
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James McClure 2006-01-20 16:35:56 UTC
In configuring my AJP13 connector between Tomcat 5.5.9 and Apache2 (on Red Hat 
Enterprise 3 with Java 1.5) I am finding that the attribute named "backlog" 
seems to have no affect, while the attribute named "acceptCount" does.

In my original load/configuration testing for deployment I had copied existing 
Connector configuration in the server.xml file from other defined Connectors.  
These use the "acceptCount" attribute name to manipulate the size of the 
pending request queue size.  However, the documentation for this same 
configuation specifies the use of "backlog", which does not appear to have an 
effect on performance.

I have inquired the users group about this topic, but have had no reply.  
Since I am seeing a performance change using "acceptCount", I can only assume 
at this time that the documentation is in error.

See http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html
Comment 1 Yoav Shapira 2006-12-24 18:03:44 UTC
Are you sure you were using the AJP connector class?  Looking at the current
code (which may have changed since you reported this issue), backlog is the
right parameter, acceptCount is outdated, so the documentation seems OK.
Comment 2 Andrew Adamov 2006-12-29 13:13:55 UTC
I have the same problem with Tomcat 5.5.20.

It looks like the JK handler ignores both backlog and acceptCount parameters, 
and always uses the default value (50) for the socket listen queue size:

<Connector address="10.225.96.83" port="11001"
           maxThreads="800" minSpareThreads="10" maxSpareThreads="100" 
           connectionTimeout="30000" backlog="100" acceptCount="100" 
           enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

strace:
socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 29
bind(29, {sa_family=AF_INET6, sin6_port=htons(11001), inet_pton
(AF_INET6, "::ffff:10.225.96.83", &sin6_addr), sin6_flowinfo=0, 
sin6_scope_id=0}, 28) = 0
listen(29, 50)                          = 0


The HTTP handler uses acceptCount value, as expected:

<Connector address="10.225.96.83" port="11000" maxHttpHeaderSize="8192"
           maxThreads="800" minSpareThreads="10" maxSpareThreads="100"
           connectionTimeout="30000" acceptCount="100"
           enableLookups="false" redirectPort="8443" 
disableUploadTimeout="true" />

strace:
socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 10
bind(10, {sa_family=AF_INET6, sin6_port=htons(11000), inet_pton
(AF_INET6, "::ffff:10.225.96.83", &sin6_addr), sin6_flowinfo=0, 
sin6_scope_id=0}, 28) = 0
listen(10, 100)                         = 0
Comment 3 Takayoshi Kimura 2007-01-05 00:22:04 UTC
"acceptCount" will be replaced with "backlog" by 
org.apache.catalina.connector.Connector class. Those attributes are same.

(In reply to comment #2)
> I have the same problem with Tomcat 5.5.20.
> 
> It looks like the JK handler ignores both backlog and acceptCount parameters, 
> and always uses the default value (50) for the socket listen queue size:

I have confirmed this behavior. It is org.apache.jk.common.ChannelSocket
class, a part of Pure Java (Non-APR) AJP Connector.
The class has empty setBacklog(int i) method and always uses 0 for 
ServerSocket backlog (0 means to use OS default value).
Comment 4 Takayoshi Kimura 2007-01-05 00:24:47 UTC
Created attachment 19365 [details]
Patch against svn tomcat/connectors/trunk
Comment 5 Takayoshi Kimura 2007-01-05 00:36:31 UTC
Those documents say the default value of backlog (acceptCount) is 10, but
the actual default value is 100(see *Endpoint.java). 
I think it seems documentation errors. If 100 is correct value, please 
don't forget to change the default backlog value included my patch.

http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
Comment 6 Peter Rossbach 2007-01-06 06:39:07 UTC
Done - Committed revision 493480.

Many thanks
Peter