GrabShubham BadkurProblem & solution
Optimally Scaling Kafka Consumer Applications
Summary
Grab's Coban platform runs Golang-based stream processing pipelines on Kubernetes, servicing roughly 400 billion events weekly from Kafka. The initial Horizontal Pod Autoscaler setup caused resource waste and uneven load distribution across Kafka partitions during scale-in and scale-out events. To resolve this, Grab moved to a fixed pod count matching the topic's partition count and adopted Vertical Pod Autoscaling, reducing resource usage versus requests by approximately 45%. The team also introduced Kubernetes priority classes to segment latency-sensitive workloads onto On-Demand nodes and non-critical jobs onto Spot instances. Additionally, overprovisioning via low-priority placeholder pods managed by Cluster Proportional Autoscaler enabled rapid pod rescheduling and reduced deployment delays.
Context
Horizontal Pod Autoscaling on Grab's stream processing platform led to resource wastage from conservative provisioning for peak traffic and resulted in uneven Kafka partition assignment across scaling pods.
Approach / What changed
Grab fixed the number of pipeline pods to match Kafka partition counts retrieved at deployment, replaced HPA with Vertical Pod Autoscaling, separated workloads onto Spot and On-Demand nodes using priority classes and node affinity, and added overprovisioned placeholder pods managed by Cluster Proportional Autoscaler.
Takeaways
Aligning the number of consumer pods directly with the Kafka topic partition count prevented uneven partition distribution during scaling events.
Replacing Horizontal Pod Autoscaling with Vertical Pod Autoscaling on fixed-size consumer deployments yielded an approximate 45% reduction in total resource usage relative to requested capacity.
Using low-priority placeholder pods scaled by Cluster Proportional Autoscaler allowed immediate preemption and rescheduling when Spot instances were terminated.
Source and freshness
- Source
- engineering.grab.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.