LXCFS and load average

alitvak69

Renowned Member
Oct 2, 2015
105
3
83
Hello everyone,

I am using Proxmox 6.1 with containers and I noticed that all containers are getting load average lick from a host. I checked lxcfs site and found this news from last year.

https://discuss.linuxcontainers.org/t/lxcfs-3-1-2-has-been-released/5321

I installed the new lxcfs version on my boxes and started it with option -l

Code:
/usr/bin/lxcfs -l /var/lib/lxcfs/

I had to restart containers on those boxes to reconnect to /proc. I had pct container showing correct load average information:

13.97, 7.90, 5.85 on host
11.29, 3.57, 1.25 on the specific container

I tried it at my own risk and I am not suggesting everyone jump on it. I wonder though if Proxmox developers have any plans for lxcfs upgrade since the issue with monitoring in containers has been popping here and there for years. I know those old openvz containers had no such issue.
 
our lxcfs already includes the patch, no need to update to an unsupported newer version.
 
Fabian,

I understand but, it didn't work for me. I had the latest pve version of lxcfs and had load average in container the same as host. Which version of yours have the patch?
 
you still need to start with -l, since the feature is not enabled by default. all versions >= 3.03-pve1 should contain the patch.
 
that's normal. what does "dpkg --list lxcfs" output?
 
Hi Fabian,
thanks for fast answer , however i have solved my case and deleted my question same time when you posted reply :)
 
  • Like
Reactions: fabian
Hello all. I too would like to use the -l and --enable-cfs options for lxcfs, however, when I try, I get the message:
Code:
lxcfs.c: 1044: set_pidfile: PID file '/run/lxcfs.pid' is already locked

And nothing seems to change within the container after a restart.

What is the procedure for restarting lxcfs with options?

I tried stopping with systemctl, but then the lxcfs command prints some stuff and then seems to hang.

My end goal, like so many before me, is to get python's psutil working from within the container, be it ever so elusive. It is my understanding that lxcfs promises this may work. Indeed, as is, the memory info seems to be accurate, so I think it does what it says, I just have to figure out how to turn on these other options.

Sorry if it is an obvious linux/command line thing I should already know, I'm not yet a command line ninja.

Thanks for any help/insight.
 
I think I found a way...for anyone else on same issue or critique:

Edit this file:
Code:
/lib/systemd/system/lxcfs.service

On the ExecStart line modify and put the options in like:
Code:
ExecStart=/usr/bin/lxcfs -l --enable-cfs --enable-pidfd /var/lib/lxcfs

Then save, and when you try to restart lxcfs, it will complain saying that you have to:
Code:
systemctl daemon-reload

so do that then restart lxcfs service, then restart the container.

After that psutil is telling me the correct container cpu limit...although the cpupercent(percpu=True)still reports the host numbers...not sure about the load values yet. Maybe one day!
 
Last edited:
you should not edit units in /lib/systemd - there is /etc/systemd for that purpose. e.g., via systemctl edit lxcfs
 

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!