Spark UI
| Also known as | Spark web UI, application UI, port 4040 |
|---|---|
| Field | Monitoring and debugging |
| Key parts | Jobs, Stages, Storage, Environment, Executors and SQL tabs; Structured Streaming tab; REST API at /api/v1 |
| Open source implementations | Apache Spark |
| Related | Spark History Server, Spark event log, Spark listener, Job, stage and task, Executor, Shuffle |
The Spark UI is the web interface that the driver of an Apache Spark application serves while the application runs, by default at http://<driver-host>:4040, to show the application's jobs, stages, tasks, cached data, configuration, executors and SQL queries. It runs when spark.ui.enabled is true, which is the default.[1][2] The UI exists only while the application runs; for finished applications, the Spark History Server rebuilds the same pages from the Spark event log.
How do you open the Spark UI?
The UI is on by default (spark.ui.enabled, default true) and listens on spark.ui.port (default 4040).[1] When the port is taken, for example by another application on the same host, Spark tries 4041, 4042 and so on, and logs the chosen port at startup.[2] The same data is available as JSON from the REST API at http://localhost:4040/api/v1 for a running application.[3]
Jobs tab
The Jobs tab lists every job of the application with its status, duration and progress, and shows an event timeline of executors being added and removed alongside the jobs.[2] A job is the work that one action, such as count() or write, triggers (see Job, stage and task).
The job detail page shows the job's stages grouped by status, a DAG visualization, and per-stage Input (bytes read from storage), Output (bytes written), Shuffle read and Shuffle write. It also links to the SQL query that created the job.[2]
What to look for: a job that is much slower than its neighbours, failed jobs, and long gaps in the timeline where no executors were available.
Stages tab
The Stages tab lists all stages by status: active, pending, completed, skipped and failed. Only failed stages show a failure reason, and an active stage can be cancelled with its (kill) link, which spark.ui.killEnabled (default true) allows.[2][1]
The stage detail page is where most performance problems show up. It gives summary statistics (minimum, percentiles, maximum) over all tasks for these metrics:[2]
- Duration and GC time. A maximum far above the median means data skew or a straggler.
- Scheduler delay and task deserialization time, which are large when tasks are tiny or closures are big.
- Shuffle Read Size / Records, Shuffle Read Fetch Wait Time and Shuffle Remote Reads, which show how much the stage depends on the network.
- Shuffle spill (memory) and Shuffle spill (disk). Any spill means execution memory ran out for this stage (see Shuffle).
- Peak execution memory used by shuffles, aggregations and joins.
The page also aggregates the metrics by executor, lists named accumulators, and has a task table with links to each task's executor logs.[2]
Storage tab
The Storage tab lists the RDDs and DataFrames that the application has persisted, with their storage level, size in memory and on disk, and number of cached partitions. The detail page shows which executors hold each partition.[2]
What to look for: a cached DataFrame with fewer cached partitions than total partitions, which means part of it was evicted or never computed.
Environment tab
The Environment tab shows the configuration the application is actually running with, in sub-tabs: Runtime Information (JVM and Scala versions), Spark Properties, Resource Profiles, Hadoop Properties, System Properties, Metrics Properties and Classpath Entries. Properties set as spark.hadoop.* appear under Spark Properties, not Hadoop Properties.[2]
What to look for: whether a setting passed at submit time was applied, and which jar versions are on the classpath when there is a class conflict.
Executors tab
The Executors tab lists every executor, including the driver, with its memory, disk, cores, storage memory used for cached data, task counts, shuffle totals and GC time. Each row has Thread Dump, Heap Histogram and Flame Graph links that open live data for that executor, and stderr and stdout links to its logs.[2]
What to look for: executors with high GC time, a few executors that ran most of the tasks, and executors that were lost (see Executor).
SQL tab
The SQL tab, sometimes called the SQL / DataFrame tab, lists every SQL query and every DataFrame action that triggered execution, not only queries written as SQL strings.[2] Each query has a graph of its physical operators with their metrics, and a detail page with the parsed, analyzed and optimized logical plans and the physical plan.
The operator metrics are the most direct view of what a query did. Examples include number of output rows on filters and joins, data size on exchanges, shuffle bytes written on a shuffle exchange, spill size on sorts and hash aggregates, and the file and partition counts on scans.[2]
What to look for: an unexpected Exchange, a scan that read many more files or partitions than the filter should allow (see Partition pruning), and a join whose output row count is far larger than its inputs.
Other tabs
- Structured Streaming appears when micro-batch streaming queries run. It shows input rate, process rate, batch duration, operation durations, watermark gap and state store metrics for each query.[2]
- Streaming (DStreams) appears for applications that use the legacy DStream API.[2]
- JDBC/ODBC Server appears when Spark runs as a distributed SQL engine through the Thrift server.[2]
How much history does the Spark UI keep?
The live UI keeps a bounded amount of history in driver memory. By default it remembers 1000 jobs (spark.ui.retainedJobs), 1000 stages (spark.ui.retainedStages), 100000 tasks per stage (spark.ui.retainedTasks) and 1000 finished SQL executions (spark.sql.ui.retainedExecutions).[4][5] Older entries are garbage collected, so a long-running application loses its early history from the live UI.
To see an application after it ends, set spark.eventLog.enabled to true before starting it, and read the logs with the Spark History Server.[3]
See also
References
- ↑ 1.0 1.1 1.2 config/UI.scala (v4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ 2.00 2.01 2.02 2.03 2.04 2.05 2.06 2.07 2.08 2.09 2.10 2.11 2.12 2.13 2.14 Web UI (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ 3.0 3.1 Monitoring and Instrumentation (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ config/Status.scala (v4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
- ↑ Spark Configuration (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-23.