All Products
Search
Document Center

ID Verification:Server-side network latency analysis and optimization

Last Updated:Jul 17, 2025

If you experience high latency when calling ID Verification server-side APIs, you can use the following methods for troubleshooting and optimization.

Prerequisites

  1. Confirm that your latency statistics only include the ID Verification API calls, not other time-consuming logic.

  2. Confirm that the high latency issue can be consistently reproduced, ruling out occasional network or machine jitter.

Network latency analysis

  1. First, confirm the service registration address 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 basic connectivity and initially evaluate network link latency to rule out basic network issues.

  3. Use the curl command for full-link latency analysis. The following command can analyze the latency of DNS parsing, TCP connection, SSL handshake, and other link nodes to the target service registration address:

    Note

    When testing, replace the service registration address with the actual service registration address you use.

    curl -w "DNS parsing: %{time_namelookup}s TCP connection: %{time_connect}s SSL handshake: %{time_appconnect}s Request preparation: %{time_pretransfer}s First response packet: %{time_starttransfer}s Total time: %{time_total}s" -o /dev/null -s "https://cloudauth-intl.cn-hongkong.aliyuncs.com"

FAQ and optimization solutions

Common issue

Cause

Optimization solution

High DNS latency

DNS itself has LocalDNS caching, but the cache time is usually only a few minutes. If your call volume is less than one transaction every few minutes, the LocalDNS cache might expire, causing resolution to go to the remote authoritative server, resulting in high latency. Using the curl command above, you might see high DNS parsing latency.

Contact your server administrator to enable domain name cache retention mechanism and configure ID Verification domain names, similar to Alibaba Cloud's domain name caching mechanism: Add cache retention domain names.

Connection reuse not effective

If your request frequency is less than one transaction every few seconds, and in consecutive requests within a short time, the first request is always slow while subsequent requests are fast, connection reuse might not be effective, causing new connections and sessions to be created for each request.

You can create a 5-second scheduled task to call the KeepAliveIntl empty logic API to maintain the connection.

Other network link issues

After ruling out DNS and connection/session reuse issues above, further confirmation of network link issues is needed.

Based on the network latency analysis in step 2, contact your operations team for assistance with analysis.

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

  1. Request ID.

  2. Complete curl -w output from the network latency analysis.

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

  4. MTR route tracing report (specific command: watch -n 10 "mtr -r -n -T -P 80 ${ip} | tee -a mtr.log", run for 10 minutes, provide the mtr.log text).

    Note

    The IP used in the command is the actual IP of the ID Verification registration address.

    If you use the China (Hong Kong) registration address, you can use the command ping cloudauth-intl.cn-hongkong.aliyuncs.com to obtain it.