tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <>
Subject Re: AJP/Java connector issues
Date Thu, 19 May 2005 22:23:27 GMT

----- Original Message -----
From: "Mladen Turk" <>
To: "Tomcat Developers List" <>
Sent: Thursday, May 19, 2005 2:19 PM
Subject: Re: AJP/Java connector issues

> Bill Barker wrote:
> >
> >
> > I see what this is now:  The default Connector OutputBuffer size is 8K,
> > so it's sending the output to JkInputStream in 8K chunks.  JkInputStream
> > sends all of the 8K to Apache in two chunks.
> >
> > As a Coyote OutputBuffer, it's not really JkInputStream's job to do
> > additional buffering.  It's probably better to do
> > response.setBufferSize(20000); so that the Connector will send the whole
> > thing to JkInputStream as one chunk.
> >
> Sure that seems to be the problem, but it's hard to convince the users
> to write the applications having AJP packet size in mind ;)
> The best would be that instead default 8192 bytes, when AJP connector
> is loaded that response size is either set to 8184 or 16386 bytes
> (one or two packets) by default.
> Is something like that possible?

It would be really easy to default to 8184 for all Connectors (just change
the value in o.a.c.connector.OutputBuffer).  I'm not so sure how happy that
would make Remy.

It wouldn't be too hard to have Connector.createResponse check the protocol,
and if it's AJP/1.3 then set the buffer size to 16386 (currently it's not
possible to decrease the buffer size).

It wouldn't be that hard to add buffering to JkInputStream so that it always
tries to write out a 8184 packet.  This would also prevent fracturing in the
event that the webapp programmer decides to call response.setBufferSize
herself.  The downside would be an extra arraycopy when writing (and, of
course, an extra 8184*numThreads bytes of memory used :).

> Regards,
> Mladen.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

This message is intended only for the use of the person(s) listed above as the intended recipient(s),
and may contain information that is PRIVILEGED and CONFIDENTIAL.  If you are not an intended
recipient, you may not read, copy, or distribute this message or any attachment. If you received
this communication in error, please notify us immediately by e-mail and then delete all copies
of this message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet
is not secure. Do not send confidential or sensitive information, such as social security
numbers, account numbers, personal identification numbers and passwords, to us via ordinary
(unencrypted) e-mail.

View raw message