All Products
Search
Document Center

ApsaraVideo VOD:Throttling functions

Last Updated:Jul 10, 2026

You can use throttling functions to control the data transfer rate for individual requests.

limit_rate_after

Item Description
Syntax limit_rate_after(n, unit)
Description Sets the amount of data that can be transferred before rate limiting takes effect.
Note This function applies to an individual request and is not a global bandwidth limit.
Parameters
  • unit: An integer. If you do not specify the parameter, the default unit is bytes.
  • unitKMG: A char. Valid values are , , or . The values are case-insensitive.
Return value truefalseReturns on success or on failure.
Examples
limit_rate_after(10, 'k')
limit_rate(1, 'm') 
// After the first 10 KB is transferred, the rate is limited to 1 MB/s.

limit_rate

Item Description
Syntax limit_rate(n, unit)
Description Sets the data transfer rate for a request. The minimum rate is 4 KB/s. If you specify a rate lower than 4 KB/s, the rate defaults to 4 KB/s.
Note This function applies to an individual request and is not a global bandwidth limit.
Parameters
  • unit: An integer. If you do not specify the parameter, the default unit is bytes/s.
  • unitKMG: A char. Valid values are , , or . The values are case-insensitive.
Return value truefalseReturns on success or on failure.
Examples
limit_rate(500, 'k')
// Limits the data transfer rate to 500 KB/s.