Serverless App Engine (SAE) improves the startup efficiency of Java applications in different stages. This topic describes how to improve the startup efficiency of a Java application.
Prerequisites
You can configure startup acceleration only for Java applications that are deployed by using JAR packages or WAR packages.
Usage notes
If you want to improve the startup efficiency of an application, you can select the Dragonwell 11 environment when you create the application and select Enable Application Startup Acceleration (Quickstart) in the Startup Command Settings section.
If you want to improve the runtime efficiency of an application, you can select a Dragonwell environment when you create the application and select Enable Performance Improvement for Microservices (Wisp2 Coroutine) in the Startup Command Settings section.
The following figures show the comparison data before and after startup acceleration is enabled.
The comparison data of startup acceleration in this topic is provided only for reference. The actual data may vary based on your environment.
Application startup | Application runtime |
|
|
Improve the startup and runtime efficiency of an application
Step 1: Specify basic information for the application
Log on to the SAE console. In the left-side navigation pane, choose . In the top navigation bar, select a region and click Create Application. In this example, the Hangzhou region is used.
On the Create Application configuration wizard, set the following parameters.
Specify parameters in the Basic Information Settings section of the Basic Information page.
Click Configure Code Package-based Deployment next to Code Package-based Deployment, configure the parameters described in the following table in the Configure Code Package-based Deployment panel, and then click OK.
Parameter
Example
Description
Technology Stack Programming Language
Java
The programming language of the technology stack. Select the Java language.
Code Package Type
WAR Package
Select JAR Package Deployment or WAR Package Deployment. In this example, WAR Package Deployment is selected.
Application Runtime Environment
apache-tomcat-9.0.87
The runtime environment of the application. The SAE console supports the following runtime environments:
apache-tomcat-XXX: applicable to Spring Boot applications or Dubbo applications.
EDAS-Container-XXX: applicable to HSF applications deployed by using WAR packages.
Java Environment
Dragonwell 11
The Java environment of the application. Available Java environments:
Dragonwell X (recommended): OpenJDK is supported. If you select this option, the startup and runtime of the application are accelerated and garbage collection (GC) efficiency is improved. For more information, see Configure startup commands.
Open JDK X: This environment is based on the CentOS operating system and the size of the base image is large.
openjdk-XXXXX-jdk-alpine3.9: This environment is based on the Alpine operating system and the size of the base image is small.
For more information, see Java runtime environments.
NoteCompared with the CentOS operating system, the Alpine-based Java environment supports a fewer tools or commands. If you select openjdk-XXXXX-jdk-alpine3.9, specific commands in the webshell may fail to run. You must select an environment based on your business requirements.
Upload Method
Upload WAR Package
The file upload method. Valid values:
Upload WAR Package: If you select this option, download the WAR package to your on-premises machine and then click the
icon to upload the WAR package.
WAR Package URL: If you select this option, enter the URL that is used to access WAR packages.
Version
1737696728895
The version number of the application. Enter a version number or click Use Timestamp as Version Number.
Time Zone Settings
UTC+8
The time zone of the application.
Custom Configuration
N/A
Optional. Select the check box on the left side of Custom Configuration and then specify the
Java Tomcat
parameters. For more information, see Configure Java Tomcat parameters.In the Capacity Settings section, set the Single Instance Type and Instances parameters.
Click Next: Advanced Settings.
Step 2: Specify advanced configurations
On the Advanced Settings page, configure the following items:
(Optional) Configure persistent storage to accelerate the restart and scaling processes across instances.
NoteIf you do not configure persistent storage, you can perform Step 3 to accelerate the startup process next time you restart the application.
In the Persistent Storage section, turn on Enable NAS.
Select the NAS file system that you want to mount from the NAS File System drop-down list, and configure the Mount Source, Mount Directory, Container Path, Permission, and Mount Parameters.
In the Startup Command section, configure the required parameters.
To improve the startup efficiency of the application, select Enable Application Startup Acceleration (Quickstart) and specify the Persistent Storage Directory parameter.
To improve the runtime efficiency for the application, select Enable Performance Improvement for Microservices (Wisp2 Coroutine).
Step 3: Verify the result
In the lower part of Advanced Settings page, view the configuration fees of the application to be created and then click Create Application.
Check whether the configurations have taken effect.
Method 1:
In the left-side navigation pane of the Basic Information page, click Change Records. On the Change Records page, view the change details. If Executed is displayed in the Change Status column, the application is deployed and the configurations have taken effect.
Method 2:
On the Basic Information page, click the Instance Deployment Information tab to view the Status of the instances. If Running is displayed in the Status column, the application is deployed and the configurations have taken effect.