Cluster & Compute Management Flashcards

(44 cards)

1
Q

What is a Databricks cluster at a high level?

A

A set of compute resources (driver and workers) configured with a runtime and libraries, used to run Spark jobs, notebooks, and SQL workloads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two main types of clusters in Databricks?

A

All-purpose clusters for interactive use and job clusters for scheduled or one-off job runs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When are all-purpose clusters typically used?

A

For interactive development, exploratory analysis, and collaborative notebook work.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When are job clusters typically used?

A

For production jobs and workflows, where each run gets a clean, ephemeral cluster with defined configuration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why are job clusters recommended for production workloads?

A

They avoid interference between users, ensure reproducible environments, and can be sized exactly for each job’s needs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the driver node’s role on a Databricks cluster?

A

It runs the Spark driver process, coordinates execution, and usually holds the notebook state or main application logic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a worker node’s role on a Databricks cluster?

A

It runs executor processes that perform actual data processing tasks on partitions and store intermediate data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does autoscaling mean for a Databricks cluster?

A

The ability to automatically increase or decrease the number of worker nodes based on workload demand within configured bounds.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why is autoscaling useful?

A

It can improve resource utilization and cost efficiency by scaling up under load and scaling down when idle or lightly loaded.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a reasonable upper limit on autoscaling tied to?

A

Expected peak concurrency and data volume; too high a limit can cause excessive costs or strain downstream systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a cluster policy in Databricks?

A

An admin-defined set of constraints and defaults on cluster configurations to enforce best practices and cost controls.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why are cluster policies important in larger organizations?

A

They standardize runtimes, node types, autoscaling ranges, and security settings, reducing misconfiguration and cost surprises.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are some common parameters controlled by cluster policies?

A

Instance families and sizes, autoscaling bounds, runtime versions, spot vs on-demand usage, and permission scopes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Databricks Runtime (DBR)?

A

A curated and optimized Spark runtime with bundled libraries and performance improvements provided by Databricks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why is it important to choose a specific DBR version rather than ‘latest’?

A

Pinning versions ensures reproducibility and avoids unexpected behavior changes when runtimes are updated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the difference between CPU and GPU clusters in Databricks?

A

CPU clusters use standard compute nodes; GPU clusters use nodes with GPUs for accelerated ML, DL, or compute-intensive tasks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

When might you choose a GPU cluster?

A

For training deep learning models or other GPU-accelerated libraries where workloads benefit from large parallelism.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is spot (or preemptible) capacity in cluster configuration?

A

Discounted instances that can be reclaimed by the cloud provider, offering lower cost at the expense of potential interruptions.

19
Q

Why is mixing spot and on-demand nodes sometimes advantageous?

A

It can lower cost while retaining some resiliency, as critical tasks can run on on-demand nodes while extra capacity uses cheaper spot nodes.

20
Q

What is cluster auto-termination?

A

A setting that automatically terminates a cluster after a period of inactivity, preventing idle compute charges.

21
Q

Why is auto-termination essential for all-purpose clusters?

A

Interactive clusters are easy to forget; auto-termination avoids paying for unused resources when work stops.

22
Q

What is the relationship between cluster size and parallelism?

A

Larger clusters (more cores) can run more tasks in parallel, but require enough data and proper partitioning to be fully utilized.

23
Q

Why can a cluster that is too large be inefficient?

A

If workloads and data sizes are too small, many cores sit idle, wasting cost without speeding up jobs significantly.

24
Q

What is executor memory used for?

A

Holding data partitions, cached DataFrames, and intermediate results during computations.

25
What happens when executors run out of memory?
Spark spills data to disk, which slows down jobs, or may trigger out-of-memory errors and task failures if severe.
26
What is the effect of very small partitions on performance?
They increase scheduling and overhead, leading to less efficient use of the cluster and longer runtimes.
27
What is the effect of very large partitions on performance?
They can cause skew, long-running tasks, and higher memory pressure, risking spills or failures on specific executors.
28
What configuration controls partition sizes in Spark?
Settings like spark.sql.shuffle.partitions and input partitioning of source data influence the number and size of partitions.
29
Why should spark.sql.shuffle.partitions be tuned?
The default may be too high or low for your workload; tuning can reduce unnecessary shuffles and improve performance.
30
What is data skew and how does it show up on a cluster?
Uneven distribution of data across partitions; it appears as a few tasks taking much longer than others and underutilized workers.
31
What strategies help mitigate skew on Databricks?
Salting keys, pre-aggregation, using broadcast joins where appropriate, and redesigning partitioning or join keys.
32
Why is reading from Delta tables often faster than raw Parquet on Databricks?
Delta’s transaction log, statistics, and data skipping enable more efficient file pruning and planning compared to plain folders.
33
What is Spark caching and how does it relate to cluster memory?
Caching stores DataFrames in executor memory for reuse; if memory is limited, caching may cause spills or eviction of useful data.
34
When is it appropriate to cache a DataFrame on Databricks?
When it is reused multiple times across actions and fits comfortably within available memory without crowding out other workloads.
35
Why should unnecessary caching or persist calls be removed?
They consume memory and can degrade performance if cached data is rarely reused or too large.
36
What is the purpose of 'explain' plans for performance tuning?
They show the physical operations (scans, filters, joins, shuffles) and help identify bottlenecks or unnecessary work.
37
What metrics or tools can be used to analyze job performance on Databricks?
Spark UI, Databricks job run details, cluster metrics dashboards, and logs for tasks, executors, and stages.
38
Why is the Spark UI important for tuning?
It reveals stage runtimes, shuffle volumes, skewed tasks, and executor utilization, guiding where to optimize code or configuration.
39
How can you reduce data scanned per query in Databricks?
By using partition pruning, data skipping, ZORDER on Delta tables, and selecting only necessary columns.
40
Why should SELECT * be avoided in production ETL and analytics?
It reads more columns than needed, increases I/O and network usage, and makes schema evolution riskier.
41
What is a good practice for isolating heavy workloads on Databricks?
Run them on dedicated job clusters or separate SQL warehouses so they do not impact interactive or latency-sensitive workloads.
42
How does cluster concurrency affect performance?
Too many concurrent jobs can cause resource contention, leading to longer runtimes and higher failure rates; concurrency limits help maintain stability.
43
What is a reasonable approach to cluster sizing on Databricks?
Start with a modest configuration, measure utilization and runtimes, and adjust size and autoscaling based on empirical evidence rather than guesswork.
44
In one sentence, what is the core mental model for cluster and performance tuning on Databricks?
Treat clusters as flexible, experiment-driven resources: tune size, autoscaling, partitions, and storage layout so Spark jobs fully use the cluster without wasting compute or suffering from skew and spills.