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

jail resource allocation report #16

Open
cneira opened this issue Sep 7, 2020 · 2 comments
Open

jail resource allocation report #16

cneira opened this issue Sep 7, 2020 · 2 comments
Labels
enhancement New feature or request kernel

Comments

@cneira
Copy link
Owner

cneira commented Sep 7, 2020

Currently running top inside a jail, it will report the host total memory instead of the memory allowed for the jail to use.
nomads need to know how much memory is currently the container using to be able to calculate
to which node the allocation will be send.
This is not a problem on illumos as a zone has it own memory counter to keep track of this.

@cneira cneira added enhancement New feature or request kernel labels Sep 7, 2020
@Crest
Copy link

Crest commented Jul 21, 2023

FreeBSD does have rctl(8) (it has to be enabled by setting the kern.racct.enable loader tunable to 1 from /boot/loader.conf). The mechanism to apply resource limits to jails is compiled into the default FreeBSD kernel configuration. What's missing is the of glue logic to update the resource limit database through the task driver.

@cneira
Copy link
Owner Author

cneira commented Jul 21, 2023

FreeBSD does have rctl(8) (it has to be enabled by setting the kern.racct.enable loader tunable to 1 from /boot/loader.conf). The mechanism to apply resource limits to jails is compiled into the default FreeBSD kernel configuration. What's missing is the of glue logic to update the resource limit database through the task driver.

The problem is not resource limits, resource limits do work. To notice the problem just create jail cap memory to 1GB, then login inside the jail and execute top, there you will see the whole host memory amount instead of the 1GB that the jail was provisioned with, work must be done in the kernel to add vmmeter per jail, I started a while ago to do it but have not the motivation to go further to completion here is what I had at the moment :

https://gitlab.com/cneira1/freebsd/-/commit/cae3ff52b58c932effcd91e82c644e16d9ded604

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

No branches or pull requests

2 participants