-
Notifications
You must be signed in to change notification settings - Fork 9.1k
YARN-6673 Add cpu cgroup configurations for opportunistic containers #232
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
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.
some minor comments, one question on cfs
@@ -72,6 +74,7 @@ | |||
static final int MIN_PERIOD_US = 1000; | |||
@VisibleForTesting | |||
static final int CPU_DEFAULT_WEIGHT = 1024; // set by kernel |
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.
Can we rename CPU_DEFAULT_WEIGHT to CPU_DEFAULT_WEIGHT_GUARANTEED for clarity?
String.valueOf(cpuShares)); | ||
ContainerTokenIdentifier id = container.getContainerTokenIdentifier(); | ||
if (id != null && id.getExecutionType() == | ||
ExecutionType.OPPORTUNISTIC) { |
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.
We can have a small method for reuse I think
boolean isOpportunistic(Container container) {
ContainerTokenIdentifier id = container.getContainerTokenIdentifier();
return id !=null && id.getExecutionType() == ExecutionType.OPPORTUNISTIC;
}
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.
Hmm this is just 2 lines of code. Adding a function would be at least 5 more lines. Ideally the container has this function but that might be too much churn for the interface.
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.
yeah. In some sense, it is to be more descriptive than code reuse. Maybe we could have an inline boolean variable with such name?
cGroupsHandler | ||
.updateCGroupParam(CPU, cgroupId, CGroupsHandler.CGROUP_CPU_SHARES, | ||
String.valueOf(cpuShares)); | ||
} | ||
if (strictResourceUsageMode) { |
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.
If strict resource usage mode is turned on, do we need to do differently for OPPORTUNISTIC containers? Now it bases the cfs_ configurations on vcore
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.
They still have a CPU setting, right? Or is it 0?
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.
They are currently based on vcore
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.
That is a maximum setting and it still needs to be set I think. Why would opportunistic containers have more resource than guaranteed one?
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.
Not quite get your question. What I meant initially was to ask you if you think base cfs-quota on vcore is the right thing to do.
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.
Yes, I think so. If the admin chooses strict cpu limits, all containers should get strict cpu limits based on vcores. Opportunistic ones still will be throttled by cpu.shares, if guaranteed are running. This is just a cap, for opportunistic containers with different thread counts not to affect each other negatively.
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 see. Thanks for the clarification.
ContainerId mockContainerId = mock(ContainerId.class); | ||
when(mockContainerId.toString()).thenReturn(id); | ||
|
||
cGroupsCpuResourceHandler.bootstrap(plugin, conf); |
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.
Can we move this above cGroupsCpuResourceHandler.prestart()?
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.
OKay.
… LocalityManager Author: Jacob Maes <[email protected]> Reviewers: Chris Pettitt <[email protected]> Closes apache#232 from jmakes/samza-1346
…Builder reports an issue with the container-executor (apache#7290) (apache#232) Change-Id: Iaaa94c8f46faa4feaede27de36e0d94483ae0229
YARN-6673 Add cpu cgroup configurations for opportunistic containers