All Products
Search
Document Center

ID Verification:Analyze and optimize server-side network latency

Last Updated:Sep 11, 2026

If you experience high network latency when calling the server-side API for ID Verification, follow these instructions to troubleshoot and optimize performance.

Prerequisites

  1. Confirm that the measured latency is only from the API call to ID Verification and does not include other high-latency operations in your application.

  2. Confirm that the high latency is consistently reproducible and not caused by occasional network or server fluctuations.

Analyze network latency

  1. First, identify the service endpoint that you use to call ID Verification:

    • China (Hong Kong): cloudauth-intl.cn-hongkong.aliyuncs.com

    • Singapore: cloudauth-intl.ap-southeast-1.aliyuncs.com

  2. Use the ping command, such as ping cloudauth-intl.cn-hongkong.aliyuncs.com, to check for basic connectivity and estimate your network latency. This helps rule out fundamental network problems.

  3. Use the curl command to perform a full-path latency analysis. The following command measures the time for key stages, including DNS resolution, TCP connection, and SSL handshake for the target service endpoint:

    Note

    For testing, replace the service endpoint with the one you use.

    curl -w "DNS resolution: %{time_namelookup}s TCP connection: %{time_connect}s SSL handshake: %{time_appconnect}s Request prepared: %{time_pretransfer}s Time to first byte: %{time_starttransfer}s Total time: %{time_total}s" -o /dev/null -s "https://cloudauth-intl.cn-hongkong.aliyuncs.com"

Common issues and solutions

Common issue

Cause

Solution

High DNS latency

Although your local DNS resolver caches results, the cache typically expires after a few minutes. If you make calls less frequently than every few minutes, the cache can expire. This forces a new lookup from a remote authoritative server and results in high latency. You might observe this as a high DNS resolution time in the curl command output.

Contact your server administrator to enable a domain name cache persistence mechanism and add the ID Verification domain name to it. For information about a similar mechanism on Alibaba Cloud, see Add a domain name to the keep-alive cache.

Connection reuse is not effective

If you make requests less frequently than once every few seconds, you may notice that the first request in a short burst is slow while subsequent ones are fast. This often indicates failing connection reuse, which forces a new TCP connection and SSL handshake for each request.

Create a scheduled task that runs every 5 seconds to call the KeepAliveIntl API. This logic-free API is designed solely to keep the connection alive.

Other network link issues

If you have ruled out issues with DNS resolution and connection reuse, you must investigate the network link itself.

First, contact your operations team for assistance and provide them with the latency analysis results.

If the issue persists, contact us for support and provide the following information:

  1. Request ID.

  2. The complete output from the curl -w command that you used in the latency analysis.

  3. Client IP and the time range when the issue occurred.

  4. MTR route tracking report (Run the command watch -n 10 "mtr -r -n -T -P 80 ${ip} | tee -a mtr.log" for 10 minutes and provide the mtr.log text file).

    Note

    In the command, ${ip} is the IP address of your ID Verification service endpoint.

    For example, if you use the China (Hong Kong) service endpoint, you can obtain the IP address by running the ping cloudauth-intl.cn-hongkong.aliyuncs.com command.