If you experience high network latency when calling the server-side API for ID Verification, follow these instructions to troubleshoot and optimize performance.
Prerequisites
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.
Confirm that the high latency is consistently reproducible and not caused by occasional network or server fluctuations.
Analyze network latency
First, identify the service endpoint that 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 asping cloudauth-intl.cn-hongkong.aliyuncs.com, to check for basic connectivity and estimate your network latency. This helps rule out fundamental network problems.Use the
curlcommand 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:NoteFor 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 | 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:
|