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

Add note to starvation docs re: cpus in k8s #3750

Merged
merged 6 commits into from
Nov 23, 2023

Conversation

Daenyth
Copy link
Contributor

@Daenyth Daenyth commented Jul 14, 2023

This is a common "gotcha" when running in k8s.
Ideally we could automatically detect this environment in the CE runtime itself on initialization and warn the user proactively, but at least this gives people something to ctrl-f for in the doc

@@ -434,7 +442,7 @@ If this is not possible, the next-best approach is to rely on a circular buffer.

> This scenario is specific to Kubernetes, Amazon ECS, and similar resource-controlled containerized deployments.

In many Docker clusters, it is relatively standard practice to over-provision CPU credits by some factor (even 100% over-provisioning is quite common). What this effectively means is that the container environment will promise (or at least *allow*) *m* applications access to *n* vCPUs each, despite only *(m * n) / (1 + k)* CPUs being physically present across the underlying hardware cluster. In this equation, *k* is the over-provisioning factor, often referred to as "burst credits".
In many Docker clusters, it is relatively standard practice to over-provision CPU credits by some factor (even 100% over-provisioning is quite common). What this effectively means is that the container environment will promise (or at least *allow*) *m* applications access to *n* vCPUs each, despite only *(m* n) / (1 + k)*CPUs being physically present across the underlying hardware cluster. In this equation,*k* is the over-provisioning factor, often referred to as "burst credits".
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we want the spaces removed from *(m * n) / (1 + k)* CPUs, it looks like the formatting takes over the multiplication

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh drat, yeah I didn't even touch that - it's just the file formatting. I'll fix it

@Daenyth
Copy link
Contributor Author

Daenyth commented Jul 14, 2023

Before this gets merged I want to add some wording about overriding the thread count in IOApp for cases where you really do want your k8s pod to have <=1 cpu

@armanbilge
Copy link
Member

drive-by-dropping a link to more material we should incorporate

https://discord.com/channels/632277896739946517/839263556754472990/1135955773613146152

@samspills
Copy link
Contributor

going to close and reopen b/c I think that's what's needed to get the updated CI workflows

@samspills samspills closed this Aug 4, 2023
@samspills samspills reopened this Aug 4, 2023
@samspills
Copy link
Contributor

nope I appear to have been wrong about that womp womp

@armanbilge
Copy link
Member

nope I appear to have been wrong about tha

We merged your fix to 3.5.x, but this PR is targeting 3.x. Actually this PR could target 3.5.x.

@TimWSpence TimWSpence changed the base branch from series/3.x to series/3.5.x August 14, 2023 09:21
@TimWSpence
Copy link
Member

Woops just changing the target branch is not sufficient 🤦‍♂️

@TimWSpence TimWSpence changed the base branch from series/3.5.x to series/3.x August 14, 2023 09:23
Daenyth and others added 2 commits August 14, 2023 16:53
This is a common "gotcha" when running in k8s.
Ideally we could automatically detect this environment in the CE runtime itself
on initialization and warn the user proactively, but at least this gives people
something to ctrl-f for in the doc
@TimWSpence TimWSpence changed the base branch from series/3.x to series/3.5.x August 14, 2023 15:57
@TimWSpence TimWSpence closed this Aug 14, 2023
@TimWSpence TimWSpence reopened this Aug 14, 2023
docs/core/starvation-and-tuning.md Outdated Show resolved Hide resolved
docs/core/starvation-and-tuning.md Outdated Show resolved Hide resolved
docs/core/starvation-and-tuning.md Outdated Show resolved Hide resolved
docs/core/starvation-and-tuning.md Outdated Show resolved Hide resolved
@djspiewak djspiewak merged commit 0467809 into typelevel:series/3.5.x Nov 23, 2023
36 checks passed
@Daenyth Daenyth deleted the k8s-cpus branch November 27, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants