Troubleshoot and reduce high latency when calling ID Verification server-side APIs.
Prerequisites
-
Confirm that your latency statistics include only ID Verification API calls, excluding other time-consuming logic.
-
Confirm that the high latency issue is consistently reproducible and not caused by occasional network or machine jitter.
Network latency analysis
-
Confirm the service endpoint you use to call ID Verification:
-
China (Hong Kong):
cloudauth-intl.cn-hongkong.aliyuncs.com -
Singapore:
cloudauth-intl.ap-southeast-1.aliyuncs.com
-
-
Run the
pingcommand (for example, ping cloudauth-intl.cn-hongkong.aliyuncs.com) to check basic connectivity and evaluate network link latency. -
Run the
curlcommand for end-to-end latency analysis. The following command breaks down the latency of DNS resolution, TCP connection, SSL handshake, and other stages for the target endpoint:NoteReplace the endpoint in the command with the endpoint you actually 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 has a local cache (LocalDNS), but the cache typically expires within a few minutes. If your call frequency is lower than one request every few minutes, the cache may expire and DNS resolution falls back to the remote authoritative server, increasing latency. The |
Enable domain name cache retention on your server and configure the ID Verification domain names. For reference, see Alibaba Cloud's domain name caching mechanism: Add cache retention domain names. |
|
Connection reuse not effective |
If your request frequency is lower than one request every few seconds, and the first request in a short burst is always slow while subsequent ones are fast, connection reuse may not be working. Each request then establishes a new connection and session. |
Create a scheduled task that calls the KeepAliveIntl empty logic API every 5 seconds to keep the connection alive. |
|
Other network link issues |
If DNS and connection reuse issues are ruled out, further investigation of the network link is needed. |
Review the network latency analysis from step 2 and contact your operations team for further assistance. If the issue persists, gather the following information and contact us for support:
|