bleenco / abstruse

Abstruse is a free and open-source CI/CD platform that tests your models and code.
https://ci.abstruse.app
MIT License
936 stars 103 forks source link

Dashboard showing wrong memory consumption #383

Closed douglasmiranda closed 3 years ago

douglasmiranda commented 6 years ago

I see this in the dashboard:

screen shot 2018-06-13 at 15 58 49

But I just started abstruse, and the real consumption is (htop):

screen shot 2018-06-13 at 15 57 42

docker stats

CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
4914c6563a1a        clever_fermat       0.46%               39.66MiB / 996.5MiB   3.98%               168kB / 3.18MB      131kB / 201kB       11
898fec2c5e7d        angry_swirles       0.00%               39.09MiB / 996.5MiB   3.92%               1.22kB / 0B         2.31MB / 328kB      11

I'm using the latest abstruse:

REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
bleenco/abstruse           latest              bf1cd9462cb5        4 days ago          234MB

Run command:

docker run -dit -v /var/run/docker.sock:/var/run/docker.sock -v ~/abstruse:/root/abstruse -p 6500:6500 bleenco/abstruse

Output of docker info:

Click to expand ``` Containers: 7 Running: 2 Paused: 0 Stopped: 5 Images: 21 Server Version: 18.03.1-ce Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88 runc version: 4fc53a81fb7c994640722ac585fa9ca548971871 init version: 949e6fa Security Options: seccomp Profile: default Kernel Version: 4.9.0-6-amd64 Operating System: Debian GNU/Linux 9 (stretch) OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 996.5MiB Name: devtools-debian-s-1vcpu-1gb-nyc3-01 ID: TPO5:KDCP:IEXD:KSZK:GTDA:H65C:KMUG:W2DE:WOLZ:OSKM:5W63:WNM5 Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false WARNING: No swap limit support ```

The host is a Digital Ocean Debian Stretch droplet.

Linux devtools-debian-s-1vcpu-1gb-nyc3-01 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux
jkuri commented 6 years ago

hello @douglasmiranda and thanks for this report. that is very interesting, if you check here, abstruse is using Node.JS method os.freemem() for fetching free memory values. if you exec free -m, do you get same values? maybe freemem() returns memory that is not allocated nevertheless it is used or not. I think used and allocated memory are not the same things. not sure what we can do here to improve this stats, do you have any suggestions?

douglasmiranda commented 6 years ago

free -m returned:

              total        used        free      shared  buff/cache   available
Mem:            996         161         151          12         683         670
Swap:             0           0           0

..and the dashboard stays the same. =/

I'll try to investigate a little more.

jkuri commented 6 years ago

Then it is correct, free -m returned that 151M memory is free because 683M is buffered or cached and 161M is used. I believe dashboard works correctly. Let me know if you find anything unusual.

douglasmiranda commented 6 years ago

Oh, I see. But I think it would be better if the dashboard shows the "used" memory.

The way it shows now, it leads me to think I would have to add memory to the server, that abstruse itself was using that memory. Because I just started and nothing else was running.

jkuri commented 6 years ago

maybe you are right but unfortunatelly I cannot see any method in Node.js that returns only used memory. I would not add extra dependency beacuse of that though, but if you find any good external dep please paste me an url and I'll consider using it. Btw, you should add at least some swap if not memory though.

vniche commented 6 years ago

Is there available listed on possible methods for memory stats? It acctually shows free + cached/buffered memory, maybe it's a way.

About using swap, it depends on your use, on a dedicated server i would advise against using it, swap is the the last man standing of memories, and it`s already a half-dead. :p

irmana commented 6 years ago

@vniche and @douglasmiranda We will revisit this issue in following one week and provide an answer whether we found a pragmatic solution that fits into 2.0 release.

ordinarygulp commented 5 years ago

Seeing this issue as well, showing as 95% used, when in reality only 15% is in use.