You can configure a timeout period for back-to-origin requests. If the timeout period for back-to-origin requests is too short, back-to-origin requests may frequently fail due to network fluctuations. If the timeout period for back-to-origin requests is too long, the failed requests still occupy connections for a long time when the processing capacity of the origin server reaches the upper limit. As a result, normal requests cannot be responded. We recommend that you configure the timeout period for back-to-origin requests based on the network status and the data processing capabilities of the origin server to ensure that requests can be redirected to the origin server.

Precautions

The maximum timeout period that you can configure cannot exceed 300 seconds.

Procedure

  1. Log on to the DCDN console.
  2. In the left-side navigation pane, click Domain Names.
  3. On the Domain Names page, find the domain name that you want to manage, and click Configure in the Actions column.
  4. In the left-side navigation pane of the domain name, click Origin Fetch.
  5. On the Origin Fetch tab, find Timeout for HTTP Back-to-origin Requests and click Modify.
  6. In the Timeout for HTTP Back-to-origin Requests dialog box, configure Timeout Value.
    Origin request timeout
  7. Click OK.

Back-to-origin retry, back-to-origin timeout, and origin probing

  • The order of back-to-origin retries:
    • The retry order is based on the priority of origin addresses in the basic information of the domain name in descending order.
    • If two addresses have the same priority, the retry order is based on the weight ratio.
  • The granularity of back-to-origin retries:
    • Retried requests are sent to IP addresses. If the address of an origin server is a domain name, DCDN retries all IP addresses resolved from the domain name and accesses other available origin servers only if all the IP addresses that belong to the domain name are unavailable.
    • DCDN automatically skips origin servers that are in the dead table.
  • Status codes of back-to-origin retries:
    • A DCDN point of presence (POP) retries when it receives an HTTP 5xx status code from the origin server.
  • Back-to-origin timeout: The POP retries after it receives a retry status code from the origin server. If no retry status code is received from the origin server, the timeout processing logic is followed. After the timeout period is reached, the POP is triggered to retry.
    • Timeout for establishing a TCP connection with the origin server: 10 seconds. To configure the timeout period, submit a ticket .
    • Write timeout for the origin server: the period for data write after the connection with the origin server is established. The default value is 30 seconds.
    • Read timeout for the origin server: the period for the origin server to return the content requested by the POP after the connection with the origin server is established. The default value is 30 seconds.
    • The write timeout and read timeout for the origin server can be adjusted by configuring the timeout period for back-to-origin requests.
  • Origin probing logic:
    • If the TCP connection between a POP and the IP address of the origin server fails or times out twice in a row, DCDN removes the IP address from the list of available IP addresses of the origin server and adds the IP address to the dead table. Subsequent back-to-origin requests are not sent to the IP address. After that, the POP detects the IP address over a TCP connection every 5 seconds. If the connection is successfully established, the IP address is restored to the list of available IP addresses.
    • If the TCP connection between the POP and the IP address of the origin server is normal, but a retry status code such as 5xx is received from the origin server, the retry logic is triggered, but the IP address is still in the list of available IP addresses. Subsequent requests will still be sent to the IP address of the origin server based on the weight. If the TCP (layer 4) connection is normal, the IP address of the origin server is not blocked when an HTTP (layer 7) request fails. To block the IP address when an HTTP request fails, submit a ticket.