2012-09-03 02:05:40 -04:00
---
layout: global
title: Spark Configuration
---
2013-12-30 22:17:28 -05:00
Spark provides three locations to configure the system:
2012-09-26 22:17:58 -04:00
2013-12-30 22:17:28 -05:00
* [Spark properties ](#spark-properties ) control most application parameters and can be set by passing
a [SparkConf ](api/core/index.html#org.apache.spark.SparkConf ) object to SparkContext, or through Java
system properties.
* [Environment variables ](#environment-variables ) can be used to set per-machine settings, such as
the IP address, through the `conf/spark-env.sh` script on each node.
* [Logging ](#configuring-logging ) can be configured through `log4j.properties` .
2012-09-26 22:17:58 -04:00
2013-12-30 22:17:28 -05:00
# Spark Properties
2012-09-26 22:17:58 -04:00
2013-12-30 22:17:28 -05:00
Spark properties control most application settings and are configured separately for each application.
The preferred way to set them is by passing a [SparkConf ](api/core/index.html#org.apache.spark.SparkConf )
class to your SparkContext constructor.
2014-01-18 19:17:34 -05:00
Alternatively, Spark will also load them from Java system properties, for compatibility with old versions
of Spark.
2013-12-30 22:17:28 -05:00
SparkConf lets you configure most of the common properties to initialize a cluster (e.g., master URL and
application name), as well as arbitrary key-value pairs through the `set()` method. For example, we could
initialize an application as follows:
2012-09-26 22:17:58 -04:00
{% highlight scala %}
2013-12-30 22:17:28 -05:00
val conf = new SparkConf()
.setMaster("local")
.setAppName("My application")
.set("spark.executor.memory", "1g")
val sc = new SparkContext(conf)
2012-09-26 22:17:58 -04:00
{% endhighlight %}
2013-12-30 22:17:28 -05:00
Most of the properties control internal settings that have reasonable default values. However,
2013-06-30 18:38:58 -04:00
there are at least five properties that you will commonly want to control:
2012-09-26 22:17:58 -04:00
< table class = "table" >
< tr > < th > Property Name< / th > < th > Default< / th > < th > Meaning< / th > < / tr >
2013-06-30 18:38:58 -04:00
< tr >
< td > spark.executor.memory< / td >
< td > 512m< / td >
< td >
2013-08-31 17:21:10 -04:00
Amount of memory to use per executor process, in the same format as JVM memory strings (e.g. < code > 512m< / code > , < code > 2g< / code > ).
2013-06-30 18:38:58 -04:00
< / td >
< / tr >
2012-09-26 22:17:58 -04:00
< tr >
< td > spark.serializer< / td >
2013-09-01 03:32:28 -04:00
< td > org.apache.spark.serializer.< br / > JavaSerializer< / td >
2012-09-26 22:17:58 -04:00
< td >
Class to use for serializing objects that will be sent over the network or need to be cached
in serialized form. The default of Java serialization works with any Serializable Java object but is
2013-09-01 03:32:28 -04:00
quite slow, so we recommend < a href = "tuning.html" > using < code > org.apache.spark.serializer.KryoSerializer< / code >
2013-07-30 20:12:16 -04:00
and configuring Kryo serialization< / a > when speed is necessary. Can be any subclass of
2013-09-01 03:32:28 -04:00
< a href = "api/core/index.html#org.apache.spark.serializer.Serializer" > < code > org.apache.spark.Serializer< / code > < / a > .
2012-09-26 22:17:58 -04:00
< / td >
< / tr >
< tr >
< td > spark.kryo.registrator< / td >
< td > (none)< / td >
< td >
If you use Kryo serialization, set this class to register your custom classes with Kryo.
2013-09-01 01:17:40 -04:00
It should be set to a class that extends
2013-09-01 03:32:28 -04:00
< a href = "api/core/index.html#org.apache.spark.serializer.KryoRegistrator" > < code > KryoRegistrator< / code > < / a > .
2012-10-08 13:13:26 -04:00
See the < a href = "tuning.html#data-serialization" > tuning guide< / a > for more details.
2012-09-26 22:17:58 -04:00
< / td >
< / tr >
< tr >
< td > spark.local.dir< / td >
< td > /tmp< / td >
< td >
Directory to use for "scratch" space in Spark, including map output files and RDDs that get stored
2012-10-01 18:20:42 -04:00
on disk. This should be on a fast, local disk in your system. It can also be a comma-separated
2013-08-31 17:21:10 -04:00
list of multiple directories on different disks.
2014-04-21 13:26:33 -04:00
NOTE: In Spark 1.0 and later this will be overriden by SPARK_LOCAL_DIRS (Standalone, Mesos) or
LOCAL_DIRS (YARN) envrionment variables set by the cluster manager.
2012-09-26 22:17:58 -04:00
< / td >
< / tr >
< tr >
< td > spark.cores.max< / td >
2014-01-07 14:35:52 -05:00
< td > (not set)< / td >
2012-09-26 22:17:58 -04:00
< td >
2012-10-08 13:13:26 -04:00
When running on a < a href = "spark-standalone.html" > standalone deploy cluster< / a > or a
< a href = "running-on-mesos.html#mesos-run-modes" > Mesos cluster in "coarse-grained"
2014-01-06 12:01:46 -05:00
sharing mode< / a > , the maximum amount of CPU cores to request for the application from
2014-01-07 14:35:52 -05:00
across the cluster (not from each machine). If not set, the default will be
< code > spark.deploy.defaultCores< / code > on Spark's standalone cluster manager, or
infinite (all available cores) on Mesos.
2012-09-26 22:17:58 -04:00
< / td >
< / tr >
< / table >
Apart from these, the following properties are also available, and may be useful in some situations:
< table class = "table" >
< tr > < th > Property Name< / th > < th > Default< / th > < th > Meaning< / th > < / tr >
< tr >
< td > spark.default.parallelism< / td >
2014-04-16 12:14:18 -04:00
< td >
< ul >
< li > Mesos fine grained mode: 8< / li >
< li > Local mode: core number of the local machine< / li >
< li > Others: total core number of all executor nodes or 2, whichever is larger< / li >
< / ul >
< / td >
2012-09-26 22:17:58 -04:00
< td >
2014-01-21 17:49:35 -05:00
Default number of tasks to use across the cluster for distributed shuffle operations (< code > groupByKey< / code > ,
2012-09-26 22:17:58 -04:00
< code > reduceByKey< / code > , etc) when not set by user.
< / td >
< / tr >
2012-09-27 21:45:44 -04:00
< tr >
2012-10-07 14:30:53 -04:00
< td > spark.storage.memoryFraction< / td >
2014-01-10 18:09:51 -05:00
< td > 0.6< / td >
2012-09-27 21:45:44 -04:00
< td >
2012-10-07 14:30:53 -04:00
Fraction of Java heap to use for Spark's memory cache. This should not be larger than the "old"
2014-01-10 18:09:51 -05:00
generation of objects in the JVM, which by default is given 0.6 of the heap, but you can increase
2012-10-07 14:30:53 -04:00
it if you configure your own old generation size.
< / td >
< / tr >
2014-01-10 18:09:51 -05:00
< tr >
< td > spark.shuffle.memoryFraction< / td >
< td > 0.3< / td >
< td >
Fraction of Java heap to use for aggregation and cogroups during shuffles, if
2014-01-13 16:24:04 -05:00
< code > spark.shuffle.spill< / code > is true. At any given time, the collective size of
2014-01-10 18:09:51 -05:00
all in-memory maps used for shuffles is bounded by this limit, beyond which the contents will
begin to spill to disk. If spills are often, consider increasing this value at the expense of
< code > spark.storage.memoryFraction< / code > .
< / td >
< / tr >
2014-04-04 23:36:24 -04:00
< tr >
< td > spark.tachyonStore.baseDir< / td >
< td > System.getProperty("java.io.tmpdir")< / td >
< td >
Directories of the Tachyon File System that store RDDs. The Tachyon file system's URL is set by < code > spark.tachyonStore.url< / code > .
It can also be a comma-separated list of multiple directories on Tachyon file system.
< / td >
< / tr >
< tr >
< td > spark.tachyonStore.url< / td >
< td > tachyon://localhost:19998< / td >
< td >
The URL of the underlying Tachyon file system in the TachyonStore.
< / td >
< / tr >
2013-09-06 00:29:37 -04:00
< tr >
< td > spark.mesos.coarse< / td >
< td > false< / td >
< td >
If set to "true", runs over Mesos clusters in
< a href = "running-on-mesos.html#mesos-run-modes" > "coarse-grained" sharing mode< / a > ,
where Spark acquires one long-lived Mesos task on each machine instead of one Mesos task per Spark task.
This gives lower-latency scheduling for short queries, but leaves resources in use for the whole
duration of the Spark job.
< / td >
< / tr >
2013-02-27 01:52:38 -05:00
< tr >
< td > spark.ui.port< / td >
2013-09-11 02:12:27 -04:00
< td > 4040< / td >
2013-02-27 01:52:38 -05:00
< td >
2013-06-26 11:54:57 -04:00
Port for your application's dashboard, which shows memory and workload data
< / td >
< / tr >
< tr >
2014-01-09 00:16:16 -05:00
< td > spark.ui.retainedStages< / td >
2013-06-26 11:54:57 -04:00
< td > 1000< / td >
< td >
How many stages the Spark UI remembers before garbage collecting.
2013-02-27 01:52:38 -05:00
< / td >
< / tr >
2014-03-09 14:57:06 -04:00
< tr >
SPARK-1189: Add Security to Spark - Akka, Http, ConnectionManager, UI use servlets
resubmit pull request. was https://github.com/apache/incubator-spark/pull/332.
Author: Thomas Graves <tgraves@apache.org>
Closes #33 from tgravescs/security-branch-0.9-with-client-rebase and squashes the following commits:
dfe3918 [Thomas Graves] Fix merge conflict since startUserClass now using runAsUser
05eebed [Thomas Graves] Fix dependency lost in upmerge
d1040ec [Thomas Graves] Fix up various imports
05ff5e0 [Thomas Graves] Fix up imports after upmerging to master
ac046b3 [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase
13733e1 [Thomas Graves] Pass securityManager and SparkConf around where we can. Switch to use sparkConf for reading config whereever possible. Added ConnectionManagerSuite unit tests.
4a57acc [Thomas Graves] Change UI createHandler routines to createServlet since they now return servlets
2f77147 [Thomas Graves] Rework from comments
50dd9f2 [Thomas Graves] fix header in SecurityManager
ecbfb65 [Thomas Graves] Fix spacing and formatting
b514bec [Thomas Graves] Fix reference to config
ed3d1c1 [Thomas Graves] Add security.md
6f7ddf3 [Thomas Graves] Convert SaslClient and SaslServer to scala, change spark.authenticate.ui to spark.ui.acls.enable, and fix up various other things from review comments
2d9e23e [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase_rework
5721c5a [Thomas Graves] update AkkaUtilsSuite test for the actorSelection changes, fix typos based on comments, and remove extra lines I missed in rebase from AkkaUtils
f351763 [Thomas Graves] Add Security to Spark - Akka, Http, ConnectionManager, UI to use servlets
2014-03-06 19:27:50 -05:00
< td > spark.ui.filters< / td >
< td > None< / td >
< td >
Comma separated list of filter class names to apply to the Spark web ui. The filter should be a
standard javax servlet Filter. Parameters to each filter can also be specified by setting a
2014-03-09 14:57:06 -04:00
java system property of spark.< class name of filter> .params='param1=value1,param2=value2'
SPARK-1189: Add Security to Spark - Akka, Http, ConnectionManager, UI use servlets
resubmit pull request. was https://github.com/apache/incubator-spark/pull/332.
Author: Thomas Graves <tgraves@apache.org>
Closes #33 from tgravescs/security-branch-0.9-with-client-rebase and squashes the following commits:
dfe3918 [Thomas Graves] Fix merge conflict since startUserClass now using runAsUser
05eebed [Thomas Graves] Fix dependency lost in upmerge
d1040ec [Thomas Graves] Fix up various imports
05ff5e0 [Thomas Graves] Fix up imports after upmerging to master
ac046b3 [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase
13733e1 [Thomas Graves] Pass securityManager and SparkConf around where we can. Switch to use sparkConf for reading config whereever possible. Added ConnectionManagerSuite unit tests.
4a57acc [Thomas Graves] Change UI createHandler routines to createServlet since they now return servlets
2f77147 [Thomas Graves] Rework from comments
50dd9f2 [Thomas Graves] fix header in SecurityManager
ecbfb65 [Thomas Graves] Fix spacing and formatting
b514bec [Thomas Graves] Fix reference to config
ed3d1c1 [Thomas Graves] Add security.md
6f7ddf3 [Thomas Graves] Convert SaslClient and SaslServer to scala, change spark.authenticate.ui to spark.ui.acls.enable, and fix up various other things from review comments
2d9e23e [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase_rework
5721c5a [Thomas Graves] update AkkaUtilsSuite test for the actorSelection changes, fix typos based on comments, and remove extra lines I missed in rebase from AkkaUtils
f351763 [Thomas Graves] Add Security to Spark - Akka, Http, ConnectionManager, UI to use servlets
2014-03-06 19:27:50 -05:00
(e.g.-Dspark.ui.filters=com.test.filter1 -Dspark.com.test.filter1.params='param1=foo,param2=testing')
< / td >
< / tr >
< tr >
< td > spark.ui.acls.enable< / td >
< td > false< / td >
< td >
2014-04-04 23:36:24 -04:00
Whether spark web ui acls should are enabled. If enabled, this checks to see if the user has
SPARK-1189: Add Security to Spark - Akka, Http, ConnectionManager, UI use servlets
resubmit pull request. was https://github.com/apache/incubator-spark/pull/332.
Author: Thomas Graves <tgraves@apache.org>
Closes #33 from tgravescs/security-branch-0.9-with-client-rebase and squashes the following commits:
dfe3918 [Thomas Graves] Fix merge conflict since startUserClass now using runAsUser
05eebed [Thomas Graves] Fix dependency lost in upmerge
d1040ec [Thomas Graves] Fix up various imports
05ff5e0 [Thomas Graves] Fix up imports after upmerging to master
ac046b3 [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase
13733e1 [Thomas Graves] Pass securityManager and SparkConf around where we can. Switch to use sparkConf for reading config whereever possible. Added ConnectionManagerSuite unit tests.
4a57acc [Thomas Graves] Change UI createHandler routines to createServlet since they now return servlets
2f77147 [Thomas Graves] Rework from comments
50dd9f2 [Thomas Graves] fix header in SecurityManager
ecbfb65 [Thomas Graves] Fix spacing and formatting
b514bec [Thomas Graves] Fix reference to config
ed3d1c1 [Thomas Graves] Add security.md
6f7ddf3 [Thomas Graves] Convert SaslClient and SaslServer to scala, change spark.authenticate.ui to spark.ui.acls.enable, and fix up various other things from review comments
2d9e23e [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase_rework
5721c5a [Thomas Graves] update AkkaUtilsSuite test for the actorSelection changes, fix typos based on comments, and remove extra lines I missed in rebase from AkkaUtils
f351763 [Thomas Graves] Add Security to Spark - Akka, Http, ConnectionManager, UI to use servlets
2014-03-06 19:27:50 -05:00
access permissions to view the web ui. See < code > spark.ui.view.acls< / code > for more details.
Also note this requires the user to be known, if the user comes across as null no checks
are done. Filters can be used to authenticate and set the user.
< / td >
< / tr >
2014-04-04 23:36:24 -04:00
< tr >
SPARK-1189: Add Security to Spark - Akka, Http, ConnectionManager, UI use servlets
resubmit pull request. was https://github.com/apache/incubator-spark/pull/332.
Author: Thomas Graves <tgraves@apache.org>
Closes #33 from tgravescs/security-branch-0.9-with-client-rebase and squashes the following commits:
dfe3918 [Thomas Graves] Fix merge conflict since startUserClass now using runAsUser
05eebed [Thomas Graves] Fix dependency lost in upmerge
d1040ec [Thomas Graves] Fix up various imports
05ff5e0 [Thomas Graves] Fix up imports after upmerging to master
ac046b3 [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase
13733e1 [Thomas Graves] Pass securityManager and SparkConf around where we can. Switch to use sparkConf for reading config whereever possible. Added ConnectionManagerSuite unit tests.
4a57acc [Thomas Graves] Change UI createHandler routines to createServlet since they now return servlets
2f77147 [Thomas Graves] Rework from comments
50dd9f2 [Thomas Graves] fix header in SecurityManager
ecbfb65 [Thomas Graves] Fix spacing and formatting
b514bec [Thomas Graves] Fix reference to config
ed3d1c1 [Thomas Graves] Add security.md
6f7ddf3 [Thomas Graves] Convert SaslClient and SaslServer to scala, change spark.authenticate.ui to spark.ui.acls.enable, and fix up various other things from review comments
2d9e23e [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase_rework
5721c5a [Thomas Graves] update AkkaUtilsSuite test for the actorSelection changes, fix typos based on comments, and remove extra lines I missed in rebase from AkkaUtils
f351763 [Thomas Graves] Add Security to Spark - Akka, Http, ConnectionManager, UI to use servlets
2014-03-06 19:27:50 -05:00
< td > spark.ui.view.acls< / td >
< td > Empty< / td >
< td >
Comma separated list of users that have view access to the spark web ui. By default only the
user that started the Spark job has view access.
< / td >
< / tr >
2014-04-10 20:10:11 -04:00
< tr >
< td > spark.ui.killEnabled< / td >
< td > true< / td >
< td >
Allows stages and corresponding jobs to be killed from the web ui.
< / td >
< / tr >
2012-10-07 14:30:53 -04:00
< tr >
< td > spark.shuffle.compress< / td >
< td > true< / td >
< td >
Whether to compress map output files. Generally a good idea.
2012-09-27 21:45:44 -04:00
< / td >
< / tr >
2014-01-13 14:30:09 -05:00
< tr >
2014-01-13 16:24:04 -05:00
< td > spark.shuffle.spill.compress< / td >
2014-01-14 02:25:25 -05:00
< td > true< / td >
2014-01-13 14:30:09 -05:00
< td >
2014-02-07 01:05:53 -05:00
Whether to compress data spilled during shuffles.
2014-01-13 14:30:09 -05:00
< / td >
< / tr >
2012-09-27 21:45:44 -04:00
< tr >
< td > spark.broadcast.compress< / td >
2012-10-07 14:30:53 -04:00
< td > true< / td >
2012-09-27 21:45:44 -04:00
< td >
2012-10-07 14:30:53 -04:00
Whether to compress broadcast variables before sending them. Generally a good idea.
2012-09-27 21:45:44 -04:00
< / td >
< / tr >
2012-09-26 22:17:58 -04:00
< tr >
2012-10-07 14:30:53 -04:00
< td > spark.rdd.compress< / td >
< td > false< / td >
2012-09-26 22:17:58 -04:00
< td >
2012-10-07 14:30:53 -04:00
Whether to compress serialized RDD partitions (e.g. for < code > StorageLevel.MEMORY_ONLY_SER< / code > ).
Can save substantial space at the cost of some extra CPU time.
2012-09-26 22:17:58 -04:00
< / td >
< / tr >
2013-07-30 20:12:16 -04:00
< tr >
< td > spark.io.compression.codec< / td >
2013-09-02 13:15:22 -04:00
< td > org.apache.spark.io.< br / > LZFCompressionCodec< / td >
2013-07-30 20:12:16 -04:00
< td >
2013-10-19 02:08:44 -04:00
The codec used to compress internal data such as RDD partitions and shuffle outputs. By default, Spark provides two
2013-09-01 01:17:40 -04:00
codecs: < code > org.apache.spark.io.LZFCompressionCodec< / code > and < code > org.apache.spark.io.SnappyCompressionCodec< / code > .
2013-07-30 20:12:16 -04:00
< / td >
< / tr >
< tr >
< td > spark.io.compression.snappy.block.size< / td >
< td > 32768< / td >
< td >
Block size (in bytes) used in Snappy compression, in the case when Snappy compression codec is used.
< / td >
< / tr >
2013-09-06 00:29:37 -04:00
< tr >
< td > spark.scheduler.mode< / td >
< td > FIFO< / td >
< td >
The < a href = "job-scheduling.html#scheduling-within-an-application" > scheduling mode< / a > between
jobs submitted to the same SparkContext. Can be set to < code > FAIR< / code >
to use fair sharing instead of queueing jobs one after another. Useful for
multi-user services.
< / td >
< / tr >
2014-03-04 13:28:17 -05:00
< tr >
< td > spark.scheduler.revive.interval< / td >
< td > 1000< / td >
< td >
The interval length for the scheduler to revive the worker resource offers to run tasks. (in milliseconds)
< / td >
< / tr >
2012-09-26 22:17:58 -04:00
< tr >
2012-10-06 23:07:10 -04:00
< td > spark.reducer.maxMbInFlight< / td >
< td > 48< / td >
2012-09-26 22:17:58 -04:00
< td >
2012-10-06 23:07:10 -04:00
Maximum size (in megabytes) of map outputs to fetch simultaneously from each reduce task. Since
each output requires us to create a buffer to receive it, this represents a fixed memory overhead
per reduce task, so keep it small unless you have a large amount of memory.
2012-09-26 22:17:58 -04:00
< / td >
< / tr >
< tr >
< td > spark.closure.serializer< / td >
2013-09-01 03:32:28 -04:00
< td > org.apache.spark.serializer.< br / > JavaSerializer< / td >
2012-09-26 22:17:58 -04:00
< td >
Serializer class to use for closures. Generally Java is fine unless your distributed functions
(e.g. map functions) reference large objects in the driver program.
< / td >
< / tr >
2013-07-14 21:55:54 -04:00
< tr >
< td > spark.kryo.referenceTracking< / td >
< td > true< / td >
< td >
Whether to track references to the same object when serializing data with Kryo, which is
necessary if your object graphs have loops and useful for efficiency if they contain multiple
copies of the same object. Can be disabled to improve performance if you know this is not the
case.
< / td >
< / tr >
2012-09-26 22:17:58 -04:00
< tr >
< td > spark.kryoserializer.buffer.mb< / td >
2013-07-14 21:55:54 -04:00
< td > 2< / td >
2012-09-26 22:17:58 -04:00
< td >
Maximum object size to allow within Kryo (the library needs to create a buffer at least as
large as the largest single object you'll serialize). Increase this if you get a "buffer limit
exceeded" exception inside Kryo. Note that there will be one buffer < i > per core< / i > on each worker.
< / td >
2012-09-27 02:22:15 -04:00
< / tr >
SPARK-942: Do not materialize partitions when DISK_ONLY storage level is used
This is a port of a pull request original targeted at incubator-spark: https://github.com/apache/incubator-spark/pull/180
Essentially if a user returns a generative iterator (from a flatMap operation), when trying to persist the data, Spark would first unroll the iterator into an ArrayBuffer, and then try to figure out if it could store the data. In cases where the user provided an iterator that generated more data then available memory, this would case a crash. With this patch, if the user requests a persist with a 'StorageLevel.DISK_ONLY', the iterator will be unrolled as it is inputed into the serializer.
To do this, two changes where made:
1) The type of the 'values' argument in the putValues method of the BlockStore interface was changed from ArrayBuffer to Iterator (and all code interfacing with this method was modified to connect correctly.
2) The JavaSerializer now calls the ObjectOutputStream 'reset' method every 1000 objects. This was done because the ObjectOutputStream caches objects (thus preventing them from being GC'd) to write more compact serialization. If reset is never called, eventually the memory fills up, if it is called too often then the serialization streams become much larger because of redundant class descriptions.
Author: Kyle Ellrott <kellrott@gmail.com>
Closes #50 from kellrott/iterator-to-disk and squashes the following commits:
9ef7cb8 [Kyle Ellrott] Fixing formatting issues.
60e0c57 [Kyle Ellrott] Fixing issues (formatting, variable names, etc.) from review comments
8aa31cd [Kyle Ellrott] Merge ../incubator-spark into iterator-to-disk
33ac390 [Kyle Ellrott] Merge branch 'iterator-to-disk' of github.com:kellrott/incubator-spark into iterator-to-disk
2f684ea [Kyle Ellrott] Refactoring the BlockManager to replace the Either[Either[A,B]] usage. Now using trait 'Values'. Also modified BlockStore.putBytes call to return PutResult, so that it behaves like putValues.
f70d069 [Kyle Ellrott] Adding docs for spark.serializer.objectStreamReset configuration
7ccc74b [Kyle Ellrott] Moving the 'LargeIteratorSuite' to simply test persistance of iterators. It doesn't try to invoke a OOM error any more
16a4cea [Kyle Ellrott] Streamlined the LargeIteratorSuite unit test. It should now run in ~25 seconds. Confirmed that it still crashes an unpatched copy of Spark.
c2fb430 [Kyle Ellrott] Removing more un-needed array-buffer to iterator conversions
627a8b7 [Kyle Ellrott] Wrapping a few long lines
0f28ec7 [Kyle Ellrott] Adding second putValues to BlockStore interface that accepts an ArrayBuffer (rather then an Iterator). This will allow BlockStores to have slightly different behaviors dependent on whether they get an Iterator or ArrayBuffer. In the case of the MemoryStore, it needs to duplicate and cache an Iterator into an ArrayBuffer, but if handed a ArrayBuffer, it can skip the duplication.
656c33e [Kyle Ellrott] Fixing the JavaSerializer to read from the SparkConf rather then the System property.
8644ee8 [Kyle Ellrott] Merge branch 'master' into iterator-to-disk
00c98e0 [Kyle Ellrott] Making the Java ObjectStreamSerializer reset rate configurable by the system variable 'spark.serializer.objectStreamReset', default is not 10000.
40fe1d7 [Kyle Ellrott] Removing rouge space
31fe08e [Kyle Ellrott] Removing un-needed semi-colons
9df0276 [Kyle Ellrott] Added check to make sure that streamed-to-dist RDD actually returns good data in the LargeIteratorSuite
a6424ba [Kyle Ellrott] Wrapping long line
2eeda75 [Kyle Ellrott] Fixing dumb mistake ("||" instead of "&&")
0e6f808 [Kyle Ellrott] Deleting temp output directory when done
95c7f67 [Kyle Ellrott] Simplifying StorageLevel checks
56f71cd [Kyle Ellrott] Merge branch 'master' into iterator-to-disk
44ec35a [Kyle Ellrott] Adding some comments.
5eb2b7e [Kyle Ellrott] Changing the JavaSerializer reset to occur every 1000 objects.
f403826 [Kyle Ellrott] Merge branch 'master' into iterator-to-disk
81d670c [Kyle Ellrott] Adding unit test for straight to disk iterator methods.
d32992f [Kyle Ellrott] Merge remote-tracking branch 'origin/master' into iterator-to-disk
cac1fad [Kyle Ellrott] Fixing MemoryStore, so that it converts incoming iterators to ArrayBuffer objects. This was previously done higher up the stack.
efe1102 [Kyle Ellrott] Changing CacheManager and BlockManager to pass iterators directly to the serializer when a 'DISK_ONLY' persist is called. This is in response to SPARK-942.
2014-03-06 17:51:00 -05:00
< tr >
< td > spark.serializer.objectStreamReset< / td >
< td > 10000< / td >
< td >
2014-04-04 23:36:24 -04:00
When serializing using org.apache.spark.serializer.JavaSerializer, the serializer caches
objects to prevent writing redundant data, however that stops garbage collection of those
objects. By calling 'reset' you flush that info from the serializer, and allow old
objects to be collected. To turn off this periodic reset set it to a value of < = 0.
SPARK-942: Do not materialize partitions when DISK_ONLY storage level is used
This is a port of a pull request original targeted at incubator-spark: https://github.com/apache/incubator-spark/pull/180
Essentially if a user returns a generative iterator (from a flatMap operation), when trying to persist the data, Spark would first unroll the iterator into an ArrayBuffer, and then try to figure out if it could store the data. In cases where the user provided an iterator that generated more data then available memory, this would case a crash. With this patch, if the user requests a persist with a 'StorageLevel.DISK_ONLY', the iterator will be unrolled as it is inputed into the serializer.
To do this, two changes where made:
1) The type of the 'values' argument in the putValues method of the BlockStore interface was changed from ArrayBuffer to Iterator (and all code interfacing with this method was modified to connect correctly.
2) The JavaSerializer now calls the ObjectOutputStream 'reset' method every 1000 objects. This was done because the ObjectOutputStream caches objects (thus preventing them from being GC'd) to write more compact serialization. If reset is never called, eventually the memory fills up, if it is called too often then the serialization streams become much larger because of redundant class descriptions.
Author: Kyle Ellrott <kellrott@gmail.com>
Closes #50 from kellrott/iterator-to-disk and squashes the following commits:
9ef7cb8 [Kyle Ellrott] Fixing formatting issues.
60e0c57 [Kyle Ellrott] Fixing issues (formatting, variable names, etc.) from review comments
8aa31cd [Kyle Ellrott] Merge ../incubator-spark into iterator-to-disk
33ac390 [Kyle Ellrott] Merge branch 'iterator-to-disk' of github.com:kellrott/incubator-spark into iterator-to-disk
2f684ea [Kyle Ellrott] Refactoring the BlockManager to replace the Either[Either[A,B]] usage. Now using trait 'Values'. Also modified BlockStore.putBytes call to return PutResult, so that it behaves like putValues.
f70d069 [Kyle Ellrott] Adding docs for spark.serializer.objectStreamReset configuration
7ccc74b [Kyle Ellrott] Moving the 'LargeIteratorSuite' to simply test persistance of iterators. It doesn't try to invoke a OOM error any more
16a4cea [Kyle Ellrott] Streamlined the LargeIteratorSuite unit test. It should now run in ~25 seconds. Confirmed that it still crashes an unpatched copy of Spark.
c2fb430 [Kyle Ellrott] Removing more un-needed array-buffer to iterator conversions
627a8b7 [Kyle Ellrott] Wrapping a few long lines
0f28ec7 [Kyle Ellrott] Adding second putValues to BlockStore interface that accepts an ArrayBuffer (rather then an Iterator). This will allow BlockStores to have slightly different behaviors dependent on whether they get an Iterator or ArrayBuffer. In the case of the MemoryStore, it needs to duplicate and cache an Iterator into an ArrayBuffer, but if handed a ArrayBuffer, it can skip the duplication.
656c33e [Kyle Ellrott] Fixing the JavaSerializer to read from the SparkConf rather then the System property.
8644ee8 [Kyle Ellrott] Merge branch 'master' into iterator-to-disk
00c98e0 [Kyle Ellrott] Making the Java ObjectStreamSerializer reset rate configurable by the system variable 'spark.serializer.objectStreamReset', default is not 10000.
40fe1d7 [Kyle Ellrott] Removing rouge space
31fe08e [Kyle Ellrott] Removing un-needed semi-colons
9df0276 [Kyle Ellrott] Added check to make sure that streamed-to-dist RDD actually returns good data in the LargeIteratorSuite
a6424ba [Kyle Ellrott] Wrapping long line
2eeda75 [Kyle Ellrott] Fixing dumb mistake ("||" instead of "&&")
0e6f808 [Kyle Ellrott] Deleting temp output directory when done
95c7f67 [Kyle Ellrott] Simplifying StorageLevel checks
56f71cd [Kyle Ellrott] Merge branch 'master' into iterator-to-disk
44ec35a [Kyle Ellrott] Adding some comments.
5eb2b7e [Kyle Ellrott] Changing the JavaSerializer reset to occur every 1000 objects.
f403826 [Kyle Ellrott] Merge branch 'master' into iterator-to-disk
81d670c [Kyle Ellrott] Adding unit test for straight to disk iterator methods.
d32992f [Kyle Ellrott] Merge remote-tracking branch 'origin/master' into iterator-to-disk
cac1fad [Kyle Ellrott] Fixing MemoryStore, so that it converts incoming iterators to ArrayBuffer objects. This was previously done higher up the stack.
efe1102 [Kyle Ellrott] Changing CacheManager and BlockManager to pass iterators directly to the serializer when a 'DISK_ONLY' persist is called. This is in response to SPARK-942.
2014-03-06 17:51:00 -05:00
By default it will reset the serializer every 10,000 objects.
< / td >
< / tr >
2012-09-26 22:17:58 -04:00
< tr >
< td > spark.broadcast.factory< / td >
2013-09-01 01:17:40 -04:00
< td > org.apache.spark.broadcast.< br / > HttpBroadcastFactory< / td >
2012-09-26 22:17:58 -04:00
< td >
Which broadcast implementation to use.
< / td >
< / tr >
< tr >
< td > spark.locality.wait< / td >
< td > 3000< / td >
< td >
Number of milliseconds to wait to launch a data-local task before giving up and launching it
2013-08-15 20:22:49 -04:00
on a less-local node. The same wait will be used to step through multiple locality levels
(process-local, node-local, rack-local and then any). It is also possible to customize the
waiting time for each level by setting < code > spark.locality.wait.node< / code > , etc.
You should increase this setting if your tasks are long and see poor locality, but the
default usually works well.
< / td >
< / tr >
< tr >
< td > spark.locality.wait.process< / td >
< td > spark.locality.wait< / td >
< td >
Customize the locality wait for process locality. This affects tasks that attempt to access
cached data in a particular executor process.
< / td >
< / tr >
< tr >
< td > spark.locality.wait.node< / td >
< td > spark.locality.wait< / td >
< td >
Customize the locality wait for node locality. For example, you can set this to 0 to skip
node locality and search immediately for rack locality (if your cluster has rack information).
< / td >
< / tr >
< tr >
< td > spark.locality.wait.rack< / td >
< td > spark.locality.wait< / td >
< td >
Customize the locality wait for rack locality.
2012-09-26 22:17:58 -04:00
< / td >
< / tr >
2013-02-06 17:34:46 -05:00
< tr >
< td > spark.worker.timeout< / td >
< td > 60< / td >
< td >
Number of seconds after which the standalone deploy master considers a worker lost if it
receives no heartbeats.
< / td >
< / tr >
2014-04-06 22:17:33 -04:00
< tr >
< td > spark.worker.cleanup.enabled< / td >
< td > true< / td >
< td >
Enable periodic cleanup of worker / application directories. Note that this only affects standalone
mode, as YARN works differently.
< / td >
< / tr >
< tr >
< td > spark.worker.cleanup.interval< / td >
< td > 1800 (30 minutes)< / td >
< td >
Controls the interval, in seconds, at which the worker cleans up old application work dirs
on the local machine.
< / td >
< / tr >
< tr >
< td > spark.worker.cleanup.appDataTtl< / td >
< td > 7 * 24 * 3600 (7 days)</ td >
< td >
The number of seconds to retain application work directories on each worker. This is a Time To Live
and should depend on the amount of available disk space you have. Application logs and jars are
downloaded to each application work dir. Over time, the work dirs can quickly fill up disk space,
especially if you run jobs very frequently.
< / td >
< / tr >
2013-01-21 16:10:02 -05:00
< tr >
< td > spark.akka.frameSize< / td >
< td > 10< / td >
< td >
Maximum message size to allow in "control plane" communication (for serialized tasks and task
2013-01-22 16:25:41 -05:00
results), in MB. Increase this if your tasks need to send back large results to the driver
2013-01-21 16:10:02 -05:00
(e.g. using < code > collect()< / code > on a large dataset).
< / td >
< / tr >
2012-10-07 14:30:53 -04:00
< tr >
< td > spark.akka.threads< / td >
< td > 4< / td >
< td >
Number of actor threads to use for communication. Can be useful to increase on large clusters
2013-01-22 16:25:41 -05:00
when the driver has a lot of CPU cores.
2012-10-07 14:30:53 -04:00
< / td >
< / tr >
2013-01-21 16:10:02 -05:00
< tr >
< td > spark.akka.timeout< / td >
2013-12-11 23:42:06 -05:00
< td > 100< / td >
2013-01-21 16:10:02 -05:00
< td >
2013-02-06 17:34:46 -05:00
Communication timeout between Spark nodes, in seconds.
2013-01-21 16:10:02 -05:00
< / td >
< / tr >
2013-11-26 10:14:47 -05:00
< tr >
2013-11-27 03:56:28 -05:00
< td > spark.akka.heartbeat.pauses< / td >
2013-12-11 23:42:06 -05:00
< td > 600< / td >
2013-11-26 10:14:47 -05:00
< td >
2013-12-11 23:42:06 -05:00
This is set to a larger value to disable failure detector that comes inbuilt akka. It can be enabled again, if you plan to use this feature (Not recommended). Acceptable heart beat pause in seconds for akka. This can be used to control sensitivity to gc pauses. Tune this in combination of `spark.akka.heartbeat.interval` and `spark.akka.failure-detector.threshold` if you need to.
2013-11-26 10:14:47 -05:00
< / td >
< / tr >
< tr >
< td > spark.akka.failure-detector.threshold< / td >
2013-12-11 23:42:06 -05:00
< td > 300.0< / td >
2013-11-26 10:14:47 -05:00
< td >
2013-12-11 23:42:06 -05:00
This is set to a larger value to disable failure detector that comes inbuilt akka. It can be enabled again, if you plan to use this feature (Not recommended). This maps to akka's `akka.remote.transport-failure-detector.threshold` . Tune this in combination of `spark.akka.heartbeat.pauses` and `spark.akka.heartbeat.interval` if you need to.
2013-11-26 10:14:47 -05:00
< / td >
< / tr >
< tr >
< td > spark.akka.heartbeat.interval< / td >
2013-12-11 23:42:06 -05:00
< td > 1000< / td >
2013-11-26 10:14:47 -05:00
< td >
2014-04-04 23:36:24 -04:00
This is set to a larger value to disable failure detector that comes inbuilt akka. It can be enabled again, if you plan to use this feature (Not recommended). A larger interval value in seconds reduces network overhead and a smaller value ( ~ 1 s) might be more informative for akka's failure detector. Tune this in combination of `spark.akka.heartbeat.pauses` and `spark.akka.failure-detector.threshold` if you need to. Only positive use case for using failure detector can be, a sensistive failure detector can help evict rogue executors really quick. However this is usually not the case as gc pauses and network lags are expected in a real spark cluster. Apart from that enabling this leads to a lot of exchanges of heart beats between nodes leading to flooding the network with those.
2013-11-26 10:14:47 -05:00
< / td >
< / tr >
2012-09-26 22:17:58 -04:00
< tr >
2013-01-22 16:25:41 -05:00
< td > spark.driver.host< / td >
2012-09-26 22:17:58 -04:00
< td > (local hostname)< / td >
< td >
2013-01-22 16:25:41 -05:00
Hostname or IP address for the driver to listen on.
2012-09-26 22:17:58 -04:00
< / td >
< / tr >
< tr >
2013-01-22 16:25:41 -05:00
< td > spark.driver.port< / td >
2012-09-26 22:17:58 -04:00
< td > (random)< / td >
< td >
2013-01-22 16:25:41 -05:00
Port for the driver to listen on.
2012-09-26 22:17:58 -04:00
< / td >
< / tr >
2013-01-01 15:21:32 -05:00
< tr >
2013-02-23 20:42:26 -05:00
< td > spark.cleaner.ttl< / td >
2013-08-31 17:21:10 -04:00
< td > (infinite)< / td >
2013-01-01 15:21:32 -05:00
< td >
2013-02-23 20:42:26 -05:00
Duration (seconds) of how long Spark will remember any metadata (stages generated, tasks generated, etc.).
2013-01-01 15:21:32 -05:00
Periodic cleanups will ensure that metadata older than this duration will be forgetten. This is
useful for running Spark for many hours / days (for example, running 24/7 in case of Spark Streaming
applications). Note that any RDD that persists in memory for more than this duration will be cleared as well.
< / td >
< / tr >
2013-04-16 13:57:05 -04:00
< tr >
< td > spark.streaming.blockInterval< / td >
< td > 200< / td >
< td >
2014-01-29 00:51:05 -05:00
Duration (milliseconds) of how long to batch new objects coming from network receivers used
in Spark Streaming.
< / td >
< / tr >
< tr >
< td > spark.streaming.unpersist< / td >
< td > false< / td >
< td >
Force RDDs generated and persisted by Spark Streaming to be automatically unpersisted from
Spark's memory. Setting this to true is likely to reduce Spark's RDD memory usage.
2013-04-16 13:57:05 -04:00
< / td >
< / tr >
2013-07-28 02:08:00 -04:00
< tr >
< td > spark.task.maxFailures< / td >
< td > 4< / td >
< td >
Number of individual task failures before giving up on the job.
2013-07-28 02:16:20 -04:00
Should be greater than or equal to 1. Number of allowed retries = this value - 1.
2013-07-28 02:08:00 -04:00
< / td >
< / tr >
2013-10-17 16:14:12 -04:00
< tr >
< td > spark.broadcast.blockSize< / td >
< td > 4096< / td >
< td >
2014-04-04 23:36:24 -04:00
Size of each piece of a block in kilobytes for < code > TorrentBroadcastFactory< / code > .
2013-10-17 16:14:12 -04:00
Too large a value decreases parallelism during broadcast (makes it slower); however, if it is too small, < code > BlockManager< / code > might take a performance hit.
< / td >
< / tr >
2014-01-06 05:17:40 -05:00
2013-12-04 21:39:34 -05:00
< tr >
< td > spark.shuffle.consolidateFiles< / td >
2014-01-12 22:16:43 -05:00
< td > false< / td >
2013-12-04 21:39:34 -05:00
< td >
2013-12-07 04:39:52 -05:00
If set to "true", consolidates intermediate files created during a shuffle. Creating fewer files can improve filesystem performance for shuffles with large numbers of reduce tasks. It is recommended to set this to "true" when using ext4 or xfs filesystems. On ext3, this option might degrade performance on machines with many (>8) cores due to filesystem limitations.
2013-12-04 21:39:34 -05:00
< / td >
< / tr >
2014-01-30 12:33:18 -05:00
< tr >
< td > spark.shuffle.file.buffer.kb< / td >
< td > 100< / td >
< td >
Size of the in-memory buffer for each shuffle file output stream, in kilobytes. These buffers
reduce the number of disk seeks and system calls made in creating intermediate shuffle files.
< / td >
< / tr >
2014-01-10 18:09:51 -05:00
< tr >
2014-01-13 16:24:04 -05:00
< td > spark.shuffle.spill< / td >
2014-01-10 18:09:51 -05:00
< td > true< / td >
< td >
2014-01-10 18:45:38 -05:00
If set to "true", limits the amount of memory used during reduces by spilling data out to disk. This spilling
threshold is specified by < code > spark.shuffle.memoryFraction< / code > .
2014-01-10 18:09:51 -05:00
< / td >
< / tr >
2013-12-04 21:39:34 -05:00
< tr >
< td > spark.speculation< / td >
< td > false< / td >
< td >
If set to "true", performs speculative execution of tasks. This means if one or more tasks are running slowly in a stage, they will be re-launched.
< / td >
< / tr >
< tr >
< td > spark.speculation.interval< / td >
< td > 100< / td >
< td >
2013-12-04 21:49:32 -05:00
How often Spark will check for tasks to speculate, in milliseconds.
2013-12-04 21:39:34 -05:00
< / td >
< / tr >
< tr >
< td > spark.speculation.quantile< / td >
< td > 0.75< / td >
< td >
Percentage of tasks which must be complete before speculation is enabled for a particular stage.
< / td >
< / tr >
< tr >
< td > spark.speculation.multiplier< / td >
< td > 1.5< / td >
< td >
How many times slower a task is than the median to be considered for speculation.
< / td >
< / tr >
2014-01-06 05:21:32 -05:00
< tr >
2014-01-07 14:35:52 -05:00
< td > spark.logConf< / td >
2014-01-06 05:21:32 -05:00
< td > false< / td >
< td >
[SPARK-1132] Persisting Web UI through refactoring the SparkListener interface
The fleeting nature of the Spark Web UI has long been a problem reported by many users: The existing Web UI disappears as soon as the associated application terminates. This is because SparkUI is tightly coupled with SparkContext, and cannot be instantiated independently from it. To solve this, some state must be saved to persistent storage while the application is still running.
The approach taken by this PR involves persisting the UI state through SparkListenerEvents. This requires a major refactor of the SparkListener interface because existing events (1) maintain deep references, making de/serialization is difficult, and (2) do not encode all the information displayed on the UI. In this design, each existing listener for the UI (e.g. ExecutorsListener) maintains state that can be fully constructed from SparkListenerEvents. This state is then supplied to the parent UI (e.g. ExecutorsUI), which renders the associated page(s) on demand.
This PR introduces two important classes: the **EventLoggingListener**, and the **ReplayListenerBus**. In a live application, SparkUI registers an EventLoggingListener with the SparkContext in addition to the existing listeners. Over the course of the application, this listener serializes and logs all events to persisted storage. Then, after the application has finished, the SparkUI can be revived by replaying all the logged events to the existing UI listeners through the ReplayListenerBus.
This feature is currently integrated with the Master Web UI, which optionally rebuilds a SparkUI from event logs as soon as the corresponding application finishes.
More details can be found in the commit messages, comments within the code, and the [design doc](https://spark-project.atlassian.net/secure/attachment/12900/PersistingSparkWebUI.pdf). Comments and feedback are most welcome.
Author: Andrew Or <andrewor14@gmail.com>
Author: andrewor14 <andrewor14@gmail.com>
Closes #42 from andrewor14/master and squashes the following commits:
e5f14fa [Andrew Or] Merge github.com:apache/spark
a1c5cd9 [Andrew Or] Merge github.com:apache/spark
b8ba817 [Andrew Or] Remove UI from map when removing application in Master
83af656 [Andrew Or] Scraps and pieces (no functionality change)
222adcd [Andrew Or] Merge github.com:apache/spark
124429f [Andrew Or] Clarify LiveListenerBus behavior + Add tests for new behavior
f80bd31 [Andrew Or] Simplify static handler and BlockManager status update logic
9e14f97 [Andrew Or] Moved around functionality + renamed classes per Patrick
6740e49 [Andrew Or] Fix comment nits
650eb12 [Andrew Or] Add unit tests + Fix bugs found through tests
45fd84c [Andrew Or] Remove now deprecated test
c5c2c8f [Andrew Or] Remove list of (TaskInfo, TaskMetrics) from StageInfo
3456090 [Andrew Or] Address Patrick's comments
bf80e3d [Andrew Or] Imports, comments, and code formatting, once again (minor)
ac69ec8 [Andrew Or] Fix test fail
d801d11 [Andrew Or] Merge github.com:apache/spark (major)
dc93915 [Andrew Or] Imports, comments, and code formatting (minor)
77ba283 [Andrew Or] Address Kay's and Patrick's comments
b6eaea7 [Andrew Or] Treating SparkUI as a handler of MasterUI
d59da5f [Andrew Or] Avoid logging all the blocks on each executor
d6e3b4a [Andrew Or] Merge github.com:apache/spark
ca258a4 [Andrew Or] Master UI - add support for reading compressed event logs
176e68e [Andrew Or] Fix deprecated message for JavaSparkContext (minor)
4f69c4a [Andrew Or] Master UI - Rebuild SparkUI on application finish
291b2be [Andrew Or] Correct directory in log message "INFO: Logging events to <dir>"
1ba3407 [Andrew Or] Add a few configurable options to event logging
e375431 [Andrew Or] Add new constructors for SparkUI
18b256d [Andrew Or] Refactor out event logging and replaying logic from UI
bb4c503 [Andrew Or] Use a more mnemonic path for logging
aef411c [Andrew Or] Fix bug: storage status was not reflected on UI in the local case
03eda0b [Andrew Or] Fix HDFS flush behavior
36b3e5d [Andrew Or] Add HDFS support for event logging
cceff2b [andrewor14] Fix 100 char format fail
2fee310 [Andrew Or] Address Patrick's comments
2981d61 [Andrew Or] Move SparkListenerBus out of DAGScheduler + Clean up
5d2cec1 [Andrew Or] JobLogger: ID -> Id
0503e4b [Andrew Or] Fix PySpark tests + remove sc.clearFiles/clearJars
4d2fb0c [Andrew Or] Fix format fail
faa113e [Andrew Or] General clean up
d47585f [Andrew Or] Clean up FileLogger
472fd8a [Andrew Or] Fix a couple of tests
996d7a2 [Andrew Or] Reflect RDD unpersist on UI
7b2f811 [Andrew Or] Guard against TaskMetrics NPE + Fix tests
d1f4285 [Andrew Or] Migrate from lift-json to json4s-jackson
28019ca [Andrew Or] Merge github.com:apache/spark
bbe3501 [Andrew Or] Embed storage status and RDD info in Task events
6631c02 [Andrew Or] More formatting changes, this time mainly for Json DSL
70e7e7a [Andrew Or] Formatting changes
e9e1c6d [Andrew Or] Move all JSON de/serialization logic to JsonProtocol
d646df6 [Andrew Or] Completely decouple SparkUI from SparkContext
6814da0 [Andrew Or] Explicitly register each UI listener rather than through some magic
64d2ce1 [Andrew Or] Fix BlockManagerUI bug by introducing new event
4273013 [Andrew Or] Add a gateway SparkListener to simplify event logging
904c729 [Andrew Or] Fix another major bug
5ac906d [Andrew Or] Mostly naming, formatting, and code style changes
3fd584e [Andrew Or] Fix two major bugs
f3fc13b [Andrew Or] General refactor
4dfcd22 [Andrew Or] Merge git://git.apache.org/incubator-spark into persist-ui
b3976b0 [Andrew Or] Add functionality of reconstructing a persisted UI from SparkContext
8add36b [Andrew Or] JobProgressUI: Add JSON functionality
d859efc [Andrew Or] BlockManagerUI: Add JSON functionality
c4cd480 [Andrew Or] Also deserialize new events
8a2ebe6 [Andrew Or] Fix bugs for EnvironmentUI and ExecutorsUI
de8a1cd [Andrew Or] Serialize events both to and from JSON (rather than just to)
bf0b2e9 [Andrew Or] ExecutorUI: Serialize events rather than arbitary executor information
bb222b9 [Andrew Or] ExecutorUI: render completely from JSON
dcbd312 [Andrew Or] Add JSON Serializability for all SparkListenerEvent's
10ed49d [Andrew Or] Merge github.com:apache/incubator-spark into persist-ui
8e09306 [Andrew Or] Use JSON for ExecutorsUI
e3ae35f [Andrew Or] Merge github.com:apache/incubator-spark
3ddeb7e [Andrew Or] Also privatize fields
090544a [Andrew Or] Privatize methods
13920c9 [Andrew Or] Update docs
bd5a1d7 [Andrew Or] Typo: phyiscal -> physical
287ef44 [Andrew Or] Avoid reading the entire batch into memory; also simplify streaming logic
3df7005 [Andrew Or] Merge branch 'master' of github.com:andrewor14/incubator-spark
a531d2e [Andrew Or] Relax assumptions on compressors and serializers when batching
164489d [Andrew Or] Relax assumptions on compressors and serializers when batching
2014-03-19 16:17:01 -04:00
Whether to log the supplied SparkConf as INFO at start of spark context.
< / td >
< / tr >
< tr >
< td > spark.eventLog.enabled< / td >
< td > false< / td >
< td >
Whether to log spark events, useful for reconstructing the Web UI after the application has finished.
< / td >
< / tr >
< tr >
< td > spark.eventLog.compress< / td >
< td > false< / td >
< td >
Whether to compress logged events, if < code > spark.eventLog.enabled< / code > is true.
< / td >
< / tr >
< tr >
< td > spark.eventLog.dir< / td >
< td > file:///tmp/spark-events< / td >
< td >
Base directory in which spark events are logged, if < code > spark.eventLog.enabled< / code > is true.
Within this base directory, Spark creates a sub-directory for each application, and logs the events
specific to the application in this directory.
2014-01-06 05:21:32 -05:00
< / td >
< / tr >
2014-01-07 14:35:52 -05:00
< tr >
< td > spark.deploy.spreadOut< / td >
< td > true< / td >
< td >
Whether the standalone cluster manager should spread applications out across nodes or try
to consolidate them onto as few nodes as possible. Spreading out is usually better for
data locality in HDFS, but consolidating is more efficient for compute-intensive workloads. < br / >
2014-01-07 19:30:23 -05:00
< b > Note:< / b > this setting needs to be configured in the standalone cluster master, not in individual
2014-04-21 13:26:33 -04:00
applications; you can set it through < code > SPARK_MASTER_OPTS< / code > in < code > spark-env.sh< / code > .
2014-01-07 14:35:52 -05:00
< / td >
< / tr >
< tr >
< td > spark.deploy.defaultCores< / td >
< td > (infinite)< / td >
< td >
Default number of cores to give to applications in Spark's standalone mode if they don't
set < code > spark.cores.max< / code > . If not set, applications always get all available
cores unless they configure < code > spark.cores.max< / code > themselves.
Set this lower on a shared cluster to prevent users from grabbing
the whole cluster by default. < br / >
2014-01-07 19:30:23 -05:00
< b > Note:< / b > this setting needs to be configured in the standalone cluster master, not in individual
2014-04-21 13:26:33 -04:00
applications; you can set it through < code > SPARK_MASTER_OPTS< / code > in < code > spark-env.sh< / code > .
2014-03-09 14:57:06 -04:00
< / td >
2014-01-17 20:27:25 -05:00
< / tr >
< tr >
< td > spark.files.overwrite< / td >
< td > false< / td >
< td >
Whether to overwrite files added through SparkContext.addFile() when the target file exists and its contents do not match those of the source.
2014-01-07 14:35:52 -05:00
< / td >
Add timeout for fetch file
Currently, when fetch a file, the connection's connect timeout
and read timeout is based on the default jvm setting, in this change, I change it to
use spark.worker.timeout. This can be usefull, when the
connection status between worker is not perfect. And prevent
prematurely remove task set.
Author: Jiacheng Guo <guojc03@gmail.com>
Closes #98 from guojc/master and squashes the following commits:
abfe698 [Jiacheng Guo] add space according request
2a37c34 [Jiacheng Guo] Add timeout for fetch file Currently, when fetch a file, the connection's connect timeout and read timeout is based on the default jvm setting, in this change, I change it to use spark.worker.timeout. This can be usefull, when the connection status between worker is not perfect. And prevent prematurely remove task set.
2014-03-09 14:37:44 -04:00
< / tr >
< tr >
< td > spark.files.fetchTimeout< / td >
< td > false< / td >
< td >
Communication timeout to use when fetching files added through SparkContext.addFile() from
the driver.
< / td >
< / tr >
2014-04-09 01:29:21 -04:00
< tr >
< td > spark.files.userClassPathFirst< / td >
< td > false< / td >
< td >
(Experimental) Whether to give user-added jars precedence over Spark's own jars when
loading classes in Executors. This feature can be used to mitigate conflicts between
Spark's dependencies and user dependencies. It is currently an experimental feature.
< / td >
< / tr >
2014-04-04 23:36:24 -04:00
< tr >
SPARK-1189: Add Security to Spark - Akka, Http, ConnectionManager, UI use servlets
resubmit pull request. was https://github.com/apache/incubator-spark/pull/332.
Author: Thomas Graves <tgraves@apache.org>
Closes #33 from tgravescs/security-branch-0.9-with-client-rebase and squashes the following commits:
dfe3918 [Thomas Graves] Fix merge conflict since startUserClass now using runAsUser
05eebed [Thomas Graves] Fix dependency lost in upmerge
d1040ec [Thomas Graves] Fix up various imports
05ff5e0 [Thomas Graves] Fix up imports after upmerging to master
ac046b3 [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase
13733e1 [Thomas Graves] Pass securityManager and SparkConf around where we can. Switch to use sparkConf for reading config whereever possible. Added ConnectionManagerSuite unit tests.
4a57acc [Thomas Graves] Change UI createHandler routines to createServlet since they now return servlets
2f77147 [Thomas Graves] Rework from comments
50dd9f2 [Thomas Graves] fix header in SecurityManager
ecbfb65 [Thomas Graves] Fix spacing and formatting
b514bec [Thomas Graves] Fix reference to config
ed3d1c1 [Thomas Graves] Add security.md
6f7ddf3 [Thomas Graves] Convert SaslClient and SaslServer to scala, change spark.authenticate.ui to spark.ui.acls.enable, and fix up various other things from review comments
2d9e23e [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase_rework
5721c5a [Thomas Graves] update AkkaUtilsSuite test for the actorSelection changes, fix typos based on comments, and remove extra lines I missed in rebase from AkkaUtils
f351763 [Thomas Graves] Add Security to Spark - Akka, Http, ConnectionManager, UI to use servlets
2014-03-06 19:27:50 -05:00
< td > spark.authenticate< / td >
< td > false< / td >
< td >
Whether spark authenticates its internal connections. See < code > spark.authenticate.secret< / code > if not
running on Yarn.
< / td >
< / tr >
2014-04-04 23:36:24 -04:00
< tr >
SPARK-1189: Add Security to Spark - Akka, Http, ConnectionManager, UI use servlets
resubmit pull request. was https://github.com/apache/incubator-spark/pull/332.
Author: Thomas Graves <tgraves@apache.org>
Closes #33 from tgravescs/security-branch-0.9-with-client-rebase and squashes the following commits:
dfe3918 [Thomas Graves] Fix merge conflict since startUserClass now using runAsUser
05eebed [Thomas Graves] Fix dependency lost in upmerge
d1040ec [Thomas Graves] Fix up various imports
05ff5e0 [Thomas Graves] Fix up imports after upmerging to master
ac046b3 [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase
13733e1 [Thomas Graves] Pass securityManager and SparkConf around where we can. Switch to use sparkConf for reading config whereever possible. Added ConnectionManagerSuite unit tests.
4a57acc [Thomas Graves] Change UI createHandler routines to createServlet since they now return servlets
2f77147 [Thomas Graves] Rework from comments
50dd9f2 [Thomas Graves] fix header in SecurityManager
ecbfb65 [Thomas Graves] Fix spacing and formatting
b514bec [Thomas Graves] Fix reference to config
ed3d1c1 [Thomas Graves] Add security.md
6f7ddf3 [Thomas Graves] Convert SaslClient and SaslServer to scala, change spark.authenticate.ui to spark.ui.acls.enable, and fix up various other things from review comments
2d9e23e [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase_rework
5721c5a [Thomas Graves] update AkkaUtilsSuite test for the actorSelection changes, fix typos based on comments, and remove extra lines I missed in rebase from AkkaUtils
f351763 [Thomas Graves] Add Security to Spark - Akka, Http, ConnectionManager, UI to use servlets
2014-03-06 19:27:50 -05:00
< td > spark.authenticate.secret< / td >
< td > None< / td >
< td >
Set the secret key used for Spark to authenticate between components. This needs to be set if
not running on Yarn and authentication is enabled.
< / td >
< / tr >
2014-04-04 23:36:24 -04:00
< tr >
SPARK-1189: Add Security to Spark - Akka, Http, ConnectionManager, UI use servlets
resubmit pull request. was https://github.com/apache/incubator-spark/pull/332.
Author: Thomas Graves <tgraves@apache.org>
Closes #33 from tgravescs/security-branch-0.9-with-client-rebase and squashes the following commits:
dfe3918 [Thomas Graves] Fix merge conflict since startUserClass now using runAsUser
05eebed [Thomas Graves] Fix dependency lost in upmerge
d1040ec [Thomas Graves] Fix up various imports
05ff5e0 [Thomas Graves] Fix up imports after upmerging to master
ac046b3 [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase
13733e1 [Thomas Graves] Pass securityManager and SparkConf around where we can. Switch to use sparkConf for reading config whereever possible. Added ConnectionManagerSuite unit tests.
4a57acc [Thomas Graves] Change UI createHandler routines to createServlet since they now return servlets
2f77147 [Thomas Graves] Rework from comments
50dd9f2 [Thomas Graves] fix header in SecurityManager
ecbfb65 [Thomas Graves] Fix spacing and formatting
b514bec [Thomas Graves] Fix reference to config
ed3d1c1 [Thomas Graves] Add security.md
6f7ddf3 [Thomas Graves] Convert SaslClient and SaslServer to scala, change spark.authenticate.ui to spark.ui.acls.enable, and fix up various other things from review comments
2d9e23e [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase_rework
5721c5a [Thomas Graves] update AkkaUtilsSuite test for the actorSelection changes, fix typos based on comments, and remove extra lines I missed in rebase from AkkaUtils
f351763 [Thomas Graves] Add Security to Spark - Akka, Http, ConnectionManager, UI to use servlets
2014-03-06 19:27:50 -05:00
< td > spark.core.connection.auth.wait.timeout< / td >
< td > 30< / td >
< td >
Number of seconds for the connection to wait for authentication to occur before timing
2014-04-04 23:36:24 -04:00
out and giving up.
SPARK-1189: Add Security to Spark - Akka, Http, ConnectionManager, UI use servlets
resubmit pull request. was https://github.com/apache/incubator-spark/pull/332.
Author: Thomas Graves <tgraves@apache.org>
Closes #33 from tgravescs/security-branch-0.9-with-client-rebase and squashes the following commits:
dfe3918 [Thomas Graves] Fix merge conflict since startUserClass now using runAsUser
05eebed [Thomas Graves] Fix dependency lost in upmerge
d1040ec [Thomas Graves] Fix up various imports
05ff5e0 [Thomas Graves] Fix up imports after upmerging to master
ac046b3 [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase
13733e1 [Thomas Graves] Pass securityManager and SparkConf around where we can. Switch to use sparkConf for reading config whereever possible. Added ConnectionManagerSuite unit tests.
4a57acc [Thomas Graves] Change UI createHandler routines to createServlet since they now return servlets
2f77147 [Thomas Graves] Rework from comments
50dd9f2 [Thomas Graves] fix header in SecurityManager
ecbfb65 [Thomas Graves] Fix spacing and formatting
b514bec [Thomas Graves] Fix reference to config
ed3d1c1 [Thomas Graves] Add security.md
6f7ddf3 [Thomas Graves] Convert SaslClient and SaslServer to scala, change spark.authenticate.ui to spark.ui.acls.enable, and fix up various other things from review comments
2d9e23e [Thomas Graves] Merge remote-tracking branch 'upstream/master' into security-branch-0.9-with-client-rebase_rework
5721c5a [Thomas Graves] update AkkaUtilsSuite test for the actorSelection changes, fix typos based on comments, and remove extra lines I missed in rebase from AkkaUtils
f351763 [Thomas Graves] Add Security to Spark - Akka, Http, ConnectionManager, UI to use servlets
2014-03-06 19:27:50 -05:00
< / td >
2014-01-07 14:35:52 -05:00
< / tr >
2014-03-25 16:05:30 -04:00
< tr >
< td > spark.task.cpus< / td >
< td > 1< / td >
< td >
Number of cores to allocate for each task.
< / td >
< / tr >
2014-04-21 13:26:33 -04:00
< tr >
< td > spark.executor.extraJavaOptions< / td >
< td > (none)< / td >
< td >
A string of extra JVM options to pass to executors. For instance, GC settings or other
logging. Note that it is illegal to set Spark properties or heap size settings with this
option. Spark properties should be set using a SparkConf object or the
spark-defaults.conf file used with the spark-submit script. Heap size settings can be set
with spark.executor.memory.
< / td >
< / tr >
< tr >
< td > spark.executor.extraClassPath< / td >
< td > (none)< / td >
< td >
Extra classpath entries to append to the classpath of executors. This exists primarily
for backwards-compatibility with older versions of Spark. Users typically should not need
to set this option.
< / td >
< / tr >
< tr >
< td > spark.executor.extraLibraryPath< / td >
< td > (none)< / td >
< td >
Set a special library path to use when launching executor JVM's.
< / td >
< / tr >
2012-09-26 22:17:58 -04:00
< / table >
2012-09-03 02:05:40 -04:00
2013-12-30 22:17:28 -05:00
## Viewing Spark Properties
The application web UI at `http://<driver>:4040` lists Spark properties in the "Environment" tab.
This is a useful place to check to make sure that your properties have been set correctly.
2013-08-31 17:21:10 -04:00
# Environment Variables
2013-12-30 22:17:28 -05:00
Certain Spark settings can be configured through environment variables, which are read from the `conf/spark-env.sh`
2014-04-21 13:26:33 -04:00
script in the directory where Spark is installed (or `conf/spark-env.cmd` on Windows). In Standalone and Mesos modes,
this file can give machine specific information such as hostnames. It is also sourced when running local
Spark applications or submission scripts.
2013-08-31 17:21:10 -04:00
Note that `conf/spark-env.sh` does not exist by default when Spark is installed. However, you can copy
`conf/spark-env.sh.template` to create it. Make sure you make the copy executable.
The following variables can be set in `spark-env.sh` :
2013-09-02 01:12:03 -04:00
* `JAVA_HOME` , the location where Java is installed (if it's not on your default `PATH` )
* `PYSPARK_PYTHON` , the Python binary to use for PySpark
2013-08-31 17:21:10 -04:00
* `SPARK_LOCAL_IP` , to configure which IP address of the machine to bind to.
2014-04-21 13:26:33 -04:00
* `SPARK_PUBLIC_DNS` , the hostname your Spark program will advertise to other machines.
2013-08-31 17:21:10 -04:00
* Options for the Spark [standalone cluster scripts ](spark-standalone.html#cluster-launch-scripts ), such as number of cores
to use on each machine and maximum memory.
Since `spark-env.sh` is a shell script, some of these can be set programmatically -- for example, you might
compute `SPARK_LOCAL_IP` by looking up the IP of a specific network interface.
2012-09-26 22:17:58 -04:00
# Configuring Logging
2012-09-03 02:05:40 -04:00
2012-09-26 22:17:58 -04:00
Spark uses [log4j ](http://logging.apache.org/log4j/ ) for logging. You can configure it by adding a `log4j.properties`
file in the `conf` directory. One way to start is to copy the existing `log4j.properties.template` located there.