How to Read the Spark UI and Find Why Your Job Is Slow

A practical field guide from Team BricksNotes, with 12 slides you can save and share.

Your Spark job usually finishes before you make coffee. Today, the coffee is cold and the job is still running.

The first suggestion is familiar. Add more workers. Increase memory. Try again.

Sometimes that helps. But first, ask a better question. What is the job actually waiting for?

At Team BricksNotes, we want to make that question easier to answer. Our Spark UI Field Guide brings three useful signals together: task imbalance, memory spill, and shuffle. The carousel above contains all 12 pages of the original guide.

View all 12 slides in the carousel above, or join the conversation on LinkedIn.

Start with the slowest stage

On compute where the Spark UI is available, open Jobs, find the slow job, and inspect its stages. Open the longest-running stage and look at the task summary metrics.

Compare the median task with the maximum. The median describes a typical task. The maximum shows the slowest one. Read duration alongside shuffle read and disk spill, rather than treating one number as a complete diagnosis.

On Databricks Free Edition and serverless compute, the classic Spark UI may not be available. For supported SQL queries, use Query Profile from query history. Inspect operator time and available spill and data-movement metrics. Query Profile is not identical to the Spark UI, and it does not expose every task-level statistic.

Signal one is a task that takes much longer

Our guide uses an illustrative stage with 200 completed tasks. The median duration is 38 seconds. The maximum is 19.6 minutes. Median shuffle read is 212 MB, while the maximum reaches 8.9 GB.

That combination suggests uneven work. One task is reading much more data and taking much longer than its peers.

Imagine joining orders by customer ID. Most customers have hundreds of orders, but one account has millions. That key can concentrate work in a small number of partitions.

A maximum more than five times the median is a useful investigation prompt, not a universal rule or proof of skew. Slow storage, garbage collection, and other resource problems can also produce long tasks.

Check the key distribution and execution plan. Keep Adaptive Query Execution enabled where supported. It can split qualifying skewed shuffle partitions for joins, but it does not fix every uneven workload.

Handle null and default keys according to their business meaning. Never remove valid records simply to make a graph look better. Consider broadcasting a genuinely small lookup table when its size safely fits executor memory.

For a deeper example, read why more Spark workers will not fix data skew.

Signal two is work spilling to disk

Some operations need more working memory than a task has available. Spark can spill intermediate data to disk so that the operation can continue.

The guide shows a maximum disk spill of 31.4 GB. That is a reason to investigate, not an automatic failure. Some spill is expected in large workloads.

There is an important distinction. Spill in memory reports the estimated in-memory size of the data that was spilled. Spill on disk reports its disk representation, which can be smaller because of compression. They are not two separate storage destinations.

Start by reducing each task's load. Filter rows earlier and select only the columns the next operation needs. Review partition sizes before adding memory. More partitions can help oversized tasks, but too many tiny partitions introduce scheduling overhead.

The goal is less unnecessary spill and a better runtime, not a guaranteed zero. Our Spark memory and disk spill explanation explores the distinction in more detail.

Signal three is unnecessary data movement

A shuffle redistributes data between tasks. Joins and grouped aggregations often require it. Shuffle is part of distributed processing, not something to eliminate at any cost.

Read shuffle volume alongside the query plan and row counts. Large movement may be justified. It may also reveal a wide join, duplicated keys, or an explode operation that multiplied rows before aggregation.

Filter and project before a join when the result stays correct. Aggregate to the grain the business needs before joining when that preserves the intended calculation. Broadcast only a safely sized small side.

For Delta tables, suitable Liquid Clustering can improve file skipping for selective filters. It does not remove the need for a shuffle join.

Compare these choices in our broadcast and shuffle join guide.

Change one thing and read again

Record the baseline runtime, input size, and relevant metrics. Make one change, rerun against comparable data, and inspect the same evidence.

Check correctness too. Compare row counts, totals, and important business keys. A faster pipeline with missing orders is not an improvement.

In Free Edition, run a small grouped SQL query over sample data and inspect its supported Query Profile. Add a selective filter and run it again. Observe what changes rather than assuming the optimizer behaved as expected.

Keep the field guide and practice the skill

Save the PDF beside your troubleshooting notes. Use it to form a first hypothesis, then confirm that hypothesis with the plan and data.

Our free Databricks Associate practice exam includes Spark UI interpretation scenarios. The Databricks learning book builds the reasoning behind those decisions.

You do not need to memorize every configuration. Start by reading the work your system is doing.

Thank you for learning with Team BricksNotes. Happy holidays to you and the people who support your journey.

References

Apache Spark Web UI documentation, Spark SQL performance tuning, and Databricks Query Profile documentation.

Read and share the original BricksNotes LinkedIn post.