← Back to Sessions

Spark Structured Streaming Autoscaling

30 min•Intermediate•Sydney
SparkStructured StreamingAutoscalingData EngineeringPerformanceCost Optimization

Description

Spark Structured Streaming is a powerful tool for real-time data processing, but its default dynamic resource allocation (DRA) often falls short in handling the fluctuating workloads of modern data pipelines. This proposal introduces a custom autoscaling solution for Spark Structured Streaming, designed to optimize resource utilization, reduce costs, and improve the overall efficiency of streaming applications. This solution addresses limitations of standard DRA, offering a more granular, responsive approach to scaling Spark executors.

Abstract

Spark Structured Streaming applications often experience varying data input rates. Standard DRA, while beneficial, may not scale in or out efficiently as its scaling logic is based on the premise of checking pending tasks, and it doesn't scale down resources during low-cycle periods, leading to inefficiency. This results in resource wastage and inefficient scaling. Our custom autoscaling solution enhances Spark Structured Streaming by providing more intelligent and responsive scaling mechanisms. Key features include metric-driven scaling, graceful executor decommissioning, configurable parameters, a client-server architecture, and seamless integration with existing infrastructure.

Key Takeaways

  • Cost Optimization: Reduced resource wastage by dynamically scaling executors based on actual workload.
  • Improved Performance: Ensures timely data processing even during peak loads.
  • Increased Stability: Graceful decommissioning prevents job failures during scale-in.
  • Enhanced Flexibility: Customizable parameters allow adaptation to different application requirements.
  • Proactive Resource Management: Metric-driven scaling enables proactive response to changing data patterns.

Speaker

Harpreet Singh

Harpreet Singh

Staff Software Engineer at Rokt

Harpreet Singh is a Staff Software Engineer at Rokt in Sydney, where for the past eight years he's built and scaled core platform services. With over 12 years in infrastructure and platform engineering—ranging from Kubernetes service meshes to real-time data pipelines—he has driven the development of resilient, globally distributed platforms. He rolls up his sleeves for everything from edge-platform design to cost-efficient custom auto scaling solution. When he's not building platforms, you'll find him on the cricket pitch.