The author | Xu Chengming (race clouds)
As the best practice of cloud computing, the direction of cloud native development and the future evolution trend, Serverless’s core value lies in fast delivery, intelligent flexibility and lower cost. SAE (Serverless Application Engine), as the first application-oriented Serverless PaaS platform, realizes the perfect combination of Serverless architecture and microservice architecture, enabling stock applications to enjoy the technical bonus granted by Serverless even with zero code transformation. Currently, the system is enhancing multi-language features and evolving towards multi-load scenarios. As Serverless platform, efficient application deployment efficiency is undoubtedly the core competitiveness of the product, as well as the foundation of flexible expansion and intelligent hosting. Faster deployment efficiency means better user experience, lower user cost, and greater flexibility. The SAE Extreme Resilience project aims to improve the end-to-end startup speed of applications and ensure rapid capacity expansion efficiency and system stability SLA for users in emergency scenarios.
Serverless app engine: www.aliyun.com/product/ali…
Project background
At the bottom of SAE, Kubernetes architecture is used, and two resource pools, Divine Dragon Bare metal security Container and ECI, are used. Applications run by users in SAE will be mapped to corresponding resources in Kubernetes.
By collecting all ONLINE K8s events, the whole Pod creation life cycle is statistically analyzed by nodes and stages. Taking Shenlong node as an example, the proportion of each stage is shown as follows:
As can be seen from the figure, the whole pod creation life cycle includes scheduling, pulling and creating init containers, pulling user service images, creating and starting containers, etc. Its time is mainly focused on scheduling and pulling user images. The reason is that it takes a long time to schedule the link of SAE Dragon node, while the time of image extraction and decompression is mainly the time of image extraction, especially in the case of large-capacity image deployment.
Implementation plan
SAE team investigated and analyzed the scheme from many aspects such as long-term architecture planning and versatility of application scenarios, and considered using the deployment strategy of in-place upgrade to replace the reconstruction upgrade strategy to avoid rescheduling during deployment and reduce the overall time consumption.
The so-called in-place upgrade means that only one or more container versions of Pod are updated without affecting the upgrade of the whole Pod object and other containers, and IP and Node are not changed during the upgrade process. Within Alibaba, the vast majority of e-commerce applications are released in the cloud native environment in the form of in-place upgrade. This in-place upgrade mode greatly improves the efficiency of application release and saves the time of scheduling, network allocation, disk mounting and mirror pulling. An analysis of the online DEPLOYMENT history of SAE users revealed that the majority of applications only updated images/packages were deployed, suggesting that in-place upgrade capabilities are well suited for implementation in SAE products.
The benefits of in-place upgrades for SAE are:
- Avoid rescheduling and sidecar container reconstruction. You only need to pull and create a service container.
- New images can be cached on Node in advance without scheduling, improving elastic efficiency.
- IP can be kept unchanged to avoid the delay of dependent components such as the registry due to IP changes;
- Reduce the stress of rebuilding POD to scheduler, registry, business upstream and downstream.
Meanwhile, the OpenKruise project has contributed in-place upgrade capabilities to open source via CloneSet/AdvanceStatefulSet. CloneSet is one of the core workloads provided in OpenKruise. It is mainly for stateless applications, providing more efficient and controllable application management and deployment capabilities, supporting elegant in-place upgrade, specified deletion, configurable release order, parallel/grayscale release and other rich strategies. It can meet more diversified application scenarios. CloneSet vs. native Kubernetes Workload:
OpenKruise Project: OpenKruise.io /
SAE decided to adopt CloneSet as the new application load, on the one hand to improve the overall application deployment efficiency with its in-place upgrade capability, on the other hand, combined with the open source power of OpenKruise, to create a large-scale application practice of the universal standard stateless application load. For incremental applications, CloneSet will be used by default to deploy user applications, and the maximum number of unavailable instances and elegant upgrade time will be combined to ensure that published traffic is lossless. For stock applications, rolling upgrade based on finite state machines will be used for online migration.
Within one month, nearly a thousand applications have been deployed using CloneSet, and the number of in-place upgrades is twice that of rebuilding upgrades. The deployment efficiency is 42% higher than that of native K8s. Combined with image caching, users can deploy applications to containers within seconds. SAE will continue to productize more of OpenKruise’s advanced capabilities, as well as refine stability and best practices in user scenarios and feed back into open source.
Figure: Native K8s deployment application rebuild upgrade policy VS SAE deployment application native upgrade policy
future
SAE is exploring more dimensions and finer granularity in its quest for deployment efficiency. In the near future, SAE’s ultimate elasticity will shine in terms of elastic efficiency, elastic scale and intelligent precision.
Serverless Technology Open Course
What is the specific product form of Serverless? How to use it in production? What are the pits during the landing? 10 alibaba technical experts in the Serverless field work together to create the most suitable Serverless open course for developers to get started. There are 3 stages and 10 class hours, so that you can easily get started and use it immediately.
Click to watch free classes: developer.aliyun.com/learning/ro…
“Alibaba Cloud originator focuses on micro-service, Serverless, container, Service Mesh and other technical fields, focuses on the trend of cloud native popular technology, large-scale implementation of cloud native practice, and becomes the public account that most understands cloud native developers.”