Well I am new to this forum and new to the lxcfs too and I am trying to use the lxcfs inside my docker-based container. I am expecting lxcfs to help provide me with correct information on the uptime and other container-specific information.
I am able to run the lxcfs (4.0.8) inside my container and I can see all values inside /var/lib/lxcfs/proc but when I invoke the uptime command, it shows me the uptime of my VM.
I am not able to specify the mount point of /var/lib/lxcfs/proc/uptime to /proc/uptime in my container manifest file it throws an error while starting the container. And the container hangs if I am performing the mount bind as follows:
mount -B /var/lib/lxcfs/proc/uptime /proc/uptime
Kindly suggest the right way to configure the lxcfs inside a docker container.
Thanks, @amikhalitsyn
It is my bad, I was somehow under the impression that lxcfs should be run inside the container and I was trying that. But, now I have corrected it now and run the lxcfs on my host VM and mount the lxcfs mounted fuse inside my docker container.
After this, I see the uptime & free commands are returning the correct values but I noticed /proc/cpuinfo still shows all CPUs info available on my host VM. I have used --cpuset-cpus while creating my docker container and allotted 1,2 CPUs to my container, so I am expecting on the docker shell I should see only 2 CPU info in /proc/cpuinfo
Can you please tell me, why it is not working as expected, am I doing anything wrong?
But if you really want to limit number of the CPU cores those are shown in /proc/cpuinfo you can run lxcfs with the --enable-cfs parameter. This should help.
Thanks for your response. I am using the cgroup-v1 environment. Can you please suggest, what can I do to fix the cpu & cpuacct related information on my containers? Is there a workaround/solution to fix it?