Increase number of cores in Spark

0 votes
Hi. I am working on Spark and have started a driver job. It was running slow so checked the configuration, it seems like it is using only 1 core. I want to increase the number of cores. How can I do it?
Feb 22, 2019 in Apache Spark by Kiran
442 views

1 answer to this question.

+1 vote

Now that the job is already running, changing the configuration by hard-code is not advisable. It is good that you have decided to dynamically change it. To do this, refer the below code:

val sc = new SparkContext(new SparkConf())
./bin/spark-submit <all your existing options> --conf spark.driver.cores=1
answered Feb 22, 2019 by Reshma
Why is it not a good idea to change the config by hard-code?

Changing the configuration by hard-code is not advisable in this scenario. Kiran has jobs running. And if you change the configuration by hard-code, it might affect the running jobs. 

Related Questions In Apache Spark

0 votes
1 answer
0 votes
1 answer

Increase cores for yarn in Spark application

By default, only one core is used for ...READ MORE

answered Mar 26, 2019 in Apache Spark by Bhuvan
193 views
0 votes
1 answer

How to get the number of elements in partition?

rdd.mapPartitions(iter => Array(iter.size).iterator, true) This command will ...READ MORE

answered May 8, 2018 in Apache Spark by kurt_cobain
• 9,310 points
474 views
0 votes
1 answer

Which is better in term of speed, Shark or Spark?

Spark is a framework for distributed data ...READ MORE

answered Jun 25, 2018 in Apache Spark by nitinrawat895
• 10,920 points
89 views
+1 vote
2 answers
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,920 points
5,314 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,920 points
781 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
32,413 views
0 votes
7 answers

How to print the contents of RDD in Apache Spark?

Save it to a text file: line.saveAsTextFile("alicia.txt") Print contains ...READ MORE

answered Dec 10, 2018 in Apache Spark by Akshay
27,986 views
0 votes
1 answer

In what kind of use cases has Spark outperformed Hadoop in processing?

I can list some but there can ...READ MORE

answered Sep 19, 2018 in Apache Spark by zombie
• 3,750 points
143 views