All Products
Search
Document Center

API Gateway:Configure a timeout policy

Last Updated:Jun 10, 2025

Cloud-native API Gateway allows you to configure timeout policies at the route level. If the gateway does not receive a response from the backend service within the specified period of time, the gateway returns the 504 (Gateway Timeout) status code to the client. This topic describes how to configure a route timeout policy for a gateway.

Procedure

  1. Cloud-native API Gateway provides two methods to configure timeout policies: outside an instance and inside an instance:

    API outside an instance

    1. Log on to the Cloud-native API Gateway console. In the left-side navigation pane, select API, and select a region from the menu bar at the top.

    2. Click the target API. You can select the instance for which you want to configure a timeout policy from the drop-down list, or select All Instances.image

    3. Select the target route from the Routes.

    API inside an instance

    1. Log on to the Cloud-native API Gateway console. In the left-side navigation pane, select Instance, and select a region from the menu bar at the top.

    2. On the Instance page, click the ID of the target gateway instance. In the left-side navigation pane, select API, and click the target API.

    3. Select the target route from the Routes.

  2. Click the Configure Policy tab, and click Inbound Processing > Enable Policy/Plugin.

  3. Click the Timeout card. In the Add Policy: Timeout panel, configure the related parameters, and then click Add.

    Note

    After the timeout policy is created and enabled, you can verify whether the timeout policy is effective based on your business requirements.

    Parameter

    Description

    Enable

    Specifies whether to enable the timeout policy.

    • If you turn on the switch, the timeout policy takes effect.

    • If you turn off the switch, the timeout policy does not take effect.

    Timeout Period

    The timeout period for the current route. Unit: seconds.

    Note

    If you set this parameter to 0 or keep the timeout policy disabled, the gateway waits for responses all the time.