All Products
Search
Document Center

CDN:Origin fetch HTTP request timeout

Last Updated:Aug 31, 2026

Configuring the origin fetch HTTP request timeout lets you control the timeout for requests sent to your origin server. A short timeout may cause frequent origin fetch failures due to network fluctuations. Conversely, a long timeout can cause failed requests to tie up connections when an origin server is overloaded or unresponsive, blocking normal requests. Set an appropriate timeout based on your network conditions and your origin server's processing capacity to ensure stable origin fetches.

Background

The origin fetch HTTP request time is the duration of a Layer 7 HTTP request made by CDN or during an origin fetch. It does not include the time required to establish the Layer 4 TCP connection.回源请求

Notes

In Alibaba Cloud CDN, the maximum timeout for an end-to-end link is 150 seconds. An end-to-end link includes the internal link of a CDN node and the link from the CDN node to the origin server. The default timeout is 30 seconds. We recommend that you set the timeout to 60 seconds or less.

Origin fetch retries, origin fetch timeouts, and origin probing

  • Origin fetch retry order:

    • Origin server addresses are retried in order of priority, from highest to lowest.

    • If multiple origin server addresses have the same priority, the node retries them according to their configured weight.

  • Origin fetch retry granularity:

    • Retries are performed at the IP address level. If an origin server is specified by a domain name, the system retries all IP addresses resolved from the domain name. A node attempts to connect to another available origin server only if connections to all IP addresses for the current origin server fail.

    • During a retry, the system automatically filters out unavailable origin servers listed in the dead table.

  • Status codes for origin fetch retries:

    • A CDN or node triggers an origin fetch retry when it receives a 5xx status code from the origin server.

  • Origin fetch timeout: If the origin server proactively returns a retry status code, the CDN node retries as soon as it receives the status code. If the origin server does not return a retry status code, the CDN node retries after the origin fetch timeout period is reached.

    • TCP connection timeout: 10 seconds.

    • Origin write timeout: 30 seconds by default (timeout for writing content to the origin server after a connection is established).

    • Origin read timeout: 30 seconds by default (the timeout for a CDN or node to receive the complete response from the origin server after a connection is established).

    • You can adjust the origin write timeout and origin read timeout by configuring the origin fetch HTTP request timeout.

  • Origin probing logic:

    • TCP connection failure: If a TCP connection between a CDN or node and an origin server IP address fails twice consecutively (for example, connection establishment fails or the connection times out), the CDN or node removes the IP address from the list of available origin servers and adds it to the dead table. This prevents subsequent requests from being sent to this IP address. The CDN or node then probes the IP address every 5 seconds by attempting to establish a TCP connection. If the probe is successful, the node restores the IP address to the list of available origin servers.

    • Normal TCP connection: If the Layer 4 TCP connection between a CDN or node and an origin server IP address is stable, but the node receives a status code that triggers a retry (such as a 5xx error), the node triggers an origin fetch retry. However, the IP address of the origin server remains in the list of available servers, and subsequent requests may be sent to it based on its weight. By default, Layer 7 HTTP request failures do not block the origin server's IP address. To block an origin server IP address in the case of Layer 7 HTTP request failures, submit a ticket to enable this feature.

Procedure

  1. Log on to the CDN console.

  2. In the left navigation pane, click Domain Names.

  3. On the Domain Names page, find the target domain name and click Manage in the Actions column.

  4. In the domain's navigation pane, click Origin Fetch.

  5. In the Timeout for HTTP Back-to-origin Requests section, click Modify.

  6. In the Timeout for HTTP Back-to-origin Requests dialog box, set the Timeout.

    The default timeout is 30 seconds. We recommend a value of 60 seconds or less. Values greater than 150 seconds do not take effect. After you complete the configuration, click OK.

  7. Click OK to complete the configuration.