"Mark Thomas" <ma...@apache.org> wrote in message 
news:4a31874f.8040...@apache.org...
> Brian Harper wrote:
>> Questions:
>> 1. When is my servlet instantiated by Tomcat and its doPost method
>> called?
> Once the headers have been received and Tomcat can map the request.
>

But it is instantiated only for the first request, unless it specifies 
load-on-startup, then it is instantiated when the webapp is loaded.

>> Does this happen before the entire body of the request has been
>> received?
> Yes.
>
>> In which case perhaps the delays are simply due to slow client
>> connections?
> Maybe.
>
>> 2. What is Tomcat doing when the first call to getParameter is made?
>> What kind of parsing does it have to do to respond?
> It has to read all of the POST body and parse it.
>
>> 3. Any ideas why we'd see such long response times on occasion, but not
>> consistently?
> Slow clients is one option. Clients that specify an invalid content
> length could be another. Tomcat might be hanging around waiting for the
> extra data that never arrives. Eventually a time-out kicks in. I'd need
> to check the source to see exactly how this is handled. I can't remember
> if Tomcat abandons the request, ignores the missing data or does
> something else.
>

Using AJP, the handling of the content-length is done by httpd.  Unless it 
is so slow that the connectionTimeout kicks in, Tomcat won't timeout on 
reading the body (but httpd probably will).  But, this isn't a 
content-length issue (I looked at the code), since what would happen then is 
that no POST parameters would be available.  Also, the AJP/1.3 protocol 
tells mod_jk/mod_proxy_ajp to send the (by default) first 8Kb of the body to 
Tomcat without Tomcat asking.  So, unless the body is really big, the gap is 
probably between the client and httpd.

But to do more than guess, the OP would need to follow Rainer's suggestion, 
and provide DEBUG level logs.
> Mark 




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

Reply via email to