tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Todd <andrew.todd...@gmail.com>
Subject Re: maxHTTPHeaderSize, and specific header lengths
Date Mon, 01 Oct 2012 14:33:31 GMT
On Sun, Sep 30, 2012 at 6:21 AM, Konstantin Kolinko
<knst.kolinko@gmail.com> wrote:
> In Tomcat each request processor has a byte buffer and all the headers
> must fit into that buffer.

Thanks so much for the detailed response. I have a couple more questions:

1) When a request is rejected for being too large, is there any
logging that happens or can happen in Tomcat?

2) Apache httpd will accept a request-line of 8190 bytes.
Additionally, each header line can have a maximum length of 8190
bytes. With the default maximum of 100 request fields, this means that
httpd will accept a header of up to (101 * 8190) = 827,190 bytes in
size.

Let's say I'm fronting Tomcat with Apache, and I set maxHttpHeaderSize
to 827,190 bytes so that they have the same limit.

Is a byte array of that size going to be allocated for each incoming
request, regardless of how short or long it actually is?

And, in a worst-case scenario, if all of Tomcat's default 200 threads
receive headers of 827,190 bytes at the same time, I'm looking at
about 166 megabytes of memory allocated on the heap. Is that accurate?
(I think I have enough memory to handle this; GC might be a little
much, though).

For the record, I'm not seriously expecting headers of this size on a
regular basis, but wondering about the edge cases.

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


Mime
View raw message