Skip to content
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

[PLAT-713] Allow the CFS period to be tuned for containers #1

Closed
wants to merge 1 commit into from

Conversation

obeattie
Copy link

@obeattie obeattie commented Aug 10, 2017

Kubernetes' inbuilt resource limits allow control over the maximum CPU bandwidth a container can consume. "Under the hood," this is achieved by setting cpu.cfs_quota on a container's cgroup. We have been setting these limits for most of our deployments, and they are effective at preventing "greedy" containers from negatively impacting the performance of other co-located containers 👮

However, when a container gets throttled, it is unable to run on the CPU again until the end of the "throttling period." (See golang/go#19378.) The length of this period is controlled by the cpu. cfs_period_us parameter and is currently set statically to 100ms. Services on the "serving path" tend to be very latency sensitive – effectively being paused for 100ms is extremely detrimental to performance and can lead to very high tail latencies.

This change makes this period configurable by way of a monzo.com/cpu-period parameter in a container's resource limits, specified in microseconds.

Copy link

@guillaumebreton guillaumebreton left a comment

Choose a reason for hiding this comment

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

A minor typo. Very interesting PR, LGTM 👍

)

// MilliCPUToQuota converts milliCPU to CFS quota and period values.
func MilliCPUToQuota(milliCPU int64) (quota int64, period int64) {
// MilliCPUToQuota takes milliCPU (along with a CFS period, in usec) and retuns

Choose a reason for hiding this comment

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

typo : retuns returns

@obeattie
Copy link
Author

Merged into release/1.7 instead.

@obeattie obeattie closed this Aug 23, 2017
@obeattie obeattie deleted the cfs-period branch August 23, 2017 10:43
jackkleeman pushed a commit that referenced this pull request Feb 14, 2019
update from base repository
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