-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-6350][Mesos] Make mesosExecutorCores configurable in mesos "fine-grained" mode #5063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jongyoul
commented
Mar 17, 2015
- Defined executorCores from "spark.mesos.executor.cores"
- Changed the amount of mesosExecutor's cores to executorCores.
- Added new configuration option on running-on-mesos.md
Test build #28706 has finished for PR 5063 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is already a spark.executor.cores configuration, why not just use that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought spark.executor.cores means the number of cores per executor on yarn mode, and it's confused that one configuration makes different meaning whenever I choose a different cluster manager. Do you think spark.executor.cores is reasonable and clear? I also think less configuration options are better. I just try not to confuse when I configure setting.
updated by @sryza's comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spark.executor.cores
means the number of cores per executor in YARN mode.
@sryza Thanks. Do you think it is reasonable to use |
Thanks for the clarification @sryza, thinking about it more it does has a different meaning in Mesos, since it's just the cpu for Mesos executor. I originally want to reuse it since the configuration flag name implies it's scheudler agnostic, but in reality it's only used in YARN. I think we should stick with what @jongyul is proposing with spark.mesos prefix. |
Are you saying that the new configuration option controls the number of cores allocated to the executor by Mesos not for use by tasks? Or is it that the executor can go above the configured number but never below it? In either case, I don't think it's a good idea to make this Mesos-specific. In theory we might want to add something similar for Spark on YARN later. If it's the former, maybe something like |
@sryza I mean the former one. I agree to your opinion of |
It is cores allocated for the custom executor that Spark launches with Mesos. |
Test build #28787 has finished for PR 5063 at commit
|
We can also consider more describing config option, like spark.mesos.noOfAllocatedCoresPerExecutor ... |
I'd like to better understand the reason this is needed in Mesos fine-grained mode. We've talked about eventually adding a fine-grained mode for YARN as well. So if we think this configuration property might apply there as well, it'd be nice to make it generic. Otherwise, putting Mesos in the name seems fine. Why do we set aside a core for the framework? Is this just a quirk of Mesos or is the idea that the executor process actually needs a full core for its non-task work? |
Hi @sryza @jongyoul, Lets say processing each minute takes 10 seconds. At the end of the day you will end up with 100 cores reservation on Mesos that will be there as long as streaming applications are running. (and the executor most probably are not doing any useful work most of the time). Currently there is no way to tweak how many cores it is given to executor, u may even think u can just assign 0.1 CPU for better utilization of resources. Let me know what do u think |
@elyast It's enough to explain why we can set this property. @sryza This feature exists only in Mesos mode now. How about setting this property specified in Mesos now, and changing it later if any of cluster will use this property? I don't thinks It's not generic now, but It is needed in Mesos absolutely. I recommend the property name of |
@sryza I believe this setting is a bit unique for Mesos. I think it's better to clarify the terminology here, of what does framework and executor means for Mesos. In mesos a scheduler is the process which registers with Master to receives offers, and use these offers to launch tasks through the master and eventually the slave. An executor is responsible for actually launching a task and reporting task statuses that is launched on the slaves, which either is a custom executor that fine-grain mode uses or the default mesos executor that coarse-grain mode uses. And a framework is referring to the overall scheduler + executor. So in the Mesos fine-grain case, we have an custom executor that is only launched once per slave, and that running executor takes up some cpu/mem itself. IMO I think calling it spark.mesos.executor.cores is fine enough, I wouldn't put framework in there as framework is not the right terminology. |
Test build #28959 timed out for PR 5063 at commit |
I see. So frameworkCores isn't ideal because "framework" already has a meaning in the Mesos world. Also, "executor" already has some inherent ambiguity because Mesos uses it differently than Spark. So I'm still somewhat confused by the need for such a property (and this might still be stemming from me not understanding about how Spark Mesos integration works). If my understanding is correct, the cores included in |
@sryza I don't think it actually need more than a single core, the issue is you cannot give less than 1 CPU. |
Jekins, retest this please |
I rebased this from master |
Jenkins, retest this please |
Test build #28974 has finished for PR 5063 at commit
|
Test build #28971 has finished for PR 5063 at commit
|
@elyast can you explain what you mean in a little more detail? Are you saying that the patch somehow enables users to request fractional cores? |
@sryza you can request from Mesos fraction of CPU, however I haven't realized that we have wrong type in this patch, we should change it to Double instead of Int. |
@sryza When creating a Mesos Task, one usually define the resources required for the execution of the task and the resources required to run the Mesos executor. Again the executor role is initiate executing the task and report task statuses, but can do anything else if it's a custom executor provided by the user. (You can skip defining executor where Mesos provides a default one and also add a default resource padding for the default one). In Spark fine-grain mode we do have a custom executor in org.apache.spark.executor.MesosExecutorBackend, and cores assigned is just for running this executor alone which is running one per slave per app (it can run mulitple Spark tasks). |
Fractional is definitely supported, since it's just cpu shares in the end. We should make it a double |
@tnachen I see, but, It's a little big change because other frameworks doesn't consider the amount totalCores as fractional value, so, we should change |
@sryza @tnachen just so I understand, doesn't |
My understanding based on the discussion here is that Did you look at the documentation for the new property? If this wasn't clear, then we should probably update the doc with a better explanation or link to relevant Mesos doc. |
What @sryza said is correct. spark.mesos.executor.cores is different than spark.executor.cores, as it's only the cpu cores used for the mesos executor, which is used to launch Spark executors and those executors are tied to tasks and have its own cpu allocation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable should be renamed mesosExecutorCores
. In Spark, whenever we see the word "executor" we automatically think of Spark executors. Just having executorCores
here is somewhat misleading.
Also, I know the rest of this file doesn't do this, but can you make this private[mesos]
so it's clear that it's only read within this package?
I talked to @sryza and @tnachen offline about the potential sources of confusion here. It seems that this code used to mistakenly use I left a more detailed comment about why the name @jongyoul The intended change in behavior here LGTM. Once you address the wording / naming comments I left I will go ahead and merge this. |
@andrewor14 Thanks for overall reviewing. I'll handle what you issue. |
…ne-grained" mode - Defined executorCores from "spark.mesos.executor.cores" - Changed the amount of mesosExecutor's cores to executorCores. - Added new configuration option on running-on-mesos.md
…ne-grained" mode - Changed configruation name and description from "spark.mesos.executor.cores" to "spark.executor.frameworkCores"
…esos "fine-grained" mode" This reverts commit da3caa6a062d7dd59875b3f8b83febe0c95f5c1e.
…eir classes - Change available resources of cpus to integer value beacuse WorkerOffer support the amount cpus as integer value
…eir classes - Fixed Mesos*Suite for supporting integer WorkerOffers - Fixed Documentation
…eir classes - Removed TODO
…eir classes - Fixed docs
…ne-grained" mode - Fixed docs
…ne-grained" mode - Fixed docs
…ne-grained" mode - Fixed docs
I've rebased it from current master at first. |
…ne-grained" mode - Fixed docs - Changed configuration name - Made mesosExecutorCores private
Test build #30419 has finished for PR 5063 at commit
|
Test build #30418 has finished for PR 5063 at commit
|
Jenkins, retest this please. |
Test build #30448 has finished for PR 5063 at commit
|
@andrewor14 I've fixed what you issue. Please review and merge this. |
LGTM I'm merging this into master finally thanks everyone. |