Help Center> Face Recognition Service> FAQ> General Consulting> Why Are the Request Responses Too Slow?

Why Are the Request Responses Too Slow?

Symptom

Requests sent by a user must go through TCP handshake and HTTPS certificate exchange. If packet loss occurs during the process, the operating system will retransmit the packet. The retransmission interval may be 3s or 5s depending on the system.

Solution

  1. Use the HTTPS persistent connection for requests, avoiding HTTP connection building for every request. If no data is transmitted to API Gateway for 300s, the connection will be closed. To prevent this situation, a data packet needs to be periodically sent from the client to maintain persistent connection.
  2. Conduct timeout retries at the application layer to collect statistics on the average duration of more than 99% requests. Then set a retry mechanism based on the duration.