CPU units

Bestbeast

Well-Known Member
Jul 29, 2016
163
5
58
29
Hello,

I am a bit confuse with this topic in openvz, I mean, I have read all openvz manuals and proxmox questions about this topic but they all talk that cpu units refers to the priority that you give to a container of the full cpu, the problem is that I do not assign the full cpu to my containers, I assign cores to them.
The problem now is to understand how can I manage cpu units to this:
example: I have assigned to a container 4 cores and to another one 8 cores, the problem is that if the 8 cores uses 100% of cpu the client with 4 cores will be affected.
What I wanted is that 4 cores are always available for the 2 containers, and if at any time some core is left the second client can use up to a maximum of 8 cores.
Do not know if assigning 500 and 1000 cpu units will be fine to manage this.

Can anyone help me?¿
Thanks
 
Please stop posting message without any content regarding the thread topic.
What?....
Bumping is to send the post up to see if someone can answer me, is not something new in forums....
And you instead of saying me that, being the proxmox support staff, could just answer to the problem....
 
"Bumping" is not needed and bad style, if you expect any help here, never do this.

All subscriber of this forum will get email notification about your "Bumps" and no, this will not help to get faster answers - instead, your useless traffic just increase the email and forum traffic for all of us and this is just a waste of time.

Not answered posts are regularly answered by our staff members.

Regarding your question:

Please note, OpenVZ is already EOL on Proxmox VE, therefore the user base is very small and all moved already to LXC.
https://forum.proxmox.com/threads/proxmox-ve-3-4-support-lifecycle.26206/

For CPU limitation on LXC, see:
https://pve.proxmox.com/wiki/Linux_Container#pct_settings
 
Yes but it continues without helping me, cpu limit, limits the cores to the number you introduce, but they can not get more than that if there is a bit of resources left on the machine. I wanted to limit the cpu to half like I said for example 8vcores, to 8*0.5=4 vcores and if there is any core left that can be used by this user at a particular time that he can use it
 
We do not provide a way to do what you're asking. Generally in the scenario above the 8-core container will not steal all the cpu time from the 4-core container, it'll depend on various factors. For example process nice-level and cpu-shares will affect this.
The thing is, there's no notion of virtual cores when it comes to containers. Containers are real processes running under the host's kernel. As such there are only real cores, cpu quotas, cpu shares and niceness involved as well as various other parameters usable to fine tune the scheduler.
Note that you can have similar issues with VMs. If you give 8 cores to one VM and 4 cores to another while only having 8 cores in total, they'll be fighting over them as well, and in general you'll have similar options to resolve this.
Providing complete control over all the possible sysctl and cgroup values affecting scheduling would be very complex and way out of scope of PVE.
 
We do not provide a way to do what you're asking. Generally in the scenario above the 8-core container will not steal all the cpu time from the 4-core container, it'll depend on various factors. For example process nice-level and cpu-shares will affect this.
The thing is, there's no notion of virtual cores when it comes to containers. Containers are real processes running under the host's kernel. As such there are only real cores, cpu quotas, cpu shares and niceness involved as well as various other parameters usable to fine tune the scheduler.
Note that you can have similar issues with VMs. If you give 8 cores to one VM and 4 cores to another while only having 8 cores in total, they'll be fighting over them as well, and in general you'll have similar options to resolve this.
Providing complete control over all the possible sysctl and cgroup values affecting scheduling would be very complex and way out of scope of PVE.
In the example you last told me:
If you give 8 cores to one VM and 4 cores to another while only having 8 cores in total, they'll be fighting over them as well, and in general you'll have similar options to resolve this.
If I give half priority to 8vcores, then the 4vcores one could have 100% and the 8vcores one 50% no?
Something like that I need
 
You could experiment with setting `lxc.cgroup.cpu.shares`, this gives you a relative "weight" of a cgroup compared to others, basically defines a "ratio" of how much time a container gets compared to another container when both are actively using the cpu. This does not affect the quota or core count, so it might be what you're looking for. The default is 1024.
 
You could experiment with setting `lxc.cgroup.cpu.shares`, this gives you a relative "weight" of a cgroup compared to others, basically defines a "ratio" of how much time a container gets compared to another container when both are actively using the cpu. This does not affect the quota or core count, so it might be what you're looking for. The default is 1024.
Well I was actually using openvz xD
 
Right... uh... then I'm out of ideas there. You could upgrade though ;-)
 

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!