Home › Apache Spark › Cluster Sizing Calculator
Apache Spark · Calculator

How many nodes: min and max?

Autoscale min and max come from your load, not a guess. Describe what runs on the cluster and when; the calculator sizes each workload, draws the day, and explains the numbers.

STEP 1

Size each workload

Data ÷ 128 MB gives tasks. Tasks × measured task time gives total work.

STEP 2

Fit its deadline

Work ÷ deadline gives cores. Cores ÷ cores per node gives nodes.

STEP 3

Stack the day

Add up what runs each hour. The tallest hour is your peak.

STEP 4

Set min and max

Max = peak + headroom. Min = the load that is always there.

1 · Node and cluster settings

The VM size of each worker node, and a few rules of thumb you can change.

2 · Workloads on this cluster

Task time: run your job on ~1% of the data and read the average task duration in the Spark UI. Shuffle %: share of the data moved by joins and group-bys.
WorkloadTypeData (GB)Task time (s)Shuffle %Deadline (min)Start hourEnd hourFixed nodes

3 · Recommendation

Updates as you type.
Min nodes
–
workers
Max nodes
–
workers

    How each workload was sized

    Executor shape per node:

    Read tasks = data ÷ 128 MB. Shuffle tasks = shuffled data ÷ 200 MB, assumed to take 2× the task time. Cores = core-seconds ÷ deadline ÷ efficiency.

    Put it in config

    The same numbers on three platforms.

    What autoscaling saves

    Node-hours per day if the cluster follows the load (between min and max), compared with keeping max running all day.

    Estimates only. Real autoscalers add and remove nodes with some delay, and new nodes take a few minutes to start.

    Why these rules

    Common mistakes with min and max