tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Luehe <Jan.Lu...@Sun.COM>
Subject Re: [5.0] [PROPOSAL] Make output buffer size limit configurable
Date Fri, 11 Jul 2003 17:11:09 GMT
Remy,

> Jan Luehe wrote:
> 
>> Currently, the limit up to which the size of an
>> org.apache.coyote.tomcat5.OutputBuffer may grow is identical to the
>> original buffer size:
>>
>>     public OutputBuffer(int size) {
>>
>>         bb = new ByteChunk(size);
>>         bb.setLimit(size);
>>         ...
>>         cb = new CharChunk(size);
>>         cb.setLimit(size);
>>     }
>>
>> As a result of this, if the response does not fit in the output
>> buffer, the buffer is flushed, and the response does no longer include
>> a "Content-Length" header. Instead, it includes a "Transfer-Encoding"
>> header whose value is "chunked":
>>
>>   Transfer-Encoding: chunked
>>
>> It may be useful (e.g., for some benchmarks such as TPC-W) to be able
>> to configure a connector such that the buffer size of its responses
>> grows infinitely, in which case the above "setLimit" calls would not
>> occur and the response would always include a "Content-Length" header,
>> no matter how big.
>>
>> I am proposing a CoyoteConnector attribute "outLimited" (I am open to 
>> other naming suggestions), whose possible values may be "TRUE" 
>> (default) or "FALSE": if "TRUE", the output buffer size limit is set 
>> to the output buffer size (current behaviour), and if "FALSE", an 
>> output buffer may grow infinitely.
>>
>> Comments?
> 
> 
> -1. The performance impact of chunking on the server side is zero. If 
> you client bench program is dumb and its performance degrades with 
> chunking, fine, but please keep this "optimization" for SunOne ;-) Your 
> change basically does an automatic DoS condition on the server (simply 
> request a big file and boom).

How about making the output buffer size limit configurable?
(A value of "-1" could mean indefinite growth, if people know what they 
are doing.)


Jan




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message