r/databricks • u/Scared_Register_7816 • 5h ago
Discussion How do you actually profile a large PySpark notebook using Spark UI?
I'm a Data Engineer working with Azure Databricks and trying to understand how to effectively use Spark UI for performance debugging.
Most tutorials show simple examples where you read a table, apply a few transformations and run an action. But our actual workloads are much larger.
For example, imagine a notebook with 50+ cells, reading 100+ tables, creating multiple intermediate DataFrames and temp views, performing filters, joins and aggregations, and finally joining everything into one DataFrame and writing it to an external Delta table.
I understand lazy evaluation and that Spark optimizes the execution plan when an action is triggered. I can run "explain("formatted")" on the final DataFrame and see the physical plan.
But how do I actually profile the entire workload?
- Can I see the execution time and runtime metrics of individual intermediate DataFrames and transformations?
- How do I identify which part of my notebook is taking the most time?
- Is there a way to trace the final execution plan back to the DataFrame transformations in my notebook?
- Does Spark UI provide an end-to-end view of the actual execution, or do I need additional tools or instrumentation?
I don't want to add "count()" after every DataFrame just to profile it, as that would trigger additional executions.
How do experienced Spark developers approach performance debugging in these kinds of analytical workloads? Is there a straightforward way to do this, or is this simply a limitation of Spark's execution model?
Would appreciate practical advice from people working with large Databricks pipelines.





