On 08/09/2020 21:19, Eric Robinson wrote:
> Hi Mark and Christopher,
>
> For clarification, suppose a client sends and HTTP POST request which
is bigger than the PMTU and has to be broken into multiple packets. It
sounds like you're saying that the request is buffered by the network
stack, and the stack does not send it up to tomcat until the full
request is received. That would make sense if every HTTP request is
encapsulated in its own separate TCP connection. Most of the time, that
is not the case. A single connection is held open and used for multiple
HTTP requests. The network stack has no understanding of anything above
TCP, so it does not know when an HTTP request complete. It must
therefore deliver whatever it has, and it would be up to tomcat to
decide when the HTTP request is complete, wouldn't it?
>
> If that is the case, tomcat could receive a partial HTTP request and
would have to wait for the rest before processing it. So when does
tomcat start its processing timer?

Tomcat starts the processing timer as soon as Tomcat processes the first
bytes of the request. In practice, this means the network stack has to
deliver the data to Tomcat, the Poller fires a read event, a thread is
allocated to process that read event, any TLS handshake has completed
and Tomcat has read the first real byte of the request.

If the request is split across multiple packets the timer starts when
Tomcat reads the first byte of the request from the first packet.

Tomcat stops the timer on a request after the last byte of the response
has been accepted by the network stack.

HTH,

Mark

>
>
>> -----Original Message-----
>> From: Christopher Schultz <ch...@christopherschultz.net>
>> Sent: Tuesday, September 8, 2020 1:19 PM
>> To: users@tomcat.apache.org
>> Subject: Re: Tomcat Processing Timer Question
>>
> Eric,
> 
> On 9/8/20 13:46, Eric Robinson wrote:
>>>> It is my understanding that the AccessLogValve %D field records the
>>>> time from when the last byte of the client's request is received to
>>>> when the last byte of the server's response is placed on the wire. Is
>>>> that correct? If so, would TCP retransmissions impact the timer?
> 
> I'm not positive, but I believe Tomcat has zero visibility into that level of
> detail.
> 
>>>> If there are connectivity issues between the client and server,
>>>> resulting in TCP retransmits, could that appear as higher response
>>>> times in the localhost_access logs?
> 
> This would only happen if the re-transmissions were to cause network
> buffering in the OS such that the stream writes (at the Java level) were to
> block (and therefore "take time" instead of being essentially instantaneous).
> 
> -chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>
> Disclaimer : This email and any files transmitted with it are
confidential and intended solely for intended recipients. If you are not
the named addressee you should not disseminate, distribute, copy or
alter this email. Any views or opinions presented in this email are
solely those of the author and might not represent those of Physician
Select Management. Warning: Although Physician Select Management has
taken reasonable precautions to ensure no viruses are present in this
email, the company cannot accept responsibility for any loss or damage
arising from the use of this email or attachments.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


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

Reply via email to