Serverless App Engine (SAE) integrates the microservices governance capabilities of Microservices Engine (MSE), which lets you manage applications efficiently. This topic describes how to enable microservices governance in different scenarios and configure graceful start and shutdown.
Overview
Microservices governance
SAE provides powerful microservices governance through seamless integration with MSE. It supports service discovery and configuration management along with features such as graceful start and shutdown, traffic governance, canary release for system protection messaging, end-to-end tracing analysis, intelligent circuit breaking, degradation policies, and intra-zone provider first. These capabilities significantly improve service response speed and stability while simplifying architecture operations and maintenance. With MSE, your microservice applications run efficiently and stably.
Graceful start and shutdown
This section only covers graceful start and shutdown. To learn more about other microservices governance features and configurations, see Microservices governance.
Graceful start
SAE provides the graceful start feature to protect online applications throughout all stages, including release, scale-out, scale-in, and restart. In a microservice architecture, a provider service can be called by users as soon as it is registered. However, the provider may need initialization, such as initializing database connection pools. Graceful start are recommended for microservice applications with high traffic volumes.
Graceful shutdown
Application update and deployment should be seamless for clients, ensuring that the period between stopping and restarting the application does not impact business operations. Due to the nature of microservice application calls, during periods of high concurrency, when the provider applications are shut down under high concurrency, consumer applications cannot detect the status in real time. This causes requests to continue being forwarded to offline instances, resulting in request errors and traffic loss. To ensure that the application is shut down without affecting your business during deployment, shutdown, rollback, scale-in, or reset, you can configure the graceful shutdown feature.
Prerequisites
These features are only applicable to Java applications.
Microservices governance Professional Edition has been activated.
ImportantCharges are incurred when you use microservices governance in SAE.
How to access
The access methods vary in different scenarios:
Create an application
Log on to the SAE console. In the left-side navigation pane, choose . Select the destination region and namespace, and click Create Application.
On the Basic Information wizard page, configure the parameters and click Next: Advanced Settings.
Modify a running application
WarningAfter you redeploy an application, the application is restarted. To prevent unpredictable errors such as business interruptions, we recommend that you deploy applications during off-peak hours.
Log on to the SAE console. In the left-side navigation pane, choose . Select the destination region and namespace, and click the name of the target application.
On the Basic Information page, click Deploy Application.
Modify a stopped application
Log on to the SAE console. In the left-side navigation pane, choose . Select the destination region and namespace, and click the name of the target application.
On the Basic Information page, click Modify Application Configurations.
Find and expand the Microservices governance section, and perform the steps in the following section.
Enable microservices governance and configure graceful start and shutdown
Enable microservices governance
In the Microservices Governance section, turn on the feature.

After the microservices governance feature is enabled, the system automatically injects a built-in Agent into each instance of the application. This Agent uses approximately 0.2 cores and 200 MB of resources. Plan your resources accordingly.
Configure graceful start and shutdown
Configure graceful start
After the microservices governance feature is enabled, you can configure graceful start in the Microservices governance section.
Enable the graceful start feature.

Configure the Small flow warm-up time and Delayed Registration duration.
Parameter
Description
Small flow warm-up time (seconds)
The mechanism ensures that when a new node is released, the microservice call requests to the node are maintained at a low level and gradually increase over time. This design mitigates the weak processing capability of Java applications during cold start and prevents significant increases in response time (RT). The warm-up process automatically ends after the preset duration, after which the node will handle requests as expected.
Delayed Registration
Postpone the service registration by a specified duration. If the asynchronous resources in your application have a long loading time after startup, modify this parameter and postpone when the newly online nodes receive call requests.
ImportantWhen the delayed registration duration is not 0, you must configure the readiness probe in the application deployment, with the access path set to
/healthand the port set to 54199. This ensures that Kubernetes only considers the service ready after it is fully registered with the registry. This measure prevents a sudden drop in incoming traffic when users cannot find available service providers. Do not setLivenessProbeto the same path/healthbecause doing so may cause the application to enter a restart loop.
Configure graceful shutdown
The graceful shutdown feature is enabled by default when the microservices governance feature is enabled.
Graceful shutdown ensures in-transit requests are processed before nodes are shut down during service releases, scale-ins, and restarts. This prevents call errors caused by application shutdown.