LXC loadavg

There's a patch available on the mailing list, which should get packaged soon. This behaviour still can't be changed during runtime yet, I will see about making a pull request upstream to make it possible. In the meantime, it is possible to change the systemd service file to include the -l flag, restart all containers and lxcfs service to get it functioning.
 
So this will be turned off by default? I think it would make sense to enable it by default in proxmox use case.
 
So this will be turned off by default? I think it would make sense to enable it by default in proxmox use case

The upstream version is an opt-in now, probably because it's a new feature.

We will have to decide how to implement this in Proxmox.
 
Is there reason for not enabling this by default in proxmox? I understand that some LXC users do not use LXC as VPS (eg. docker,...), but since proxmox is container based VPS implementation it makes sense to have as much isolation as possible.
 
but since proxmox is container based VPS implementation it makes sense to have as much isolation as possible.

This feature doesn't add to the isolation at all. `sysinfo()` will return the host information even when in a container.
 
This feature doesn't add to the isolation at all. `sysinfo()` will return the host information even when in a container.

masking loadavg is not really about security... at least in my case. it's more about creating best possible illusion of separate server.
 
  • Like
Reactions: Dunuin
This is now resolved. Whether to enable it default or not, will be decided later.

Willing users can enable this behaviour by editing:

Code:
/lib/systemd/system/lxcfs.service

and by adding the `-l` flag in ExecStart. Then restart service and containers.
 
and by adding the `-l` flag in ExecStart. Then restart service and containers.

I've just upgraded and in man lxcfs i don't see the -l flag. I guess it's still in pvetest repository and waiting to get to stable repos? I don't really know how proxmox releases are done...
 
I guess it's still in pvetest repository and waiting to get to stable repos? I don't really know how proxmox releases are done...
It is in pve-no-subscription

If you are using enterprise repository, it's not there yet.
 
Yes. Now it showed up. I think it was cached somewhere... When i've been trying few hours ago i did apt update and dist-upgrade and it didn't updated lxcfs... Now it did. Thanks for support. I will try it now.
 
I tested and it seems to work as expected! At least in w, htop and nagios nrpe check_load it reports proper values. Thats great!

Now i wonder if there's proper way for the -l parameter to survive upgrade of lxcfs package...

update: it can be done using systemd overrides:

execute systemctl edit lxcfs

type following and save the file:

[Service]
ExecStart=
ExecStart=/usr/bin/lxcfs -l /var/lib/lxcfs/

this will get automaticaly saved to /etc/systemd/system/lxcfs.service.d/override.conf file
note that the ExecStart= line deletes original definition, otherwise there would be two ExecStart statements after override is applied
to revert to default execute systemctl revert lxcfs
 
Last edited:
I tested and it seems to work as expected! At least in w, htop and nagios nrpe check_load it reports proper values. Thats great!

Now i wonder if there's proper way for the -l parameter to survive upgrade of lxcfs package...

update: it can be done using systemd overrides:

execute systemctl edit lxcfs

type following and save the file:

[Service]
ExecStart=
ExecStart=/usr/bin/lxcfs -l /var/lib/lxcfs/

this will get automaticaly saved to /etc/systemd/system/lxcfs.service.d/override.conf file
note that the ExecStart= line deletes original definition, otherwise there would be two ExecStart statements after override is applied
to revert to default execute systemctl revert lxcfs

Finally I can move back to proxmox from solusvm :) LXC was hell without loadavg not working but finally it is.

I just tested this out on a test server using cpanel test box and using "stress" - https://www.tecmint.com/linux-cpu-load-stress-test-with-stress-ng-tool/

and it works perfectly :)

Thank you thank you thank you
 

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!