[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-dev
Subject:    Re: Filters and Transfer-Encoding: chunked
From:       Wolfgang Hoschek <wolfgang.hoschek () cern ! ch>
Date:       2001-09-29 20:35:55
[Download RAW message or body]


>I don't understand what your servlet is doing. According to your description
>(at least as I understand it), it does the same as the HelloWorld servlet
>from the examples, which will produce chunked output.
>
>Also, the current standalone HTTP connector won't really prevent you from
>breaking the protocol from a servlet (by setting some special headers).
>
>Remy

Yes, since the servlet in question is closed source I can only guess what 
it is doing.

Current status is that if I switch off chunking in the connector via 
allowChunking="false", and have a preprocess filter that just sets a large 
setBufferSize() I get very good performance with Java and C Clients.

Here are all 4 combinations (TC4 standalone):

(1) With allowChunking="false" AND buffersize > response  --> 25 MB/s (C 
and Java)
(2) With allowChunking="false" AND buffersize < response  --> 2 MB/s (C and 
Java)
(3) With allowChunking="true"  AND buffersize < response  --> 2 MB/s (C) 
and 0.3 MB/s (Java)
(4) With allowChunking="true"  AND buffersize > response  --> 25 MB/s (C) 
and 0.3 MB/s (Java)

Where a response is 10 MB large. The Java client lib is 'HTTPClient', the C 
client is 'wget'.
Discussion:

(1) is fine, probably because TC seems to automatically set the ContentLength.
(2) is not fine, but probably there is nothing that can't be done about it.
(3) is not fine, and I'm wondering why. 'HTTPClient' has a performance 
problem with chunked reads. But also the wget behaves poorly.
(4) Now wget is doing fine and HTTPClient does not improve at all.

The preliminary conclusion is that chunking doesn't work well and that only 
(1) gives decent performance for C and Java, at least for this given 
servlet. But clearly huge buffer sizes are not desirable if there are many 
concurrent clients.

I tried having allowChunking="true" and patching flushBuffer() and/or 
finishResponse() in ReponseBase, HTTPResponseBase and HTTPResponseImpl and 
ended up with some improvement for the given request, although most likely 
not correct in the general case.

I'll see whether I can come up with someting more useful.

BTW, Sorry for not being subscribed. I read this list a lot, but only post 
occasionally, so http://marc.theaimsgroup.com/?l=tomcat-dev is a good way 
for keeping up to date without drowning in local mail.

Wolfgang.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic