<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Executor</id>
	<title>Executor - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=Executor"/>
	<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Executor&amp;action=history"/>
	<updated>2026-12-06T00:07:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://openlakehouse.io/w/index.php?title=Executor&amp;diff=66&amp;oldid=prev</id>
		<title>Open Lakehouse Wiki sync: Sync from open-lakehouse/wiki@9783fe6</title>
		<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=Executor&amp;diff=66&amp;oldid=prev"/>
		<updated>2026-11-22T21:29:53Z</updated>

		<summary type="html">&lt;p&gt;Sync from open-lakehouse/wiki@9783fe6&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox concept&lt;br /&gt;
| name            = Executor&lt;br /&gt;
| also_known_as   = Spark executor&lt;br /&gt;
| field           = Distributed data processing&lt;br /&gt;
| key_parts       = Task slots (cores), execution memory, storage memory, local disk for shuffle files&lt;br /&gt;
| implementations = [[Apache Spark]]&lt;br /&gt;
| related         = [[Shuffle]], [[Partition]], [[Trino]], [[Apache Flink]]&lt;br /&gt;
}}&lt;br /&gt;
{{Verified|2026-11-22|the v4.3.0 tag of apache/spark (docs/cluster-overview.md, docs/configuration.md, docs/tuning.md, docs/job-scheduling.md, docs/running-on-kubernetes.md), the Trino 484 concepts page and the Apache Flink 2.3 architecture page}}&lt;br /&gt;
&lt;br /&gt;
In [[Apache Spark]], an &amp;#039;&amp;#039;&amp;#039;executor&amp;#039;&amp;#039;&amp;#039; is a process launched for one application on a worker node; it runs the application&amp;#039;s tasks and keeps data in memory or on disk between them.&amp;lt;ref name=&amp;quot;cluster&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/cluster-overview.html |title=Cluster Mode Overview (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; The driver plans the work and the executors do it. The same word appears in other engines with a different meaning, so this page also compares the Spark executor with a [[Trino]] worker, an [[Apache Flink]] TaskManager and a Kubernetes pod.&lt;br /&gt;
&lt;br /&gt;
== What an executor runs ==&lt;br /&gt;
A Spark executor runs &amp;#039;&amp;#039;&amp;#039;tasks&amp;#039;&amp;#039;&amp;#039;. A task is the unit of work that the driver sends to one executor, and each task processes one [[partition]] of a dataset.&amp;lt;ref name=&amp;quot;cluster&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;rddguide&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/rdd-programming-guide.html |title=RDD Programming Guide (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; Spark divides each job into stages, and every task in a stage applies the same function to a different partition.&amp;lt;ref name=&amp;quot;dag&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala |title=DAGScheduler.scala (v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An executor runs several tasks at the same time, each in its own thread inside the executor process.&amp;lt;ref name=&amp;quot;cluster&amp;quot; /&amp;gt; Besides running tasks, the executor stores cached data and writes the shuffle files that later stages read; it also serves those files to other executors unless an external shuffle service does that work.&amp;lt;ref name=&amp;quot;jobsched&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/job-scheduling.html |title=Job Scheduling (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cores and task slots ==&lt;br /&gt;
The number of tasks an executor can run at once is set by its cores. &amp;lt;code&amp;gt;spark.executor.cores&amp;lt;/code&amp;gt; sets the cores per executor; its default is 1 on YARN and all available cores of the worker in standalone mode. &amp;lt;code&amp;gt;spark.task.cpus&amp;lt;/code&amp;gt; (default 1) sets the cores each task needs, and the number of concurrent tasks on an executor is &amp;lt;code&amp;gt;floor(executor cores / spark.task.cpus)&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;config&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/configuration.html |title=Spark Configuration (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; These concurrent places for tasks are often called task slots.&lt;br /&gt;
&lt;br /&gt;
A stage with more partitions than free slots runs in waves: when a task finishes, the slot takes the next pending task. If a task fails, Spark retries it; &amp;lt;code&amp;gt;spark.task.maxFailures&amp;lt;/code&amp;gt; (default 4) is the number of consecutive failures of one task before the job fails.&amp;lt;ref name=&amp;quot;config&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Memory ==&lt;br /&gt;
Each executor is a JVM process. &amp;lt;code&amp;gt;spark.executor.memory&amp;lt;/code&amp;gt; (default &amp;lt;code&amp;gt;1g&amp;lt;/code&amp;gt;) sets its heap. On YARN and Kubernetes, Spark also requests non-heap overhead memory, &amp;lt;code&amp;gt;spark.executor.memoryOverhead&amp;lt;/code&amp;gt;, which by default is the executor memory multiplied by &amp;lt;code&amp;gt;spark.executor.memoryOverheadFactor&amp;lt;/code&amp;gt; (0.10), with a minimum of 384 MiB. The container size is the sum of executor memory, overhead, off-heap memory and PySpark memory.&amp;lt;ref name=&amp;quot;config&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Inside the heap, Spark uses a unified memory region for two purposes. &amp;#039;&amp;#039;&amp;#039;Execution memory&amp;#039;&amp;#039;&amp;#039; holds data for shuffles, joins, sorts and aggregations; &amp;#039;&amp;#039;&amp;#039;storage memory&amp;#039;&amp;#039;&amp;#039; holds cached data. &amp;lt;code&amp;gt;spark.memory.fraction&amp;lt;/code&amp;gt; (default 0.6) sets the size of this region as a fraction of the heap minus 300 MiB, and the rest is left for user data structures and Spark metadata. Execution can evict cached blocks, but only down to the share set by &amp;lt;code&amp;gt;spark.memory.storageFraction&amp;lt;/code&amp;gt; (default 0.5).&amp;lt;ref name=&amp;quot;tuning&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/tuning.html |title=Tuning Spark (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; When execution data does not fit, Spark spills it to local disk.&amp;lt;ref name=&amp;quot;rddguide&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lifetime and relation to the driver ==&lt;br /&gt;
Each Spark application gets its own executors. Without dynamic allocation they stay up for the whole application, and tasks from different applications never share a JVM. Two applications therefore cannot share in-memory data except through external storage.&amp;lt;ref name=&amp;quot;cluster&amp;quot; /&amp;gt; The driver must stay reachable from the executors for its whole lifetime, and executors send heartbeats to it, by default every 10 seconds, so that it knows they are alive.&amp;lt;ref name=&amp;quot;cluster&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;config&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Dynamic allocation ==&lt;br /&gt;
With dynamic resource allocation, Spark adds executors when tasks are waiting and removes executors that are idle. It is off by default (&amp;lt;code&amp;gt;spark.dynamicAllocation.enabled&amp;lt;/code&amp;gt;) and works on standalone, YARN and Kubernetes.&amp;lt;ref name=&amp;quot;jobsched&amp;quot; /&amp;gt; Spark requests executors in rounds that grow exponentially (1, 2, 4, 8 and so on), and removes an executor after it has been idle for &amp;lt;code&amp;gt;spark.dynamicAllocation.executorIdleTimeout&amp;lt;/code&amp;gt; (default 60 seconds). Executors that hold cached data are kept by default, because &amp;lt;code&amp;gt;spark.dynamicAllocation.cachedExecutorIdleTimeout&amp;lt;/code&amp;gt; defaults to infinity.&amp;lt;ref name=&amp;quot;jobsched&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;config&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removing an executor would lose the shuffle files it wrote. Dynamic allocation therefore needs one way to keep them: an external shuffle service, shuffle tracking (&amp;lt;code&amp;gt;spark.dynamicAllocation.shuffleTracking.enabled&amp;lt;/code&amp;gt;, default true), shuffle block migration during decommissioning, or a shuffle storage plugin. Spark on Kubernetes does not support the external shuffle service.&amp;lt;ref name=&amp;quot;jobsched&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;config&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Spark executor compared with similar terms ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! !! Spark executor !! Trino worker !! Flink TaskManager !! Kubernetes pod running an executor&lt;br /&gt;
|-&lt;br /&gt;
! What it is&lt;br /&gt;
| A process started for one Spark application&amp;lt;ref name=&amp;quot;cluster&amp;quot; /&amp;gt;&lt;br /&gt;
| A server in a Trino cluster that runs tasks and processes data&amp;lt;ref name=&amp;quot;trino&amp;quot;&amp;gt;{{Cite web |url=https://trino.io/docs/current/overview/concepts.html |title=Trino concepts (Trino 484) |publisher=Trino Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| A JVM process that runs the subtasks of a dataflow and buffers and exchanges data streams&amp;lt;ref name=&amp;quot;flink&amp;quot;&amp;gt;{{Cite web |url=https://nightlies.apache.org/flink/flink-docs-stable/docs/concepts/flink-architecture/ |title=Flink Architecture (Apache Flink 2.3) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| A Kubernetes pod that contains one executor container&amp;lt;ref name=&amp;quot;k8s&amp;quot;&amp;gt;{{Cite web |url=https://spark.apache.org/docs/4.3.0/running-on-kubernetes.html |title=Running Spark on Kubernetes (Spark 4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Coordinated by&lt;br /&gt;
| The application&amp;#039;s driver&lt;br /&gt;
| The coordinator, which parses and plans queries&amp;lt;ref name=&amp;quot;trino&amp;quot; /&amp;gt;&lt;br /&gt;
| The JobManager&amp;lt;ref name=&amp;quot;flink&amp;quot; /&amp;gt;&lt;br /&gt;
| The Spark driver, through the Kubernetes API&amp;lt;ref name=&amp;quot;k8s&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Unit of concurrency&lt;br /&gt;
| Task slots (executor cores divided by task CPUs)&lt;br /&gt;
| Tasks, which run drivers over splits&amp;lt;ref name=&amp;quot;trino&amp;quot; /&amp;gt;&lt;br /&gt;
| Task slots; each slot is a fixed share of managed memory, with no CPU isolation&amp;lt;ref name=&amp;quot;flink&amp;quot; /&amp;gt;&lt;br /&gt;
| Same as the executor inside it; the pod CPU request does not change task concurrency&amp;lt;ref name=&amp;quot;k8s&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Shared between applications or queries?&lt;br /&gt;
| No; only the jobs of one application use it&lt;br /&gt;
| Yes; workers are servers of the cluster, and each query may use up to &amp;lt;code&amp;gt;query.max-memory-per-node&amp;lt;/code&amp;gt; of user memory on a worker&amp;lt;ref name=&amp;quot;trino&amp;quot; /&amp;gt;&amp;lt;ref&amp;gt;{{Cite web |url=https://trino.io/docs/current/admin/properties-resource-management.html |title=Resource management properties (Trino 484) |publisher=Trino Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| In a session cluster, jobs share the cluster; in an application cluster, only one application&amp;#039;s jobs run&amp;lt;ref name=&amp;quot;flink&amp;quot; /&amp;gt;&lt;br /&gt;
| No; the pod ends when the executor ends&lt;br /&gt;
|-&lt;br /&gt;
! Lifetime&lt;br /&gt;
| The application, or shorter with dynamic allocation&lt;br /&gt;
| The Trino cluster&lt;br /&gt;
| The Flink cluster (session) or the application (application cluster)&amp;lt;ref name=&amp;quot;flink&amp;quot; /&amp;gt;&lt;br /&gt;
| The executor; pods are cleaned up when the application completes&amp;lt;ref name=&amp;quot;k8s&amp;quot; /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A Flink task slot and a Spark task slot are close but not the same. A Flink slot reserves a fixed share of a TaskManager&amp;#039;s managed memory, and by default subtasks of the same job can share a slot.&amp;lt;ref name=&amp;quot;flink&amp;quot; /&amp;gt; A Spark slot is a share of an executor&amp;#039;s cores; all tasks on an executor draw on one unified memory pool.&amp;lt;ref name=&amp;quot;tuning&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Kubernetes, the pod and the executor are two layers. The pod&amp;#039;s memory request and limit are the sum of &amp;lt;code&amp;gt;spark.executor.memory&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;spark.executor.memoryOverhead&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;spark.kubernetes.executor.request.cores&amp;lt;/code&amp;gt; can set the pod&amp;#039;s CPU request apart from &amp;lt;code&amp;gt;spark.executor.cores&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;k8s&amp;quot; /&amp;gt; Shuffle and spill files go to &amp;lt;code&amp;gt;emptyDir&amp;lt;/code&amp;gt; volumes by default, which do not outlive the pod.&amp;lt;ref name=&amp;quot;k8s&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
A configuration for executors with four task slots each, scaled by dynamic allocation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
spark.executor.cores                             4&lt;br /&gt;
spark.executor.memory                            8g&lt;br /&gt;
spark.dynamicAllocation.enabled                  true&lt;br /&gt;
spark.dynamicAllocation.shuffleTracking.enabled  true&lt;br /&gt;
spark.dynamicAllocation.minExecutors             1&lt;br /&gt;
spark.dynamicAllocation.maxExecutors             20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Apache Spark]]&lt;br /&gt;
* [[Shuffle]]&lt;br /&gt;
* [[Partition]]&lt;br /&gt;
* [[Spark Connect]]&lt;br /&gt;
* [[Trino]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Navbox open lakehouse}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Concepts]]&lt;br /&gt;
[[Category:Glossary terms]]&lt;br /&gt;
[[Category:Apache Spark]]&lt;/div&gt;</summary>
		<author><name>Open Lakehouse Wiki sync</name></author>
	</entry>
</feed>