All Products
Search
Document Center

Microservices Engine:Configure a timeout policy

Last Updated:May 23, 2024

Cloud-native gateways allow 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 cloud-native gateway.

Configure a timeout policy

  1. Log on to the MSE console.

  2. In the left-side navigation pane, choose Cloud-native Gateway > Gateways. In the top navigation bar, select a region.

  3. On the Gateways page, find your gateway and click Route Settings in the Actions column. In the upper-right corner of the page that appears, click Previous Version.

  4. In the left-side navigation pane, choose Routes > Route Settings. Find the routing rule that you want to modify, and click Policies in the Actions column.

  5. In the Policies section of the page that appears, click the Timeout tab.

    • If no timeout policy exists, click Add Policy.

    • If a timeout policy already exists, click the 编辑图案 icon.

  6. In the Timeout rule, configure the parameters and click OK.

    超时策略.png

    Parameters

    Parameter

    Description

    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.

    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.

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