On 05.06.2009 22:04, Christopher Schultz wrote:
> Chuck,
> 
> On 6/5/2009 1:17 PM, Caldarale, Charles R wrote:
>>> From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: concurrent
>>> connections with mod_jk/apache/tomcat
>>>
>>> The only time when a browser would fire off "simultaneous" 
>>> requests, is if there were several windows or frames open, each
>>> making its own connection, and requests on it.
>> Not true; a browser will normally open extra connections for any
>> objects associated with a page, including style sheets, embedded
>> images, applets, etc.
> 
> Yes, and this appears to be the case that the OP gave: firebug in fact
> shows that some resources are fetched /before/ the last byte of the
> parent request is received. But, of course, only for Tomcat standalone.
> 
> I am unclear as to why these two servers could be behaving differently.
> It seems that the requests are partially serialized when httpd is in the
> mix.
> 
> I wonder if mod_jk is buffering the response in httpd so most of the 3.2
> seconds the response takes to come back is spent in httpd just waiting
> for the final byte to flush back to the client. When contacting Tomcat
> directly, the bytes (maybe) come back sooner, and so the browser can
> start making requests for dependent files earlier.

Buffering inside httpd could be, but ...

> 4KiB (the size of the primary response) sounds like it might just small
> enough to fit into a default buffer for mod_jk. Try some of these
> options, individually and/or together:

for 4KB I would expect, that the full response comes from Tomcat in one
single AJP body packet (plus one header packet) and the buffering would
then happen inside Tomcat.

The OP could switch to JkLogLevel trace, so he would notice each AJP
packet coming in from Tomcat with its hex dump and verify, that there is
one header packet and then only one packet with the full body.

If so, the only possibility would be to already try to flush inside
Tomcat, possibly combined with ...

> JkOptions +FlushHeader +FlushPackets

in order to make the flush also effective for httpd.

> Setting +FlushPackets will make mod_jk send the bytes it receives from
> Tomcat /immediately/ with no further buffering (other than the size of
> an AJP packet, which is allegedly limited to 8KiB).
> 
> Another option would be to use mox_proxy_http instead of mod_jk, which
> may have other buffering options to play with.

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to