cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Understanding Autoscaling in Databricks: Under What Conditions Does Spark Add a New Worker Node?

h_h_ak
Contributor

Iā€™m currently working with Databricks autoscaling configurations and trying to better understand how Spark decides when to spin up additional worker nodes. My cluster has a minimum of one worker and can scale up to five. I know that tasks are assigned to cores and that if more tasks are queued than available cores, Spark may consider adding a new workerā€”assuming autoscaling is enabled. But what specific conditions or metrics does Spark use to trigger the autoscaling event?

For example:

  • Is it based solely on the number of pending tasks in the scheduler queue?
  • Does it consider task completion times, memory usage, or CPU utilization on existing workers?
  • How quickly does autoscaling react once these conditions are met?

A practical scenario: If I have a single worker with 8 cores and I have more tasks than cores for a prolonged period, will Spark immediately add another worker or does it wait for some threshold of sustained load?

Iā€™d appreciate insights from anyone who has worked with Databricks autoscaling in production. Any reference to official documentation or real-world examples of how Spark conditions must be met before a new worker is allocated would be very helpful.

3 REPLIES 3

17abhishek
New Contributor

Databricks autoscaling is designed to dynamically adjust the number of worker nodes in a cluster based on workload demand, optimizing resource utilization and cost. Understanding the conditions under which Spark triggers autoscaling requires insight into how Databricks monitors and interprets the workload.

Regards,
Abhishek Upadhyay

filipniziol
Contributor III

Hi @h_h_ak ,

Short Answer:

  • Autoscaling primarily depends on the number of pending tasks.
  • Workspaces on the Premium plan use optimized autoscaling, while those on the Standard plan use standard autoscaling.

Long Answer:

Databricks autoscaling responds mainly to sustained backlogs of unscheduled tasks rather than CPU or memory usage alone. If the number of pending tasks consistently exceeds your current cluster capacityā€”meaning more tasks are queued than available cores can handleā€”Databricks will consider adding a new worker node.

Key Points:

  • Pending Tasks as the Main Trigger: Autoscaling monitors how many tasks remain queued. Persistent queues indicate that existing workers canā€™t keep up, prompting additional workers.
  • Not Instantaneous, But Sustained Load: Spark waits to confirm that the increased demand isnā€™t just a short-lived spike. Only after tasks remain pending for a threshold period does scaling occur.
  • Indirect Role of CPU/Memory Utilization: While CPU/memory affect task completion speed, autoscaling decisions are based on task queues rather than these metrics directly.
  • Timing and Reaction: Adding a new worker typically takes a minute or so, ensuring scaling responds to stable workload increases rather than momentary fluctuations.

Useful Links:

Hi @filipniziol,

Great summary, thanks!

It would interest me to know what the limits are in more detail. For example:

  • How many pending tasks are needed to trigger a new worker or cluster?
  • How long does the CPU utilization need to be above a certain threshold (e.g., > XX%) before scaling occurs?

Are there specific thresholds or configurable parameters that influence these decisions?

Thanks again for the clarification!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonā€™t want to miss the chance to attend and share knowledge.

If there isnā€™t a group near you, start one and help create a community that brings people together.

Request a New Group