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

Improve support for resource limits #140

Open
urosgruber opened this issue Mar 6, 2021 · 1 comment
Open

Improve support for resource limits #140

urosgruber opened this issue Mar 6, 2021 · 1 comment
Labels

Comments

@urosgruber
Copy link
Contributor

I was playing with set-rss today and notice just a few limits are implemented. Would be nice to have more support on this for example swapuse, vmemoryuse, openfiles, maxproc, pcpu, readbps, writebps etc. There are also different options for example to deny, throttle, log, devctl actions available for each of the resources.

I tried applying manually and for now it works but since pot already allow to set a few would be nice to have more. I've checked the syntax and I think it would make more sense to rewrite this feature to something like this

pot set-rss -p mypot -r swapuse -V 100M
pot set-rss -p mypot -r pcpu -V 20

In addition to that insted of specifying just a number for -V (value) we could have something like this
pot set-rss -p mypot -r pcpu -V 20:devctl

This would mean send notification to devd if CPU is used more than 20%. devd allow a lot more control and not just preventing resource to excede the limit.

What do you think? is this too much for pot to handle. A use case I have is customer services packed within jails and depending on service (nginx, mysql, etc.) different rules are applied. And I heavily use devctl since it can trigger internal script to log the message, stop the service, notify the customer etc.

@pizzamig
Copy link
Collaborator

Hi.
I'm very open to extend resource limits, racct is enabled by default for a while and it seems a good idea to extend it.
However, I'm strongly against pcpu: it just doesn't work as expected, especially for multi-thread applications.

Example: pcpu 100, application with 10 threads.
Application starts, the 10 threads will run 100%, causing a consumption of 1000.
Then racct kicks in and block the application (prevent to be scheduled) as long as the overall consumption is not back to 100.
And those 10 threads will consume the allocated pcpu really fast.
I tried it in the past and I decided to use cpuset instead (potcpu will take care of distributing jails over cpus), because it's not blocking applications, but it's gracefully reduce its performance

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

No branches or pull requests

2 participants