cpu limit not working.

sahostking

Renowned Member
so I created a new lxc container and set cores to 2 and cpu limit to 2.

The server itself has 64GB memory and 24 cores (12 core processors x 2 sockets)

However when this server is heavily tested and load goes up in top we see this on the node:

Code:
top - 08:34:49 up 10:55,  3 users,  load average: 129.91, 64.78, 29.97
Tasks: 607 total,  58 running, 548 sleeping,   0 stopped,   1 zombie
%Cpu0  :  81.3 us, 96.4 sy,  0.0 ni,  0.0 id,  0.7 wa,  0.0 hi,  0.7 si,  0.0 st
%Cpu1  :  97.3 us, 98.7 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu2  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu3  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu4  :  0.0 us,  0.0 sy,  0.0 ni, 99.7 id,  0.0 wa,  0.0 hi,  0.3 si,  0.0 st
%Cpu5  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu6  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu7  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu8  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu9  :  0.3 us,  0.7 sy,  0.0 ni, 99.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu10 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu11 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu12 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu13 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu14 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu15 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu16 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu17 :  0.0 us,  0.3 sy,  0.0 ni, 99.3 id,  0.0 wa,  0.0 hi,  0.3 si,  0.0 st
%Cpu18 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu19 :  0.3 us,  0.0 sy,  0.0 ni, 99.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu20 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu21 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu22 :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu23 :  0.3 us,  0.3 sy,  0.0 ni, 99.3 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  64394.2 total,  57300.3 free,   6002.7 used,   1091.2 buff/cache
MiB Swap:  65536.0 total,  62289.9 free,   3246.1 used.  57631.0 avail Mem

So why is the Node being affected so much and the load on the node going sky high where it is only using 2 cores.

Surely only the LXC container should have that type of load average?
 
Looks like the limit is working and only 2 CPUs(/cores/threads) are busy and everything else is idle and avaiable for other containers, VMs and the host. If the load is around 130 then there must be many processes in that container waiting for the CPU. I don't know what you are running inside the container but it wants to do much more than two cores can handle.

Configure the software inside it to not to do so much at the same time, which is what you would do if you it ran on the host itself. Or don't worry about the system load number if your approach is to simply limit the cores available to the container.
 
did that however the load average of the host still went up to 303 at one point.

Didnt think the host would be that affected by this. We run over 80 lxc servers on proxmox 6 however we now using proxmox 7 and I am starting to think its something in this version.
 
Server "load" (https://de.wikipedia.org/wiki/Load) is kind of "artifical" messurement. I goes up because of the CPU limit (more processes waiting for the CPU).

> Surely only the LXC container should have that type of load average?

The host see all processes from all containers, so it shows statistics from the sum of all processes.
 
Alright its just weird one vps can do this alone on a node on proxmox 7 where we have tons of others than dont on proxmox 6. Will reinstall and check
 

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!