All Products
Search
Document Center

ApsaraVideo VOD:Configure a timeout for origin HTTP requests

Last Updated:Jan 27, 2026

Configure a timeout to control the duration of origin HTTP requests.

Background information

The duration of an origin HTTP request is the time required for a Layer 7 HTTP request. This does not include the time required to establish a Layer 4 TCP connection.回源请求

If the timeout is too short, origin requests may fail frequently because of network fluctuations. If the timeout is too long and the origin server's processing capacity is at its limit, failed requests can occupy connections for extended periods. This prevents normal requests from being processed. To ensure successful origin fetch, configure a reasonable timeout based on your network conditions and your origin server's data processing capacity.

Usage notes

For ApsaraVideo VOD that uses CDN, the maximum timeout for the entire link cannot exceed 36 seconds. This includes the internal links within points of presence (POPs) and the links between POPs and the origin server.

Origin fetch retry, timeout, and probing

  • Retry order:

    • The retry is performed based on the priority of origin addresses in descending order. You can view the origin addresses in the Alibaba Cloud CDN console.

    • If two addresses have the same priority, the retry order is based on the weight ratio.

  • Retry granularity:

    • Retries are performed for each IP address. If a domain name is specified as an origin address, CDN 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.

    • Probes automatically skip origin servers that are in the dead table.

  • Retry status code:

    • A CDN POP sends a retry request when it receives an HTTP 5xx status code from the origin server.

  • Origin fetch timeout: A CDN POP retries a request immediately after it receives a retry status code from the origin server. If no retry status code is received, the POP retries the request after the configured timeout period elapses.

    • Origin server TCP connection timeout: 10 seconds. To change this value, you can submit a ticket. For more information about how to submit a ticket, see Contact us.

    • The origin write timeout is the amount of time allocated for data write after the TCP connection is established. By default, the origin write timeout is 30 seconds.

    • The origin read timeout is the amount of time that is required by the origin server to return all content requested by a CDN POP after the TCP connection is established. By default, the origin read timeout is 30 seconds.

    • You can adjust the values of the origin read timeout and origin write timeout by configuring a timeout period for HTTP origin requests.

  • Origin probing logic:

    • Abnormal TCP connection: If the TCP connection between a CDN POP and an origin server fails or times out two times in a row, CDN removes the IP address of the origin server from the list of available origin IP addresses and adds the IP address to the dead table. In this case, subsequent origin requests are no longer sent to the IP address. Then the CDN POP connects to the origin server over TCP to probe the IP address every 5 minutes. If the TCP connection is established, CDN restores the IP address to the list of available origin IP addresses.

    • Normal TCP connection: If the TCP connection between a CDN POP and an origin IP address is normal, but the POP receives a retry status code, such as 5xx, from the origin server, a retry is triggered. However, the origin IP address remains in the list of available origin servers. Subsequent requests are still sent to the origin server based on its weight. This means that a Layer 7 HTTP request failure does not automatically block the origin IP address if the Layer 4 TCP connection is normal. To automatically block the origin IP address in case of a Layer 7 HTTP request failure, you can submit a ticket. For more information about how to submit a ticket, see Contact us.

Procedure

  1. Log on to the ApsaraVideo VOD console.

  2. In the left-side navigation pane, choose Configuration Management > CDN Configuration > Domain Names.

  3. Find the domain name that you want to manage and click Configure in the Actions column.

  4. In the navigation pane on the left, click Back-to-Origin.

  5. On the Configuration tab, in the Timeout for Origin HTTP Requests section, click Modify.

  6. Set Timeout and click OK.

References