If you experience high latency when calling ID Verification server-side APIs, you can use the following methods for troubleshooting and optimization.
Prerequisites
Confirm that your latency statistics only include the ID Verification API calls, not other time-consuming logic.
Confirm that the high latency issue can be consistently reproduced, ruling out occasional network or machine jitter.
Network latency analysis
First, confirm the service registration address you use to call ID Verification:
China (Hong Kong):
cloudauth-intl.cn-hongkong.aliyuncs.comSingapore:
cloudauth-intl.ap-southeast-1.aliyuncs.com
Use the
pingcommand, 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.Use the
curlcommand 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:NoteWhen 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:
|