Uh oh!
There was an error while loading. Please reload this page.
[SPARK-25852][Core] we should filter the workOffers with freeCores>=CPUS_PER_TASK for better performance - #22849
[SPARK-25852][Core] we should filter the workOffers with freeCores>=CPUS_PER_TASK for better performance#22849zuotingbing wants to merge 1 commit into
Conversation
zuotingbing
commented
Oct 26, 2018
AmplabJenkins
commented
Oct 26, 2018
Can one of the admins verify this patch? |
There was a problem hiding this comment.
I don't know this code well but the comment above implies that it means to make an offer on all executors?
What is the performance impact anyway?
There was a problem hiding this comment.
On our cluster for production there are many executors and tasksets/tasks. As we know there is a round-robin manner to fill each node with tasks and it will be scheduled for each second by default("spark.scheduler.revive.interval", "1s"). It seams make no sense to schedule tasks to executors which have no free cores.
There was a problem hiding this comment.
I'm saying there is a comment a few lines above that describes this as a fake offer that explicitly intends to contact all executors. I think we need to figure out if that's still relevant. I don't have git in front of me but check git blame or GitHub to see when this was written?
There was a problem hiding this comment.
I checked the git log, at the beginning function makeOffers do not filter out any resource, maybe it is the reason why the comment is "Make fake resource offers on all executors"// Make fake resource offers on all executors def makeOffers() { launchTasks(scheduler.resourceOffers( executorHost.toArray.map {case (id, host) => new WorkerOffer(id, host, freeCores(id))})) }
There was a problem hiding this comment.
BTW, if freeCores < CPUS_PER_TASK, the code as fellow in resourceOffers() is inefficient since o.cores / CPUS_PER_TASK = 0val tasks = shuffledOffers.map(o => new ArrayBuffer[TaskDescription](o.cores / CPUS_PER_TASK)) val availableSlots = shuffledOffers.map(o => o.cores / CPUS_PER_TASK).sum
… CPUS_PER_TASK for better performance
srowen
commented
Oct 30, 2018
Yes, that is the comment I have been referring to. So it seems you can't filter, right? it's not scheduling work here. @jiangxb1987 do you know this part of the code? |
jiangxb1987
commented
Oct 30, 2018
What do you mean by "better performance" ? If that means we can spend less time on |
jiangxb1987
commented
Oct 30, 2018
It may happen that a busy executor is marked as lost and later it re-register to the driver, in that case currently we call |
Closesapache#22859Closesapache#22849Closesapache#22591Closesapache#22322Closesapache#22312Closesapache#19590Closesapache#22934 from wangyum/CloseStalePRs. Authored-by: Yuming Wang <yumwang@ebay.com> Signed-off-by: hyukjinkwon <gurwls223@apache.org>

What changes were proposed in this pull request?
we should filter the workOffers with freeCores>CPUS_PER_TASK for better performance
How was this patch tested?
Exist tests