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
2,210 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 23, 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
1,253 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,350 points
2,211 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 26, 2018 in Apache Spark by nitinrawat895
• 11,380 points
930 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
• 11,380 points
11,028 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
• 11,380 points
2,536 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,832 views
+1 vote
8 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
61,795 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,790 points
1,128 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP