LXC loadavg

mailinglists

Well-Known Member
Mar 14, 2012
454
41
48
By the looks of things in mailing list it seems like this patch was included today.
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
1,746
185
63
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.
 

harvie

Member
Apr 5, 2017
117
16
23
30
So this will be turned off by default? I think it would make sense to enable it by default in proxmox use case.
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
1,746
185
63
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.
 

harvie

Member
Apr 5, 2017
117
16
23
30
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.
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
1,746
185
63
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.
 

harvie

Member
Apr 5, 2017
117
16
23
30
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.
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
1,746
185
63
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.
 

harvie

Member
Apr 5, 2017
117
16
23
30
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...
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
1,746
185
63
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.
 

harvie

Member
Apr 5, 2017
117
16
23
30
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.
 

harvie

Member
Apr 5, 2017
117
16
23
30
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:

sahostking

Active Member
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 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 your own in 60 seconds.

Buy now!