Skip to content

Instantly share code, notes, and snippets.

@bepcyc
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save bepcyc/e018eac14921ef368870 to your computer and use it in GitHub Desktop.

Select an option

Save bepcyc/e018eac14921ef368870 to your computer and use it in GitHub Desktop.
# insert somewhere in function working with sc directly
sc.stop()
from pyspark import SparkContext
SparkContext.setSystemProperty('spark.executor.memory', '6g') # no sure which one works, use both
SparkContext.setSystemProperty('spark.python.worker.memory', '6g') # no sure which one works, use both
SparkContext.setSystemProperty('spark.shuffle.spill', 'false')
SparkContext.setSystemProperty('spark.driver.memory', '2g')
SparkContext.setSystemProperty('spark.io.compression.codec', 'snappy') # just to be sure
sc = SparkContext("local[8]", "Simple App") # set to your number of cores
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment