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
| Tab | The question it answers | Columns to read |
|---|---|---|
| Jobs | Which actions ran, and how long did each take? | Duration, Stages: Succeeded/Total |
| Stages | Which stage is slow, and how much data did it move? | Duration, Input, Output, Shuffle Read, Shuffle Write |
| Storage | What is cached, and how much of it fits in memory? | Fraction Cached, Size in Memory, Size on Disk |
| Environment | Which settings did the application launch with? | Spark Properties |
| Executors | Is every executor alive and taking its share of tasks? | Failed Tasks, Complete Tasks, Storage Memory |
| SQL / DataFrame | Which 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
- Storage: stays empty after cache() until an action runs, because cache() is lazy too. A Fraction Cached under 100% means some partitions are missing from the cache and get recomputed whenever they are read.
- Environment: the properties the application launched with. Settings fixed at startup, such as spark.executor.memory, show the value that took effect.
- Executors: a row for each executor plus the driver. Failed Tasks piling up on a single row points at that machine: a lost executor, a memory kill, a bad node.
- SQL / DataFrame: each query's plan drawn as a graph with measured numbers, such as rows output per operator. Older versions label it SQL. Think of it as explain() after the run, with measurements attached.
- 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 data was too large for memory, so Spark dropped every partition it had cached.
- No action has run since cache(), so nothing has been computed or stored yet.
- The Storage tab lists only saved tables, so cached DataFrames never appear in it.
- The cache went to disk, and the Storage tab counts only partitions held in memory.
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?
- Jobs, which lists each job's stage count and the total tasks it ran.
- Executors, which totals the bytes each executor read and shuffled.
- Environment, which records the join strategy chosen for each query.
- SQL / DataFrame, whose plan graph shows rows output by the join node.
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.