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

Resource requests and limits #22

Open
miekg opened this issue Dec 21, 2020 · 5 comments
Open

Resource requests and limits #22

miekg opened this issue Dec 21, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@miekg
Copy link
Collaborator

miekg commented Dec 21, 2020

systemd has both mem and cpu accounting. The memory is specified in bytes and can be used from the podspec as is. The cpu however is done differently than in k8s. See https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html

The problem is how to translate the cpu in the podspec into systemd values.

@pires pires changed the title Accounting Resource requests and limits Jan 11, 2021
@pires pires added the enhancement New feature or request label Jan 11, 2021
@pires
Copy link
Member

pires commented Jan 11, 2021

Here's the possible formats for Pod CPU resource requests and limits:

  • an integer value, such as 2
  • a fraction, such as 0.1
  • an integer value in millis, such as 500m

All formats can be present in the same Pod spec and are directly translatable to milliseconds, which is supported by CPUQuotaPeriodSec, eg:

  • 2 == 2.0 == 2000m
  • 0.1 == 100m

Do you see any limitation of just going w/ that attribute?

@miekg
Copy link
Collaborator Author

miekg commented Jan 11, 2021 via email

@pires
Copy link
Member

pires commented Jan 11, 2021

Actually, I got it wrong when it comes to systemd primitives. CPUQuota is the field to use and it supports percentage alone. The conversion should be trivial, though.

Now, this only covers resource limits and not requests.

@miekg
Copy link
Collaborator Author

miekg commented Jan 11, 2021 via email

@pires
Copy link
Member

pires commented Jan 11, 2021

One problem I see is that it seems that enabling accounting for one slice means parent and child slices are affected too which may not be desirable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants