Skip to content

Conversation

miklosszegedi
Copy link
Contributor

YARN-6673 Add cpu cgroup configurations for opportunistic containers

Copy link
Contributor

@haibchen haibchen left a 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

Copy link
Contributor

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?

Copy link
Contributor

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;
}

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OKay.

shanthoosh pushed a commit to shanthoosh/hadoop that referenced this pull request Oct 15, 2019
… LocalityManager

Author: Jacob Maes <[email protected]>

Reviewers: Chris Pettitt <[email protected]>

Closes apache#232 from jmakes/samza-1346
susheelgupta7 pushed a commit to susheel-gupta/hadoop that referenced this pull request Apr 30, 2025
…Builder reports an issue with the container-executor (apache#7290) (apache#232)

Change-Id: Iaaa94c8f46faa4feaede27de36e0d94483ae0229
steveloughran pushed a commit to steveloughran/hadoop that referenced this pull request Aug 5, 2025
…Builder reports an issue with the container-executor (apache#7290) (apache#232) (apache#243)

Change-Id: Iaaa94c8f46faa4feaede27de36e0d94483ae0229
(cherry picked from commit e6ad8c4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants