How ACK AHPA and Hybrid ECS/ECI Deployment Supercharge Ride‑Sharing Elasticity
This article details how a large ride‑hailing platform tackled container scaling delays and cost inefficiencies by adopting Alibaba Cloud ACK's Advanced Horizontal Pod Autoscaler, combining ECS and Elastic Container Instances, customizing scheduling policies, and injecting sidecars into virtual nodes to achieve proactive, cost‑effective elasticity.
Background and Challenges
Enjoy Mobility, a flagship brand of SAIC Group, supports the automaker’s “new four modernizations” (electrification, intelligent networking, sharing, and internationalization). Rapid business growth has expanded its infrastructure, making efficiency and cost control critical. The platform runs a Java‑based stack on Kubernetes, but native HPA and CronHPA cause minute‑level cold‑starts, cannot absorb unexpected traffic spikes, and require operators to manually script resource calculations, leading to high operational overhead and imprecise scaling.
Proposed Solution Overview
The team introduced two key components: ACK Advanced Horizontal Pod Autoscaler (AHPA) for predictive scaling, and a hybrid deployment of ECS (Elastic Compute Service) and ECI (Elastic Container Instance) to balance cost and performance.
ACK AHPA Predictive Autoscaling
AHPA learns from historical pod ready times and metrics, forecasting the required number of pod instances for each minute of the next 24 hours (1440 data points). By starting pods before traffic rises, the platform eliminates scaling latency, ensuring resources are ready when demand peaks.
For example, if weekend data shows a maximum of 16 pods for Service A, AHPA pre‑creates those pods in advance, preventing cold‑start delays.
Hybrid ECS/ECI Deployment
ECI provides a serverless container runtime that requires no underlying server management, ideal for burst traffic, though its per‑unit cost is higher than bare‑metal ECS. The hybrid model runs baseline services on subscription‑based or pay‑as‑you‑go ECS, while allocating burst workloads to ECI, achieving both cost efficiency and elasticity.
Custom Elastic Resource Priority Scheduling
To enforce deterministic scaling behavior, the deployment prioritizes resources in the order: subscription ECS → pay‑as‑you‑go ECS → ECI. During scale‑down, pods on ECI are terminated first, followed by pay‑as‑you‑go ECS, then subscription ECS. This is achieved by labeling nodes and defining a ResourcePolicy custom resource.
apiVersion: scheduling.alibabacloud.com/v1alpha1
kind: ResourcePolicy
metadata:
name: DEMO
namespace: demo-ns
spec:
units:
- max: 15
nodeSelector:
env: prd
resource: ecs
- max: 5
nodeSelector:
foo: bar
resource: ecs
- resource: eci
whenExceedMax: NeverEvictSidecar Injection for Virtual Nodes
Virtual nodes cannot run DaemonSets, which are used for log collection agents on ECS nodes. To provide equivalent functionality, the team injects sidecar containers into pods scheduled on virtual nodes using OpenKruise’s SidecarSet via an admission webhook. This automatically adds sidecars to matching pods before they are scheduled to virtual nodes.
Note: SidecarSet is a core feature of Alibaba Cloud’s OpenKruise, enabling automatic sidecar injection for pods that meet label criteria, decoupling sidecar lifecycle from business containers.
Custom Elastic Metrics
Since CPU/Memory metrics may not reflect complex business workloads, the solution leverages AHPA’s External Metrics mechanism together with the alibaba-cloud-metrics-adapter to feed custom metrics into the autoscaling decision process.
Business Impact
After scaling the intelligent container elasticity platform, Enjoy Mobility achieved significant cost savings while maintaining stability and handling traffic spikes effectively. With a threshold set at 50, the system proactively scales when metrics approach the limit, delivering both reliability and measurable reduction in resource expenditure.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Alibaba Cloud Native
We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
