# LXC wrong stats reported

**URL:** <https://community.netdata.cloud/t/lxc-wrong-stats-reported/5393>\
**Category:** General\
**Created:** [April 25, 2024, 8:41am UTC](https://community.netdata.cloud/t/lxc-wrong-stats-reported/5393 "2024-04-25T08:41:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CvH](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/cvh/32/3637_2.png) [@CvH](https://community.netdata.cloud/u/CvH)\
**Post date:** [April 25, 2024, 8:41am UTC](https://community.netdata.cloud/t/lxc-wrong-stats-reported/5393/1 "2024-04-25T08:41:04Z")

</div>

I have latest Netdata installed at a LXC container and get now apperently stats from the host instead of the LXC container.  
The LXC Container (named ansible) is hosted at a Proxmox installation and the ceph is used as container storage.

[API info](https://pastebin.com/raw/ZmS2S36x)

It looks like it mixes hosts stats and container stats, I am just installed it with no further configuration, so I am unsure if this is some behavior I could adjust or is not supported ?

```auto
root@ansible:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/rbd13 15G 3.0G 11G 22% /
none 492K 4.0K 488K 1% /dev
tmpfs 32G 184K 32G 1% /dev/shm
tmpfs 13G 148K 13G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 6.3G 0 6.3G 0% /run/user/0

```

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/2X/b/b00d4b4791c7311911f6bd6c60d470d6fea1c58e.png)

Here it reports some data I have no idea from where it comes from.  
The 54,76GiB the total 10.24TiB are unreasonable and can’t get find at the host either (or some combination from some values that are unknown to me)  
On the other hand the 3GiB free storage is correct.

At the memory tab it looks okay besides the total committed memory that is completely off the charts and likewise a value from the barebone host.

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/2X/9/9f2fcf8151fe7d3d74528c5869762e7c14b34f3f.png)

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [April 26, 2024, 11:47am UTC](https://community.netdata.cloud/t/lxc-wrong-stats-reported/5393/2 "2024-04-26T11:47:48Z")

</div>

> [@CvH](#):
>
> I have latest Netdata installed at a LXC container and get now apperently stats from the host instead of the LXC container.

Hi. These are [LXCFS limitations](https://github.com/lxc/lxcfs):

LXCFS will take care that the information provided by crucial files in `procfs` such as:

```auto
/proc/cpuinfo
/proc/diskstats
/proc/meminfo
/proc/stat
/proc/swaps
/proc/uptime
/proc/slabinfo
/sys/devices/system/cpu/online

```

are container aware such that the values displayed (e.g. in `/proc/uptime`) really reflect how long the container is running and not how long the host is running.

* * *

It means that other procfs files provide the host data. This is why you get mixed container/host metrics when installing Netdata inside an LXC container.

---

<div class="post-metadata">

**Author:** ![CvH](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/cvh/32/3637_2.png) [@CvH](https://community.netdata.cloud/u/CvH)\
**Post date:** [April 26, 2024, 2:37pm UTC](https://community.netdata.cloud/t/lxc-wrong-stats-reported/5393/3 "2024-04-26T14:37:41Z")

</div>

I had a look at `/proc/diskstats` and they are exactly the same at host and the lxc container 😕  
So the disk stats are completely useless, not sure if this is a proxmox (using the latest proxmox, lxcfs 6.0) problem or a general lxc problem.

For example `/proc/stat` looks suspicious too, so cpu count looks okay but some values are basically the same at host/container

```auto
ctxt ...
btime ...
processes ...
procs_running ...
procs_blocked ...
softirq ...

```

The other stats are likely similar.

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [April 27, 2024, 6:01pm UTC](https://community.netdata.cloud/t/lxc-wrong-stats-reported/5393/4 "2024-04-27T18:01:30Z")

</div>

Yeah, I have 2 Proxmox 8.1 boxes and see the same issue for `/proc/diskstats`.
