LXC: cpu.allowance ?

guyman

Active Member
Jan 2, 2014
26
1
43
Hi, I am wondering whether there is an option beside the amount of Cores to use
cpu.allowance from LXC to limit to n % of CPU in total. In the interface and API, I did not find any option for this. Is there a roadmap topic for this?

And a 2nd question. If I have a total of 50 Cores, and setup 10 LXC Containers with 12 Cores in use, I would have 120 Cores reserved (beside I only would have 50 on hardware), so is is this possible and working to reserve more resources if they are available / free on the time they are requested?

Thank you!
 
This section in the wiki may give you an idea of what is possible. Specifically, these papragraphs:

cpulimit:
You can use this option to further limit assigned CPU time. Please note that this is a floating point number, so it is perfectly valid to assign two cores to a container, but restrict overall CPU consumption to half a core.

and

cpuunits:
This is a relative weight passed to the kernel scheduler. The larger the number is, the more CPU time this container gets. Number is relative to the weights of all the other running containers. The default is 1024. You can use this setting to prioritize some containers.

Also, AFAIK, you can over-allocate cpu cores as long as all your VMs do not demand the full quota at once. If they do your server will grind to a crawl.
 
cpulimit:
You can use this option to further limit assigned CPU time. Please note that this is a floating point number, so it is perfectly valid to assign two cores to a container, but restrict overall CPU consumption to half a core.

I know this cpu limit options, but however, in LXC there is a setting like this:

lxc config set container limits.cpu.allowance 20%

This option I do miss here. :)
 
I know this cpu limit options, but however, in LXC there is a setting like this:

lxc config set container limits.cpu.allowance 20%

This option I do miss here. :)

Those options are basically the same, only the name is different...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!