LXC - Giving absolut maximum cpu

Egner

Renowned Member
Aug 2, 2015
96
1
73
Hi,

Is the value cpu units = 0 , the best option to get the server all performance from the cpu with no limits of using?

Best regards
Egner
 
Hi,

cpu limits = 0 is all cpus

the cpu units is the weighting.
 
I don't understand what you meant exactly.

I understand that the cpu limit is regulates the cpu cores to the container.

But for an example i want to have 3 cores and give this container full availability to get all cpu resources from this 3 cores physical then i believe that the cpu units should be at the value = 0 ?
 
cpu limit = "Limit of CPU usage. Note if the computer has 2 CPUs, it has total of '2' CPU time. Value '0' indicates no CPU limit."
cpu units = "CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs.
NOTE: You can disable fair-scheduler configuration by setting this to 0."
 
What does the CPU time exactly means ?

Is it the maximum time of seconds a application can going for 100% cpu usage?
 
No. It is a "weight".
You have 3 CTs:
- cpu units 1000
- cpu units 2000
- cpu units 1000

First one will have 25% of CPU time, 2nd 50%, 3rd 25%. This applies relative to full load only. If the machine is idle, it doesn't matter.

Think of them as a lottery. The more tickets you buy (cpu units), the more chances to win you have. The only difference is that in kernel scheduler you always win and the prizes are distributed based on the number of tickets.
 
OK, thank you for the answer.

So if i running this in production the best option for med will then be disable Kernel Scheduler to not have any impact of my containers that needed full CPU usage?

Best regards.
 
No, you didn't understand. With fair scheduler, two containers at 100% will have very close to 50% of the host each. Without it, the results may be far away from 50%/each.

Again, this scheduling makes sense in a resource (CPU) scarcity context. The fair scheduler will try to allocate fair CPU quantas to each container, just like the process scheduler does it for system processes.

If the total CPU load is <100% it has no impact.

If you have some containers that need maximum performance in a full load context, then you will need to set their units to a higher value than that of the containers that have a lower priority.

Disabling scheduling when you NEED scheduling (e.g. max performance of some containers) is a wrong choice.

This is not an artificial performance bottleneck for your containers. It is a needed feature if you care about performance.

Re-reading your original question makes me say that you are in the same place, so the best way would be not to touch it and find if you really need it in real life.
 
I believe if i just turn the Kernel scheduler off the server can use how mush they actually wants but after your story it seems not to be the right choice.

What will be a good option of configuration for my servers be then?

I using transcoding video material and expecting problems with ffmpeg and cpu units.

What will be a good suggestion for values to getting the best performance out from the box?

running today three ffmpeg convert machines and 4 nginx server on each node.

Best Regards
 

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!