Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LXC readings are wrong #954

Open
SamTV12345 opened this issue Mar 16, 2023 · 2 comments
Open

LXC readings are wrong #954

SamTV12345 opened this issue Mar 16, 2023 · 2 comments

Comments

@SamTV12345
Copy link

First of all thanks for the great crate. It works awesome on my dev machine.

Describe the bug
I am trying to use this crate in a Proxmox LXC. Unfortunately it doesn't report information correctly. I assigned 10 Gigabyte of SSD storage to the LXC but it reports 70 Gigabyte SSD storage. Also the memory is used from the host system not the LXC memory.

To Reproduce
Start an LXC container in Proxmox. Download docker-compose and docker.

Use this docker-compose:

version: '3'
services:
  podgrabv2:
    image: samuel19982/podgrabv2:latest
    ports:
      - "80:8000"
    volumes:
      - podgrab-podcasts:/app/podcasts
      - podgrab-db:/app/podcast.db
    environment:
      - POLLING_INTERVAL=60
      - SERVER_URL=http://<url to the server>

SERVER_URL is the ip of your machine. Go to http://SERVER_URL/ui. Select Info in the sidebar.

@GuillaumeGomez
Copy link
Owner

As this is a very specific issue, I don't plan to work on it myself. However, if you want to send a fix for it, it'd be very welcome!

@ThinkRedstone
Copy link
Contributor

I ran into a similar issue with refresh_memory- the problem, at least with memory stats, is that refresh_memory uses read_u64 to read cgroups files; and read_u64 uses u64::from_str to parse the contents of the file. If we compare to the kernel source code, we can see that the kernel does not output a pure number like u64::from_str expects, but rather ends the number with a newline, causing read_u64 to incorrectly assume there's a problem with the cgroup file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants