Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 20238 invoked from network); 9 Jan 2007 02:17:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jan 2007 02:17:54 -0000 Received: (qmail 67865 invoked by uid 500); 9 Jan 2007 02:17:58 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 67167 invoked by uid 500); 9 Jan 2007 02:17:55 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 67156 invoked by uid 99); 9 Jan 2007 02:17:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2007 18:17:55 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [149.28.9.26] (HELO newman.ridge.aps.org) (149.28.9.26) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2007 18:17:45 -0800 Received: from [192.168.9.101] (ool-182ee338.dyn.optonline.net [24.46.227.56]) (authenticated bits=0) by newman.ridge.aps.org (8.13.6/8.13.1) with ESMTP id l092HNUD093692 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Mon, 8 Jan 2007 21:17:24 -0500 (EST) (envelope-from lenny@aps.org) Mime-Version: 1.0 (Apple Message framework v752.2) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: dev@tomcat.apache.org From: Lenny Marks Subject: Connector bufferSize > 8K restriction Date: Mon, 8 Jan 2007 21:17:19 -0500 X-Mailer: Apple Mail (2.752.2) X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on newman.ridge.aps.org X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=3.7 required=9.0 tests=RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=disabled version=3.1.4 I posted a long while ago about not being able to decrease the response buffer below 8K. http://marc.theaimsgroup.com/?l=tomcat-dev&m=109218414305332&w=2 See also: Re: AJP/Java connector issues http://marc.theaimsgroup.com/?l=tomcat- dev&m=111653712502047&w=2 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. -lenny Index: catalina/src/share/org/apache/catalina/connector/Response.java =================================================================== --- catalina/src/share/org/apache/catalina/connector/ Response.java (revision 494201) +++ catalina/src/share/org/apache/catalina/connector/ Response.java (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: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org