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

Memory consumption not shown #1965

Closed
IrwenXYZ opened this issue Nov 25, 2022 · 9 comments
Closed

Memory consumption not shown #1965

IrwenXYZ opened this issue Nov 25, 2022 · 9 comments
Assignees

Comments

@IrwenXYZ
Copy link
Contributor

Describe the bug
Memory consumption is not shown, both in home and individual container pages, but CPU usage is shown correctly. I used the docker compose template provided.

Expected behavior
Memory consumption shown correctly in both home and individual container pages

Desktop (please complete the following information):

  • OS: Server is Raspberry Pi OS Lite, accessing Dozzle on Windows 11 Pro
  • Docker version
Client: Docker Engine - Community
Version:           20.10.21
API version:       1.41
Go version:        go1.18.7
Git commit:        baeda1f
Built:             Tue Oct 25 18:01:19 2022
OS/Arch:           linux/arm64
Context:           default
Experimental:      true

Server: Docker Engine - Community
Engine:
 Version:          20.10.21
 API version:      1.41 (minimum version 1.12)
 Go version:       go1.18.7
 Git commit:       3056208
 Built:            Tue Oct 25 17:59:41 2022
 OS/Arch:          linux/arm64
 Experimental:     false
containerd:
 Version:          1.6.10
 GitCommit:        770bd0108c32f3fb5c73ae1264f7e503fe7b2661
runc:
 Version:          1.1.4
 GitCommit:        v1.1.4-0-g5fd4c4d
docker-init:
 Version:          0.19.0
 GitCommit:        de40ad0
  • Browser & version Firefox 107.0, Chrome 107.0.5304.107
  • Version 4.4.1
@amir20
Copy link
Owner

amir20 commented Nov 25, 2022

Interesting. There is probably some changes in Raspberry Pi's Docker implementation. I don't have mine handy right now so I can't reproduce.

Do you know Go? Would you be able to help? I have a possible idea

@IrwenXYZ
Copy link
Contributor Author

Unfortuntely not, I only know some Python. However I can try to look into it if you could point me in the right direction

@amir20
Copy link
Owner

amir20 commented Nov 25, 2022

Actually, I think I am wrong. My thought was that https://github.com/amir20/dozzle/blob/master/docker/calculation.go doesn't work correctly. But it actually matches the official Docker CLI https://github.com/docker/cli/blob/master/cli/command/container/stats_helpers.go#L239-L249.

So I am out of ideas. Possibly something else is broken.

I am pretty sick so I won't be able to look at this for a while. Perhaps you can investigate a little by adding logs.

@IrwenXYZ
Copy link
Contributor Author

How do I get the logs? The issue template mentions --level debug but I'm not exactly sure where to insert this option.

Hope you get well soon!

@IrwenXYZ
Copy link
Contributor Author

As it turns out 3am me isn't very good at reading stuff, I got the --level debug sorted out, here's some logs for you. Nothing stands out.

26/11/2022 3:19:33 am
level=info msg="Dozzle version v4.4.1"
26/11/2022 3:19:33 am
level=debug msg="filterArgs = {map[]}"
26/11/2022 3:19:33 am
level=info msg="Accepting connections on :8080"
26/11/2022 3:19:41 am
level=debug msg="starting to stream stats for: 6e72c5329f9b"
26/11/2022 3:19:41 am
level=debug msg="starting to stream stats for: dbcd637fd1dd"
26/11/2022 3:19:41 am
level=debug msg="starting to stream stats for: 42284429084a"
26/11/2022 3:19:41 am
level=debug msg="starting to stream stats for: 2ed03980c67c"
26/11/2022 3:19:41 am
level=debug msg="starting to stream stats for: 6adccb1c746e"
26/11/2022 3:19:41 am
level=debug msg="starting to stream stats for: e82ba0449329"
26/11/2022 3:19:41 am
level=debug msg="starting to stream stats for: 1de8acee9cd2"
26/11/2022 3:19:41 am
level=debug msg="starting to stream stats for: e9858984dc79"
26/11/2022 3:19:41 am
level=debug msg="starting to stream stats for: 95f34036087b"
26/11/2022 3:19:41 am
level=debug msg="starting to stream stats for: ed50a0263d96"
26/11/2022 3:19:42 am
level=debug msg="streaming logs for container" id=6adccb1c746e since=
26/11/2022 3:19:42 am
level=debug msg="streaming logs from Docker with option: {ShowStdout:true ShowStderr:true Since: Until: Timestamps:true Follow:true Tail:300 Details:false}"
26/11/2022 3:19:44 am
level=debug msg="streaming stopped: 6adccb1c746e"
26/11/2022 3:19:44 am
level=debug msg="runtime goroutine stats" routines=43
26/11/2022 3:19:44 am
level=debug msg="runtime mem stats" allocated="2.3 MB" system="15 MB" totalAllocated="6.4 MB"
26/11/2022 3:19:44 am
level=debug msg="streaming logs for container" id=e82ba0449329 since=
26/11/2022 3:19:44 am
level=debug msg="streaming logs from Docker with option: {ShowStdout:true ShowStderr:true Since: Until: Timestamps:true Follow:true Tail:300 Details:false}"

As for browser, there were the following errors:

The connection to http://192.168.0.3:42101/api/logs/stream?id=e82ba0449329&lastEventId= was interrupted while the page was loading. [index.706e7835.js:41:45575](http://192.168.0.3:42101/assets/index.706e7835.js)
EventSource failed: {"isTrusted":true} [index.706e7835.js:41:45851](http://192.168.0.3:42101/assets/index.706e7835.js)
    l http://192.168.0.3:42101/assets/index.706e7835.js:41
The connection to http://192.168.0.3:42101/api/events/stream was interrupted while the page was loading.

@amir20
Copy link
Owner

amir20 commented Nov 25, 2022

I don't see anything wrong with logs either.

But if you look at the code, that part doesn't log any debug values.

This bug is mostly in go because that's where it is read from docker api.

@amir20
Copy link
Owner

amir20 commented Nov 25, 2022

@IrwenXYZ
Copy link
Contributor Author

docker/for-linux#1112

This did the trick. Seems like it's an issue specific to arm64 devices.

What I did was simply to add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 to /boot/cmdline.txt and rebooted.

Thanks @amir20 for the quick help!

@amir20
Copy link
Owner

amir20 commented Nov 26, 2022

Great!

If you have some time please send a PR for the readme. There is a FAQ section that could be a good spot for this.

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

No branches or pull requests

2 participants