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
You have deployed a Java application using an image or code package. For more information, see Application Deployment.
ImportantThis feature applies only to microservice applications created on or after November 8, 2023.
Microservices governance applies only to Java applications.
You have activated MSE Microservices Governance Professional Edition.
NoteAdditional charges apply for using MSE. For more information about MSE billing, see Billing overview of Microservices Governance.
Go to the feature page
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.
In the navigation pane on the left, choose . Then, click the Graceful Start And Shutdown tab.
Configure graceful start and shutdown
On the Graceful Start And Shutdown page, configure the settings.
ImportantTo 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.
Disable graceful start and shutdown
Graceful start
In the navigation pane on the left of your application, choose . 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 in the upper right corner, and disable the feature as prompted.
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.