cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to restrict the number of tasks per executor?

saipujari_spark
Valued Contributor
Valued Contributor

In general, one task per core is how spark executes the tasks.

If we want to restrict the number of tasks submitted to the executor to get more task to memory ratio, How can we achieve that?

Thanks,
Saikrishna Pujari
Sr. Spark Technical Solutions Engineer, Databricks
1 ACCEPTED SOLUTION

Accepted Solutions

saipujari_spark
Valued Contributor
Valued Contributor

We can use a config called "spark.task.cpus"

This specifies the number of cores to allocate for each task.

The default value is 1

If we specify say 2, it means fewer tasks will be assigned to the executor.

Thanks,
Saikrishna Pujari
Sr. Spark Technical Solutions Engineer, Databricks

View solution in original post

2 REPLIES 2

Kaniz
Community Manager
Community Manager

Hi @ Sai! My name is Kaniz, and I'm the technical moderator here. Great to meet you, and thanks for your question! Let's see if your peers on the community have an answer to your question first. Or else I will follow up with my team and get back to you soon.Thanks.

saipujari_spark
Valued Contributor
Valued Contributor

We can use a config called "spark.task.cpus"

This specifies the number of cores to allocate for each task.

The default value is 1

If we specify say 2, it means fewer tasks will be assigned to the executor.

Thanks,
Saikrishna Pujari
Sr. Spark Technical Solutions Engineer, Databricks
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.