4

How to check the actual stats for CPU and RAM usage with colima?

Background

Coming from docker-desktop for mac there is a UI tool which displays this information in its footer:

enter image description here

in Format: RAM X.XXGB CPU X.XX%


colima version 0.4.4

git commit: 8bb1101a861a8b6d2ef6e16aca97a835f65c4f8f

docker-desktop version: 4.10.1

André Kelling
  • 1,575
  • 16
  • 23

2 Answers2

2

If you ssh into the colima instance, you can run top or htop or whatever you come up with.

(tmpconfig=$(mktemp); limactl show-ssh --format config colima > $tmpconfig; ssh -tF $tmpconfig lima-colima)

from a previous answer of mine

Javier Buzzi
  • 6,296
  • 36
  • 50
0

I tried to get the documentation, this is the closest thing I could see:

docker stats

This does not show total usage. Instead, this shows a list of containers with CPU and memory consumptions.

Example output:

CONTAINER ID  NAME             CPU %     MEM USAGE / LIMIT     MEM %     NET I/O          BLOCK I/O   PIDS
178c82edfcfe  container-name   0.91%     264.5MiB / 7.767GiB   3.33%     27.6MB / 692kB   0B / 0B     12
CKK
  • 899
  • 8
  • 13
  • 1
    What you mean is `colima status`? `colima stat` is no valid command on my side. – André Kelling Jul 25 '22 at 11:17
  • btw I also needed to observe a specific container's mem usage (using colima), so I ended up using this command to draw a graph with ttyplot: `{ while true; do colima ssh cat /sys/fs/cgroup/memory/docker/$(docker inspect -f "{{.Id}}" )/memory.usage_in_bytes; sleep 0.3; done } | ttyplot` – CKK Jul 12 '23 at 16:52