You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Nuno Jose Baeta <Nu...@nos.pt> on 2023/05/29 14:41:40 UTC

How to log total server response time

Hello,

We are using ATS v8.1 and would like to understand better how to log the total time spent in a HTTP transaction (including the full body transfer time) towards the client.

For that, we are using the field %<ttms>, for the Client-Proxy Connection time.

Looking at the ATS documentation, the meaning for <ttms> is:
"Time in milliseconds spent by Traffic Server processing the entire client request. Measured from the time the connection between the client and Traffic Server proxy was established until the last byte of the proxy response was delivered to the client."

At this moment, our logging.yaml for the access.log is the following:
    format: '%<cqtd>:%<cqtt> "%<cqtx>" %<shn> %<shi> %<sssc> %<pfsc> %<stms> %<ttms>'

Log example:
    2023-05-29:14:20:41 "GET http://trafficserver/media/stream_421342430.cmfv HTTP/1.1" origin2 0 200 FIN 18 19

But comparing to client  browser network timings, we see times of hundreds of milliseconds. For the above example, the total time was 506ms.
HTTP Timing breakdown:
Connection setup:          1.85
Request sent:                  30.88
Wait response:               49.44
Content Download:       423.36
              TOTAL:               505.53 ms

I cannot find any correlation.
Could you tell if it is possible to achieve this?

Thanks in advance.
Nuno Baeta
nuno.baeta@nos.pt<ma...@nos.pt>



RE: How to log total server response time

Posted by Nuno Jose Baeta <Nu...@nos.pt>.
Hello Community,

We are using ATS v8.1 and would like to understand better how to log the total time spent in a HTTP transaction (including the full body transfer time) towards the client.

For that, we are using the field %<ttms>, for the Client-Proxy Connection time.

Looking at the ATS documentation, the meaning for <ttms> is:
"Time in milliseconds spent by Traffic Server processing the entire client request. Measured from the time the connection between the client and Traffic Server proxy was established until the last byte of the proxy response was delivered to the client."

At this moment, our logging.yaml for the access.log is the following:
    format: '%<cqtd>:%<cqtt> "%<cqtx>" %<shn> %<shi> %<sssc> %<pfsc> %<stms> %<ttms>'

Log example:
    2023-05-29:14:20:41 "GET http://trafficserver/media/stream_421342430.cmfv HTTP/1.1" origin2 0 200 FIN 18 19

But comparing to client  browser network timings, we see times of hundreds of milliseconds. For the above example, the total time was 506ms.
HTTP Timing breakdown:
Connection setup:          1.85
Request sent:                  30.88
Wait response:               49.44
Content Download:       423.36
              TOTAL:               505.53 ms

I cannot find any correlation.
Could you tell if it is possible to achieve this?


Thanks in advance.
Nuno Baeta
nuno.baeta@nos.pt<ma...@nos.pt>



RE: [E] How to log total server response time

Posted by Alan Carroll <am...@network-geographics.com>.
There’s a viewpoint issue with these measurements. ATS will record when the last byte was written to the inbound socket. This will always appear longer from the client point of view because those bytes will take time to move from the kernel socket buffers to the client and this depends strongly on the nature of the network path from ATS to the client. Generally kernel socket buffers are about 1M to 2M, therefore if the content is less than that ATS will write it out effectively instantaneously because it fits in the buffer. However if there’s a slow link between ATS and the client it would easily be a few hundred milliseconds for the data to transit that link.

HTTP Timing breakdown:
Connection setup:          1.85
Request sent:                  30.88
Wait response:               49.44
Content Download:       423.36
              TOTAL:               505.53 ms

I cannot find any correlation.
Could you tell if it is possible to achieve this?

Thanks in advance.
Nuno Baeta
nuno.baeta@nos.pt<ma...@nos.pt>



Re: [E] How to log total server response time

Posted by Walt Karas via users <us...@trafficserver.apache.org>.
Are you able to ping from the browser host to the host running ATS?  What
typical round-trip time does it give?

On Thu, Jun 1, 2023 at 12:28 PM Nuno Jose Baeta <Nu...@nos.pt> wrote:

> Hello Karas,
>
>
>
> Thank you for your reply.
>
> I did not mention, but that was exactly my last test to understand those
> <ttms> times being loged.
>
> Not surprising, the obtained values from
> <{TS_MILESTONE_UA_CLOSE-TS_MILESTONE_UA_BEGIN}msdms>  are exactly the same
> as <ttms>.
>
>
>
> And so, I’m still puzzled… if no one noted that issue already… For sure
> its me doing something wrong…
>
>
>
> PS: I didn’t found any issue on github about it.
>
>
>
> Thanks again
>
> Nuno Baeta
>
>
>
> *From:* Walt Karas <wk...@yahooinc.com>
> *Sent:* 1 de junho de 2023 16:06
> *To:* Nuno Jose Baeta <Nu...@nos.pt>
> *Subject:* Fwd: [E] How to log total server response time
>
>
>
>
> *CAUTION:* This email was originated from outside NOS organization. Do
> not click links or open attachments unless you recognize the sender and
> know the content is safe.
>
>
>
>
>
> ---------- Forwarded message ---------
> From: *Walt Karas* <wk...@yahooinc.com>
> Date: Mon, May 29, 2023 at 11:45 AM
> Subject: Re: [E] How to log total server response time
> To: <us...@trafficserver.apache.org>
>
>
>
> Maybe you want:  %<{TS_MILESTONE_UA_CLOSE-TS_MILESTONE_UA_BEGIN}msdms>
>
>
>
> See the note under:
> https://docs.trafficserver.apache.org/admin-guide/logging/formatting.en.html#timestamps-and-durations
> <https://urldefense.com/v3/__https://docs.trafficserver.apache.org/admin-guide/logging/formatting.en.html*timestamps-and-durations__;Iw!!Op6eflyXZCqGR5I!H_WqdLg7clg1A3VfOtiqYthlulWlz7d_eOEBL0nXHcq_kmZFhq_l7BHgoWDeRpeLQoVnGrOvSFdKXHyh1z8$>
>
>
>
> On Mon, May 29, 2023 at 9:42 AM Nuno Jose Baeta <Nu...@nos.pt> wrote:
>
> Hello,
>
>
>
> We are using ATS v8.1 and would like to understand better how to log the
> total time spent in a HTTP transaction (including the full body transfer
> time) towards the client.
>
>
>
> For that, we are using the field %<ttms>, for the Client-Proxy Connection
> time.
>
>
>
> Looking at the ATS documentation, the meaning for <ttms> is:
>
> “Time in milliseconds spent by Traffic Server processing the entire client
> request. Measured from the time the connection between the client and
> Traffic Server proxy was established until the last byte of the proxy
> response was delivered to the client.”
>
>
>
> At this moment, our logging.yaml for the access.log is the following:
>
>     format: '%<cqtd>:%<cqtt> "%<cqtx>" %<shn> %<shi> %<sssc> %<pfsc>
> %<stms> %<ttms>'
>
>
>
> Log example:
>
>     2023-05-29:14:20:41 "GET
> http://trafficserver/media/stream_421342430.cmfv
> <https://urldefense.com/v3/__http:/trafficserver/media/stream_421342430.cmfv__;!!Op6eflyXZCqGR5I!GUMlpWKUbqXtSyyjQipM66jFsagWIGIiNLPqEquheCvVkbeYPqhdYlYml2Y0VHOwEmdAtq6iMYvYzEeyIHk$>
> HTTP/1.1" origin2 0 200 FIN 18 19
>
>
>
> But comparing to client  browser network timings, we see times of hundreds
> of milliseconds. For the above example, the total time was 506ms.
>
> HTTP Timing breakdown:
>
> Connection setup:          1.85
>
> Request sent:                  30.88
>
> Wait response:               49.44
>
> Content Download:       423.36
>
>               *TOTAL:               505.53 ms*
>
>
>
> I cannot find any correlation.
>
> Could you tell if it is possible to achieve this?
>
>
>
> Thanks in advance.
>
> Nuno Baeta
>
> nuno.baeta@nos.pt
>
>
>
>
>
>

Re: [E] How to log total server response time

Posted by Walt Karas <wk...@yahooinc.com.INVALID>.
Are you able to ping from the browser host to the host running ATS?  What
typical round-trip time does it give?

On Thu, Jun 1, 2023 at 12:28 PM Nuno Jose Baeta <Nu...@nos.pt> wrote:

> Hello Karas,
>
>
>
> Thank you for your reply.
>
> I did not mention, but that was exactly my last test to understand those
> <ttms> times being loged.
>
> Not surprising, the obtained values from
> <{TS_MILESTONE_UA_CLOSE-TS_MILESTONE_UA_BEGIN}msdms>  are exactly the same
> as <ttms>.
>
>
>
> And so, I’m still puzzled… if no one noted that issue already… For sure
> its me doing something wrong…
>
>
>
> PS: I didn’t found any issue on github about it.
>
>
>
> Thanks again
>
> Nuno Baeta
>
>
>
> *From:* Walt Karas <wk...@yahooinc.com>
> *Sent:* 1 de junho de 2023 16:06
> *To:* Nuno Jose Baeta <Nu...@nos.pt>
> *Subject:* Fwd: [E] How to log total server response time
>
>
>
>
> *CAUTION:* This email was originated from outside NOS organization. Do
> not click links or open attachments unless you recognize the sender and
> know the content is safe.
>
>
>
>
>
> ---------- Forwarded message ---------
> From: *Walt Karas* <wk...@yahooinc.com>
> Date: Mon, May 29, 2023 at 11:45 AM
> Subject: Re: [E] How to log total server response time
> To: <us...@trafficserver.apache.org>
>
>
>
> Maybe you want:  %<{TS_MILESTONE_UA_CLOSE-TS_MILESTONE_UA_BEGIN}msdms>
>
>
>
> See the note under:
> https://docs.trafficserver.apache.org/admin-guide/logging/formatting.en.html#timestamps-and-durations
> <https://urldefense.com/v3/__https://docs.trafficserver.apache.org/admin-guide/logging/formatting.en.html*timestamps-and-durations__;Iw!!Op6eflyXZCqGR5I!H_WqdLg7clg1A3VfOtiqYthlulWlz7d_eOEBL0nXHcq_kmZFhq_l7BHgoWDeRpeLQoVnGrOvSFdKXHyh1z8$>
>
>
>
> On Mon, May 29, 2023 at 9:42 AM Nuno Jose Baeta <Nu...@nos.pt> wrote:
>
> Hello,
>
>
>
> We are using ATS v8.1 and would like to understand better how to log the
> total time spent in a HTTP transaction (including the full body transfer
> time) towards the client.
>
>
>
> For that, we are using the field %<ttms>, for the Client-Proxy Connection
> time.
>
>
>
> Looking at the ATS documentation, the meaning for <ttms> is:
>
> “Time in milliseconds spent by Traffic Server processing the entire client
> request. Measured from the time the connection between the client and
> Traffic Server proxy was established until the last byte of the proxy
> response was delivered to the client.”
>
>
>
> At this moment, our logging.yaml for the access.log is the following:
>
>     format: '%<cqtd>:%<cqtt> "%<cqtx>" %<shn> %<shi> %<sssc> %<pfsc>
> %<stms> %<ttms>'
>
>
>
> Log example:
>
>     2023-05-29:14:20:41 "GET
> http://trafficserver/media/stream_421342430.cmfv
> <https://urldefense.com/v3/__http:/trafficserver/media/stream_421342430.cmfv__;!!Op6eflyXZCqGR5I!GUMlpWKUbqXtSyyjQipM66jFsagWIGIiNLPqEquheCvVkbeYPqhdYlYml2Y0VHOwEmdAtq6iMYvYzEeyIHk$>
> HTTP/1.1" origin2 0 200 FIN 18 19
>
>
>
> But comparing to client  browser network timings, we see times of hundreds
> of milliseconds. For the above example, the total time was 506ms.
>
> HTTP Timing breakdown:
>
> Connection setup:          1.85
>
> Request sent:                  30.88
>
> Wait response:               49.44
>
> Content Download:       423.36
>
>               *TOTAL:               505.53 ms*
>
>
>
> I cannot find any correlation.
>
> Could you tell if it is possible to achieve this?
>
>
>
> Thanks in advance.
>
> Nuno Baeta
>
> nuno.baeta@nos.pt
>
>
>
>
>
>

RE: [E] How to log total server response time

Posted by Alan Carroll <am...@network-geographics.com>.
There’s a viewpoint issue with these measurements. ATS will record when the last byte was written to the inbound socket. This will always appear longer from the client point of view because those bytes will take time to move from the kernel socket buffers to the client and this depends strongly on the nature of the network path from ATS to the client. Generally kernel socket buffers are about 1M to 2M, therefore if the content is less than that ATS will write it out effectively instantaneously because it fits in the buffer. However if there’s a slow link between ATS and the client it would easily be a few hundred milliseconds for the data to transit that link.

HTTP Timing breakdown:
Connection setup:          1.85
Request sent:                  30.88
Wait response:               49.44
Content Download:       423.36
              TOTAL:               505.53 ms

I cannot find any correlation.
Could you tell if it is possible to achieve this?

Thanks in advance.
Nuno Baeta
nuno.baeta@nos.pt<ma...@nos.pt>



RE: [E] How to log total server response time

Posted by Nuno Jose Baeta <Nu...@nos.pt>.
Hello Karas,

Thank you for your reply.
I did not mention, but that was exactly my last test to understand those <ttms> times being loged.
Not surprising, the obtained values from <{TS_MILESTONE_UA_CLOSE-TS_MILESTONE_UA_BEGIN}msdms>  are exactly the same as <ttms>.

And so, I’m still puzzled… if no one noted that issue already… For sure its me doing something wrong…

PS: I didn’t found any issue on github about it.

Thanks again
Nuno Baeta

From: Walt Karas <wk...@yahooinc.com>
Sent: 1 de junho de 2023 16:06
To: Nuno Jose Baeta <Nu...@nos.pt>
Subject: Fwd: [E] How to log total server response time


CAUTION: This email was originated from outside NOS organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


---------- Forwarded message ---------
From: Walt Karas <wk...@yahooinc.com>>
Date: Mon, May 29, 2023 at 11:45 AM
Subject: Re: [E] How to log total server response time
To: <us...@trafficserver.apache.org>>

Maybe you want:  %<{TS_MILESTONE_UA_CLOSE-TS_MILESTONE_UA_BEGIN}msdms>

See the note under:  https://docs.trafficserver.apache.org/admin-guide/logging/formatting.en.html#timestamps-and-durations

On Mon, May 29, 2023 at 9:42 AM Nuno Jose Baeta <Nu...@nos.pt>> wrote:
Hello,

We are using ATS v8.1 and would like to understand better how to log the total time spent in a HTTP transaction (including the full body transfer time) towards the client.

For that, we are using the field %<ttms>, for the Client-Proxy Connection time.

Looking at the ATS documentation, the meaning for <ttms> is:
“Time in milliseconds spent by Traffic Server processing the entire client request. Measured from the time the connection between the client and Traffic Server proxy was established until the last byte of the proxy response was delivered to the client.”

At this moment, our logging.yaml for the access.log is the following:
    format: '%<cqtd>:%<cqtt> "%<cqtx>" %<shn> %<shi> %<sssc> %<pfsc> %<stms> %<ttms>'

Log example:
    2023-05-29:14:20:41 "GET http://trafficserver/media/stream_421342430.cmfv<https://urldefense.com/v3/__http:/trafficserver/media/stream_421342430.cmfv__;!!Op6eflyXZCqGR5I!GUMlpWKUbqXtSyyjQipM66jFsagWIGIiNLPqEquheCvVkbeYPqhdYlYml2Y0VHOwEmdAtq6iMYvYzEeyIHk$> HTTP/1.1" origin2 0 200 FIN 18 19

But comparing to client  browser network timings, we see times of hundreds of milliseconds. For the above example, the total time was 506ms.
HTTP Timing breakdown:
Connection setup:          1.85
Request sent:                  30.88
Wait response:               49.44
Content Download:       423.36
              TOTAL:               505.53 ms

I cannot find any correlation.
Could you tell if it is possible to achieve this?

Thanks in advance.
Nuno Baeta
nuno.baeta@nos.pt<ma...@nos.pt>



Re: [E] How to log total server response time

Posted by Walt Karas via users <us...@trafficserver.apache.org>.
Maybe you want:  %<{TS_MILESTONE_UA_CLOSE-TS_MILESTONE_UA_BEGIN}msdms>

See the note under:
https://docs.trafficserver.apache.org/admin-guide/logging/formatting.en.html#timestamps-and-durations

On Mon, May 29, 2023 at 9:42 AM Nuno Jose Baeta <Nu...@nos.pt> wrote:

> Hello,
>
>
>
> We are using ATS v8.1 and would like to understand better how to log the
> total time spent in a HTTP transaction (including the full body transfer
> time) towards the client.
>
>
>
> For that, we are using the field %<ttms>, for the Client-Proxy Connection
> time.
>
>
>
> Looking at the ATS documentation, the meaning for <ttms> is:
>
> “Time in milliseconds spent by Traffic Server processing the entire client
> request. Measured from the time the connection between the client and
> Traffic Server proxy was established until the last byte of the proxy
> response was delivered to the client.”
>
>
>
> At this moment, our logging.yaml for the access.log is the following:
>
>     format: '%<cqtd>:%<cqtt> "%<cqtx>" %<shn> %<shi> %<sssc> %<pfsc>
> %<stms> %<ttms>'
>
>
>
> Log example:
>
>     2023-05-29:14:20:41 "GET
> http://trafficserver/media/stream_421342430.cmfv
> <https://urldefense.com/v3/__http://trafficserver/media/stream_421342430.cmfv__;!!Op6eflyXZCqGR5I!GUMlpWKUbqXtSyyjQipM66jFsagWIGIiNLPqEquheCvVkbeYPqhdYlYml2Y0VHOwEmdAtq6iMYvYzEeyIHk$>
> HTTP/1.1" origin2 0 200 FIN 18 19
>
>
>
> But comparing to client  browser network timings, we see times of hundreds
> of milliseconds. For the above example, the total time was 506ms.
>
> HTTP Timing breakdown:
>
> Connection setup:          1.85
>
> Request sent:                  30.88
>
> Wait response:               49.44
>
> Content Download:       423.36
>
>               *TOTAL:               505.53 ms*
>
>
>
> I cannot find any correlation.
>
> Could you tell if it is possible to achieve this?
>
>
>
> Thanks in advance.
>
> Nuno Baeta
>
> nuno.baeta@nos.pt
>
>
>
>
>

Re: How to log total server response time

Posted by Bryan Call <bc...@apache.org>.
ttms is the amount of time for ATS to process the request (from the first byte read from the kernel to the last byte written to the kernel).  That is all a process in user space can know about.  If you have a large transfer the server can buffer bytes in the kernel (TCP buffers) and ATS won’t know about when these bytes get send out to the network.

From the client perspective the request could take longer since there is network time (round trip time) and kernel time on the server to send the packets to the client (as mentioned above).

-Bryan

> On May 29, 2023, at 7:41 AM, Nuno Jose Baeta <Nu...@nos.pt> wrote:
> 
> Hello,
>  
> We are using ATS v8.1 and would like to understand better how to log the total time spent in a HTTP transaction (including the full body transfer time) towards the client.
>  
> For that, we are using the field %<ttms>, for the Client-Proxy Connection time.
>  
> Looking at the ATS documentation, the meaning for <ttms> is:
> “Time in milliseconds spent by Traffic Server processing the entire client request. Measured from the time the connection between the client and Traffic Server proxy was established until the last byte of the proxy response was delivered to the client.”
>  
> At this moment, our logging.yaml for the access.log is the following:
>     format: '%<cqtd>:%<cqtt> "%<cqtx>" %<shn> %<shi> %<sssc> %<pfsc> %<stms> %<ttms>'
>  
> Log example:
>     2023-05-29:14:20:41 "GET http://trafficserver/media/stream_421342430.cmfv HTTP/1.1" origin2 0 200 FIN 18 19
>  
> But comparing to client  browser network timings, we see times of hundreds of milliseconds. For the above example, the total time was 506ms.
> HTTP Timing breakdown:
> Connection setup:          1.85
> Request sent:                  30.88
> Wait response:               49.44
> Content Download:       423.36
>               TOTAL:               505.53 ms
>  
> I cannot find any correlation.
> Could you tell if it is possible to achieve this?
>  
> Thanks in advance.
> Nuno Baeta
> nuno.baeta@nos.pt <ma...@nos.pt>