All Products
Search
Document Center

CDN:Configure origin fetch HTTP request timeout

Last Updated:Jun 29, 2026

The origin fetch HTTP request timeout determines how long the system waits for a response from your origin server. A timeout that is too short can cause frequent origin fetch failures during network fluctuations, while an excessively long timeout allows failed requests to hold connections when the origin server is overloaded, blocking new requests. Set a value that balances your network conditions with the processing capacity of your origin server.

Background information

The origin fetch HTTP request time is the duration of a Layer 7 HTTP request from a node to the origin server. It does not include the Layer 4 TCP connection time.回源请求

Usage notes

For Alibaba Cloud CDN, the maximum end-to-end timeout for the entire link (including the link within nodes and the link between nodes and the origin server) cannot exceed 150 seconds. The default value is 30 seconds. We recommend that you set the timeout to 60 secondsless.

Origin fetch retry, origin fetch timeout, and origin probing

  • Origin fetch retry order:

    • Retries are attempted on origin servers in order of their priority, from highest to lowest.

    • If multiple origin servers share the same priority, retries are distributed according to their configured weights.

  • Origin fetch retry granularity:

    • Retries are performed at the IP address level. If an origin server is specified by a domain name, the system attempts to connect to all IP addresses resolved from that domain name. Another available origin server is tried only after connections to all IP addresses for the current origin server have failed.

    • During a retry attempt, the system automatically skips any origin server IP addresses listed in the dead table.

  • Origin fetch retry status codes:

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

  • Origin fetch timeout: If the origin server responds with a retry-triggering status code, the node retries immediately. Otherwise, the node waits until the timeout period expires before retrying.

    • Origin server TCP connection timeout: 10 seconds.

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

    • Origin read timeout: The default is 30 seconds. If the origin server does not send a complete response within this period after the connection is established, the request times out.

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

  • Origin probing logic:

    • TCP connection failures: If a node fails to establish a TCP connection with an origin server IP address twice consecutively, moves the IP address to a dead table and stops sending requests to it. The node probes the IP address every 5 seconds by attempting a TCP connection. If the connection succeeds, the IP address is restored to the available origin server list.

    • TCP connection is normal: If a node has a normal TCP connection to an origin server IP address but receives a 5xx status code, the retry logic is triggered. However, the IP address stays in the available origin server list and continues to receive requests based on its weight. A Layer 7 HTTP error does not block the origin server IP address when the Layer 4 TCP connection is healthy. To block the IP address on Layer 7 errors, submit a ticket to request this configuration.

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 secondsless. Values greater than 150 seconds do not take effect. After you finish the configuration, click OK.

  7. Click OK to complete the configuration.