tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lenny Marks <>
Subject Connector bufferSize > 8K restriction
Date Tue, 09 Jan 2007 02:17:19 GMT
I posted a long while ago about not being able to decrease the  
response buffer below 8K.

See also:
Re: AJP/Java connector issues 

I realize that I'm not familiar with all the low level reasons why  
this is such a bad thing but IMO, it seems like a reasonable tradeoff  
depending on the situation to increase the the number of packets  
going across the network in favor of faster initial response times.  
At the very least, I think it would be a good thing if it was  
documented with the Tomcat Connector configuration for bufferSize  
that the it cannot be decreased and preferably also why. Even better  
if that documentation could just advise and leave the decision up to  
the deployer.  Actually the documentation for the AJP connector says  
that the default bufferSize = -1(not buffered). From what I can see,  
I don't think the setting has any effect on the actual buffer size.  
I've applied the following patch for us, but I wasn't sure why it(or  
something similar) would be bad for the Tomcat code base in general.  
I did notice that Connector.getBufferSize() is deprecated, however  
this would allow each of the different Connector implementations to  
override with their own default bufferSize values.


Index: catalina/src/share/org/apache/catalina/connector/
--- catalina/src/share/org/apache/catalina/connector/      (revision 494201)
+++ catalina/src/share/org/apache/catalina/connector/      (working copy)
@@ -129,12 +129,7 @@
       public void setConnector(Connector connector) {
           this.connector = connector;
-        if("AJP/1.3".equals(connector.getProtocol())) {
-            // default size to size of one ajp-packet
-            outputBuffer = new OutputBuffer(8184);
-        } else {
-            outputBuffer = new OutputBuffer();
-        }
+        outputBuffer = new OutputBuffer(connector.getBufferSize());
           outputStream = new CoyoteOutputStream(outputBuffer);
           writer = new CoyoteWriter(outputBuffer);

Lenny Marks
Software Architect
American Physical Society

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

View raw message