All Products
Search
Document Center

Alibaba Cloud Service Mesh:Diagnose high response latency by using access logs

Last Updated:Sep 21, 2026

Sidecar proxies injected into workloads intercept and route traffic based on configured policies. Each proxy adds a small amount of processing time, though this overhead is negligible for concurrent processing when nodes have adequate resources.

When response latency is higher than expected, access log timing fields help you isolate the cause. The process has two steps:

  1. Identify which component in the request path introduces the latency.

  2. Determine whether the root cause is slow network transmission or slow upstream processing.

Prerequisites

Before you begin, make sure that:

  • Access logging is enabled for your ASM instance. For more information, see Enable access log collection.

  • You can retrieve sidecar proxy logs by running kubectl logs <pod-name> -c istio-proxy -n <namespace>.

How access log timing fields work

Each data plane component (sidecar proxy or gateway) records timing fields in its access log entry. These fields measure different segments of the request lifecycle:

                          Request lifecycle at a single data plane component

  Downstream                    Data plane component                    Upstream
  (client)                    (sidecar proxy / gateway)                 (service)
     |                                   |                                  |
     |-------- request_duration -------->|                                  |
     |   (start -> last byte received   |                                  |
     |    from downstream)              |                                  |
     |                                  |-------- request_tx_duration ----->|
     |                                  |   (start -> last byte sent       |
     |                                  |    to upstream)                   |
     |                                  |                                   |
     |                                  |<--- response_duration ------------|
     |                                  |   (start -> first byte received  |
     |                                  |    from upstream)                 |
     |                                  |                                   |
     |<-------- response_tx_duration ---|                                   |
     |   (first byte received from      |                                  |
     |    upstream -> last byte sent    |                                  |
     |    to downstream)               |                                  |
     |                                  |                                   |

     |<===================== duration =================================>|
                        (start -> last byte out)
FieldWhat it measuresFromTo
durationTotal request-response cycleRequest startLast byte sent to downstream
request_durationFull request received from downstreamRequest startLast byte of request received from downstream
request_tx_durationFull request transmitted to upstreamRequest startLast byte of request sent to upstream
response_durationTime to first response byte from upstreamRequest startFirst byte of response received from upstream
response_tx_durationFull response delivered to downstreamFirst byte of response received from upstreamLast byte of response sent to downstream

Sample access log comparison

The following example shows timing fields from the client-side sidecar and the server-side sidecar for the same request. Comparing values across both sides helps you pinpoint where latency occurs.

FieldClient-side sidecarServer-side sidecarInterpretation
duration250 ms30 msThe client-side component accounts for most of the latency.
request_duration5 ms2 msRequest was received quickly on both sides.
request_tx_duration200 ms3 msThe client-side proxy took a long time to forward the request to upstream, suggesting network issues between the two sidecars.
response_duration220 ms25 msDifference is consistent with slow request transmission from the client side.
response_tx_duration30 ms5 msResponse delivery was relatively fast on both sides.

Step 1: Identify the component that introduces latency

Check the duration field in the access log of each component along the request path. This value represents the total time the component spent receiving the request, forwarding it upstream, waiting for the response, and sending the response back downstream.

Compare duration values across components in the request path:

  1. Start at the entry point (gateway or first sidecar proxy) and note its duration.

  2. Check the next upstream component's duration.

    • If the upstream component's duration is within the expected range, the current component is the source of excess latency.

    • If the upstream component's duration is also higher than expected, move one hop further upstream and repeat the comparison.

  3. Continue until you find the component where latency drops to normal levels. The component immediately downstream of it is the one introducing excess latency.

Step 2: Determine the root cause

After you identify the component, examine its access log fields to distinguish between two root causes: slow network transmission and slow upstream processing.

Slow network transmission

Check request_duration and request_tx_duration:

  • High request_duration -- The component took a long time to receive the request from the downstream node, indicating network issues between the downstream node and this component (sidecar proxy or gateway).

  • High request_tx_duration -- The component took a long time to forward the request to the upstream service, indicating network issues between this component and the upstream service.

For HTTP requests with a body, the component reads and forwards the body simultaneously rather than buffering it entirely before forwarding. As a result, a high request_duration often causes a correspondingly high request_tx_duration. If only request_tx_duration is high while request_duration is normal, the request was received quickly but forwarded slowly to the upstream service.

Check request_duration and response_tx_duration together for response-path issues:

  • If both request_duration and response_tx_duration are high, the response was either read slowly from the upstream service or forwarded slowly to the downstream node.

Slow upstream processing

Compare response_duration and request_tx_duration:

The difference between these two values approximates the time the upstream service spent processing the request:

Upstream processing time ≈ response_duration - request_tx_duration

A large difference indicates that the upstream service is slow to process the request or that there is high network latency between the component and the upstream service.

Quick reference: field patterns and likely causes

Field patternLikely causeNext step
High request_durationSlow network between downstream and current componentCheck downstream node network, packet loss, and bandwidth.
High request_tx_duration onlySlow network between current component and upstreamCheck upstream network path and DNS resolution.
High request_duration + high request_tx_durationSlow downstream network (cascading effect from body streaming)Focus on the downstream network path.
High request_duration + high response_tx_durationSlow response read from upstream or slow forwarding to downstreamCheck response path network and upstream service health.
High response_duration - request_tx_durationSlow upstream processing or high upstream network latencyProfile the upstream service and check upstream resource usage.
High response_tx_durationSlow response delivery to downstreamCheck response size and downstream network capacity.