The Tabs of the Spark UI

Every running Spark application serves a web UI from its driver on port 4040. A second application on the same host takes 4041, a third 4042. The UI lives as long as the application: when the driver exits, the pages go with it. To inspect a finished run, the application must have written an event log, with spark.eventLog.enabled set to true before it started. The History Server, on port 18080 by default, replays that log into the same pages.

A question for each tab

TabThe question it answersColumns to read
JobsWhich actions ran, and how long did each take?Duration, Stages: Succeeded/Total
StagesWhich stage is slow, and how much data did it move?Duration, Input, Output, Shuffle Read, Shuffle Write
StorageWhat is cached, and how much of it fits in memory?Fraction Cached, Size in Memory, Size on Disk
EnvironmentWhich settings did the application launch with?Spark Properties
ExecutorsIs every executor alive and taking its share of tasks?Failed Tasks, Complete Tasks, Storage Memory
SQL / DataFrameWhich plan ran, and how many rows left each operator?the plan graph and its per-operator metrics

Jobs: a row for every action

A job is the work an action launches. Call count() and the Jobs tab gains a row; define 10 transformations without an action and it gains nothing, which is lazy evaluation made visible. With adaptive query execution on, the default since Spark 3.2, a single action can show up as several job rows, because Spark runs each shuffle stage as its own job to measure its output before planning the next step. The SQL / DataFrame tab lists those job ids under the query that launched them.

Stages: where the time and the bytes are

A stage is a run of narrow work that ends at a shuffle or at the job's result. The Stages tab lists every stage of every job with its Duration, its task count and 4 data columns: Input, Output, Shuffle Read and Shuffle Write. A slow job usually needs this tab first, and the rest of this lesson works inside it.

Storage, Environment, Executors, SQL / DataFrame

The usual route through the UI: from a slow job to the stage inside it, then to the task inside that stage. The Stages tab skips the first step.
  • Jobs tab (source, a row per job)
  • Job page (transform, DAG and stage list)
  • Stages tab (source, every stage, sortable)
  • Stage page (transform, summary metrics)
  • Task table (consumer, a row per task)
  • Jobs tab -> Job page
  • Job page -> Stage page
  • Stages tab -> Stage page
  • Stage page -> Task table

A teammate calls cache() on a DataFrame, defines 2 more transformations on it, and finds the Storage tab empty. What does the empty tab tell you?

The tabs measure at different grains. Jobs and Stages count per job and per stage, and Executors per machine. Only the SQL / DataFrame tab measures per operator: open a query and each box in its plan graph carries the numbers recorded while that operator ran, such as number of output rows on a join or the files a scan read.

Stage 4 of a join takes 18 minutes, and you want the number of rows the join operator produced to check for a duplicate-key blowup. Which tab shows that count?

About this lesson

This section is part of the The Spark UI: Beginner lesson on DataDriven, the home of data engineering. Lessons cover SQL, Python, Spark, data modeling and pipeline architecture, and each section pairs its explanation with worked examples and practice you run as you go.