LXC containers shows host's load average

we don't want to carry a delta comparted to the upstream kernel(s) like that - it's a slippery slope that ends up with another openvz patchset that never gets upstreamed. it would need to be something with realistic chances of getting included upstream, and people driving that inclusion.
 
I just realized I have this same problem.

The VPS when I do top shows:

0.48

But in CPanel it puts more than 10 points.

What can I do to solve it?

Greetings!
 
I just realized I have this same problem.

The VPS when I do top shows:

0.48

But in CPanel it puts more than 10 points.

What can I do to solve it?

Greetings!

Here's what I got back from cPanel when I asked them about it:

Hello,

Thank you greatly for your patience while I investigated this issue further. I was able to note the mentioned discrepancy when comparing the load average displayed within the WHM user interface and the load average from the command line.

While investigating this issue I noticed that the server is running CentOS 7 as the guest. Our installation guide for Linux Containers strongly recommends using CentOS 6 as the guest and notes additional steps required for using CentOS 7 as a guest.

What kind of operating system is being run on the host node? Have the additional steps from our documentation been performed?

I've included our documentation for Linux Containers below for review:

https://documentation.cpanel.net/display/84Docs/Linux+Containers

Please note that this issue does not look to be caused by or related to cPanel or the cPanel-bundled software. We want everyone who uses cPanel to have an amazing experience, both with our software and our support. Sometimes that means pointing you to an expert about your particular problem if it is not a cPanel-related issue.

We will be here on standby awaiting your update. Please let me know if you have any additional questions or concerns regarding this issue.

Thanks,

--
Ryland Robertson
Technical Analyst II
cPanel, L.L.C.

I didn't bother pushing more past that point. If you feel like contacting them and pushing, maybe open a feature request and link it here? I'm sure others will come...
 
Here's what I got back from cPanel when I asked them about it:



I didn't bother pushing more past that point. If you feel like contacting them and pushing, maybe open a feature request and link it here? I'm sure others will come...

I just received this message from CPanel:

Our installation guide for Linux Containers strongly recommends using CentOS 6 as the guest and notes additional steps required for using CentOS 7 as a guest.

What kind of operating system is being run on the host node? Have the additional steps from our documentation been performed?

I've included our documentation for Linux Containers below for review:

https://documentation.cpanel.net/display/84Docs/Linux+Containers

Please note that this issue does not look to be caused by or related to cPanel or the cPanel-bundled software. We want everyone who uses cPanel to have an amazing experience, both with our software and our support. Sometimes that means pointing you to an expert about your particular problem if it is not a cPanel-related issue.


I don't quite understand what they indicate. I mean, I see what they say needs to be configured, but I don't know where I should do it. Anyone with more experience to help? :D

Thank you!
 
Hello!

perhaps this can be useful. Our servers are running the same pve-manager and lxcfs as yours, and after the change to the /lib/systemd/system/lxcfs.service they still give the correct load.


Hope it can help.

Best regards,

Juan.

Thanks very much. This is great!
As a side note, be aware when you restart lxcfs service all the containers are not able to access /proc filesystem, so it is much better to do this once you have shutted down all the containers and not which all of them running.
 
Hi all
After having the same problem and fixing it as described in this post, now i have the opposite one; the load inside the container is propagated to the host.

I have a 4 cpu container which launches 70 threads, most of them waiting for cpu to be available. The container is using the 4 cpus 100%, and the load inside the container is between 40 and 50, clearly showing the number of processes waiting.

However i did not expect this value to be passed to the host server, the same way a KVM machine does not pass his load to the host server. Although it is totally correct from the load definition, as the host server is seeeing 50-60 process waiting, the fact is they are deliberately contained as per container resources definition and imho should not affect the main server load.

i assume most of us use the load of the server as an indication of their state, but in this case the load is misleading. Is this any way to hide the lxc load from the host?

I plan to deploy a several containers like this always counting, even oversuscribing cpu usage but i am missing a good indicator then about how the host server is performing
 
that's how load works, and is one of the reasons why it's a rather poor metric to understand what's going on on a given system ;)
 
After Upgrade to Proxmox 7 the -l Trick (https://bugzilla.proxmox.com/show_bug.cgi?id=1870) dont work anymore.
My lxcfs is started with the -l Parameter:
Code:
ps | grep lxcfs
root        1273  0.2  0.0 1372520 4472 ?        Ssl  14:15   0:06 /usr/bin/lxcfs -l /var/lib/lxcfs/
but the Containers shows the Host Load.
Did you reboot?
It works with a reboot over here.

cat /lib/systemd/system/lxcfs.service

Code:
[Unit]
Description=FUSE filesystem for LXC
ConditionVirtualization=!container
Before=lxc.service
Documentation=man:lxcfs(1)

[Service]
ExecStart=/usr/bin/lxcfs /var/lib/lxcfs -l
KillMode=process
Restart=on-failure
ExecStopPost=-/bin/fusermount -u /var/lib/lxcfs
Delegate=yes
ExecReload=/bin/kill -USR1 $MAINPID

[Install]
WantedBy=multi-user.target

Host load avg: 1.10 2.01 1.59
PCT load avg: 0.10 0.19 0.10
 
Last edited:
Yes of course i rebootet. And yes i was not clear enough. The Load avg is correct but the cpu usage (sed -n 's/^cpu\s//p' /proc/stat) is from the Host. And that was correct on 6.4 and shows the CPU Usage from the Container.
 
Yes of course i rebootet. And yes i was not clear enough. The Load avg is correct but the cpu usage (sed -n 's/^cpu\s//p' /proc/stat) is from the Host. And that was correct on 6.4 and shows the CPU Usage from the Container.
You are right, my machine shows the same behavior.
Load average seems accurate per container, but CPU shows one of the host CPU load instead of the LXC CPU load.
It did work with the latest 6.4 version for me as well, but doesn't work anymore with 7.
 
  • Like
Reactions: loomes
Hello,
same for me, since the upgrade to 7 the top show the CPU usage of the host and not the container. It worked in 6.4
Is there another way to simply get the CPU usage of a container inside it. Or is it a bug?
 
Dont know if its a bug. No one from the Proxmox Team responded to this Thread for Months.
 
Yeap.... feb. 2022 by now and did all the tricks in this thread. Containers are still showing host cpu usage (ver. 7.1-10). I checked in htop and via snmp as well.
I find quite annoying, in monitoring you never now if a container is misbehaving...
 
Same here. Will this ever get logical fixed?
 
I am seeing the same issue on PVE7 , load avg. is correct but it shows host node CPU usage.


Considering Proxmox 6 is reaching EOL next month, I hope they provide a fix/patch soon.
 
Jup, also would like to see that working. I monitor all my guests using zabbix agents and I basically can only monitor filesystems and network interfaces in LXCs because CPU and RAM metrics show wrong results, so unlike with VMs there is noting warning me when the load is too high or RAM is running out of space.

I know that the staff told us in another thread that monitoring software could read the correct CPU and RAM usage when reading it from the right place, but looks like no monitoring software cares about that.
 
Last edited:

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!