🐞 Bug: CPU and RAM usage in an LXC container is incorrect.
Bug Description
The CPU and RAM usage in an LXC container are incorrect. The system overview displays the Host values instead of the LXC values.
The values for the Docker engine part are good.
Steps To Reproduce
- Add an Arcade environment located in an LXC
- Go to Dashboard / System Overview of the env and check CPU and RAM usage.
Expected Behavior
The system overview for the environment should display the LXC values.
Actual Behavior
The system overview for the environment display the Host values.
Screenshots
No response
Arcane Version
1.8.1
Operating System
Linux
Browser
Chrome
Docker Version
29.0.0
Additional Context
No response
@mplok1 Can you try this image and see if this is fixed? ghcr.io/getarcaneapp/arcane:cgroups
Hi,
I think there are still issues with the cgroups tag and consequently with the v1.9.0.
For example, my LXC only has 1 CPU and 1 GB of RAM, but the preview shows 12 CPUs and 13.5 GB / 31.09 GB, which corresponds more closely to the host's values. The usage percentages seem correct, unlike the limits :
Conversely, the preview of my host, i.e., Docker Local, shows 2 CPUs and 37 MB / 4 GB 😨 :
I have the impression that there are missing containers in the calculations.
For your information, my host machine is powered by Truenas 25.10
Ill take a closer look into this tonight, cgroups are kind of new to me still so im sure i missed something.
@mplok1 Can you try this image please? ghcr.io/getarcaneapp/arcane:cgroups
This is better for the limits of the Host but still incorrect regarding those of the LXC :
I only have 1CPU / 1GB for the LXC
@mplok1 Can you try ghcr.io/getarcaneapp/arcane:cgroups again please, make sure to have LOG_LEVEL=debug enabled as well as this will print out some debug statments if its detects cgroups or not
@mplok1 Can you try
ghcr.io/getarcaneapp/arcane:cgroupsagain please, make sure to have LOG_LEVEL=debug enabled as well as this will print out some debug statments if its detects cgroups or not
It seems that version 1.8.1 doesn’t have this issue, but starting from 1.9.0 the display becomes incorrect.
@kmendell It's still not working.
Here are the logs:
Nov 20 20:24:20.311 DBG Detected virtualization guest role
Nov 20 20:24:20.311 DBG Refreshing cgroup limits
Nov 20 20:24:20.312 DBG Cgroup stats are nil, assuming no limits
Nov 20 20:24:20.312 DBG Detected cgroup limits memory_limit=-1 cpu_count=-1
@mplok1 Can you try
ghcr.io/getarcaneapp/arcane:cgroupsagain please, make sure to have LOG_LEVEL=debug enabled as well as this will print out some debug statments if its detects cgroups or notIt seems that version 1.8.1 doesn’t have this issue, but starting from 1.9.0 the display becomes incorrect.
Correct cause 1.9.0 added the cgroups utility. I will most likley revert the cgroups data for the stats on the next udpate till we can get this sorted out correctly.
@mplok1 Can you try
ghcr.io/getarcaneapp/arcane:cgroupsagain please, make sure to have LOG_LEVEL=debug enabled as well as this will print out some debug statments if its detects cgroups or notIt seems that version 1.8.1 doesn’t have this issue, but starting from 1.9.0 the display becomes incorrect.
Correct cause 1.9.0 added the cgroups utility. I will most likley revert the cgroups data for the stats on the next udpate till we can get this sorted out correctly.
Also, ghcr.io/getarcaneapp/arcane:cgroups is showing the CPU and memory usage of the host machine, not the CPU and memory usage of the LXC where Docker is installed.
Are these provelegded or unprivliged LXC's? I think it should work if its Unprivilegded but the way /premise fo what privigled does it passes the values from the host, and that could get messy depending on what platform its on Proxmox, TruenNAS etc.
Are these provelegded or unprivliged LXC's? I think it should work if its Unprivilegded but the way /premise fo what privigled does it passes the values from the host, and that could get messy depending on what platform its on Proxmox, TruenNAS etc.
unprivileged LXC containers
- Mount the cgroup and proc folder from lxc into the container
- Set host to pid from container (agents)
- See the magic.
pid: host (only agents)
volumes:
- /proc:/proc
- /sys/fs/cgroup:/sys/fs/cgroup:ro (only arcane)
Tip: You can also use the same method for agents. Note: There may be a slight difference between this and the Proxmox dashboard. I believe it is related to the cache memory.
@fklnc94 What image did you use to test?
@fklnc94 Not the custom build i created just the normal latest or v1 tag correct? Just want to make sure as if thats the fix, then ill close this and update the documentation and close the PR for the part 2 fix.
@fklnc94 Not the custom build i created just the normal latest or v1 tag correct? Just want to make sure as if thats the fix, then ill close this and update the documentation and close the PR for the part 2 fix.
Yeah, its main branch v1.9.0, This issue has nothing to do with Arcane. It is entirely related to LXC. If you bind the /proc directory, which is virtualised by Proxmox and transferred to LXC, to your Docker container, you will see that the issue is resolved.