All Products
Search
Document Center

Serverless App Engine:Configure graceful start and shutdown

Last Updated:Oct 25, 2025

Applications can become temporarily unavailable during operations such as instance scaling, application rollbacks or upgrades, and application starts or stops. Serverless App Engine (SAE) integrates the graceful start and shutdown feature of Microservices Engine (MSE). This feature uses capabilities such as service prefetch and delayed service registration to ensure business continuity.

Background information

  • Graceful start:

    Applications are often published, scaled, or restarted. The graceful start feature protects applications during these operations. A provider service can be called by a consumer as soon as it is registered with a registry. However, the provider may still need to perform initialization tasks, such as setting up a database connection pool. The graceful start feature is recommended for microservice applications with high traffic.

  • Graceful shutdown:

    When you update an online application, service continuity must be maintained while the application stops and restarts. In high-concurrency scenarios, directly shutting down a service provider instance can cause problems. The service consumer instance cannot detect the real-time status of the downstream instance. It continues to forward requests to the offline instance, which causes request errors and traffic loss. To ensure your application shuts down correctly during operations such as deployment, stop, rollback, scale-in, or reset, you can configure the graceful shutdown feature.

Prerequisites

Go to the feature page

  1. In the SAE application list, select the destination region and namespace, and then click the target Application ID to go to the application details page.

  2. In the navigation pane on the left, choose Microservice Governance > Traffic Governance. Then, click the Graceful Start And Shutdown tab.

Configure graceful start and shutdown

  1. On the Graceful Start And Shutdown page, configure the settings.

    Important
    • To use this feature for the first time, click Enable Microservices Governance and Refresh the page to access the configuration settings.

    • The enablement process takes about 1 to 2 minutes. Wait for it to complete.

    Graceful start

    In the Graceful Start section, turn on the switch, and then configure the following settings.

    Configuration item

    Description

    Delayed Registration Time (seconds)

    Set the delay for service registration. This parameter postpones the service registration by a specified duration. If your application has a long-running asynchronous resource loading process at startup, use this parameter to adjust the registration behavior of new nodes and delay when they start receiving call requests.

    Important

    If the delayed registration duration is not 0, you must configure readiness (readiness probe) during application deployment. Set the access path to /health and the port to 54199. (After you enable microservice administration, the agent automatically listens on port 54199. You do not need to listen on this port in your application.) This ensures that Kubernetes considers the service to be in the ready state only after the service is fully registered with the registry. This prevents a sudden drop in incoming traffic due to the service consumer being unable to find an active service provider. Do not set LivenessProbe (liveness probe) to the same path, /health. Otherwise, the application may enter an infinite loop of restarts. For detailed steps on configuring the readiness probe for applications, see Configure health check.

    Prefetch Duration For Low Traffic (seconds)

    Open the advanced options and set the prefetch duration for low traffic. The traffic prefetch mechanism ensures that when a new node is added, the initial microservice call traffic to that node is low and increases gradually. This design helps mitigate the reduced processing capacity during a Java application's cold start and prevents a significant increase in the overall system response time (RT). The prefetch process ends automatically after the specified duration. After the process ends, the node handles the full amount of traffic.

    Graceful shutdown

    After you connect to MSE, graceful shutdown is enabled by default.

    If you turn on the proactive notification switch, a node that is going offline actively notifies consumers that it is shutting down. This prevents consumers from calling the offline node. This feature is disabled by default. However, if your application uses the Spring Cloud framework and you find that consumer calls fail during the shutdown process, you can enable this feature to resolve the issue.

Disable graceful start and shutdown

  • Graceful start

    In the navigation pane on the left of your application, choose Microservice Governance > Traffic Governance. Click the Graceful Start And Shutdown tab. In the Graceful Start section, turn off the switch.

  • Graceful shutdown

    After you connect to MSE, graceful shutdown is enabled by default and cannot be disabled separately.

To avoid unnecessary MSE costs, you can navigate to the Basic Information page of the target application, choose More > Disable Microservices Governance in the upper right corner, and disable the feature as prompted.

Warning

After you disable the microservices governance feature, other features related to microservices governance (including graceful start and shutdown, canary release rules, and throttling and degradation) cannot be used except for the service list feature. An application restart is triggered when you disable the microservices governance feature. You must determine business risks before you disable the microservices governance feature.