abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
19.31k stars 388 forks source link

Colima has constant high CPU usage when Kubernetes is enabled #493

Closed jstaf closed 1 year ago

jstaf commented 1 year ago

Description

The Colima QEMU VM constantly uses tons of CPU even when nothing is happening. This issue appears to be specific to if the Kubernetes feature is enabled.

Version

Colima Version: 0.4.6 Lima Version: 0.12.0 Qemu Version: 7.1.0

Operating System

Reproduction Steps

  1. Start colima on a mac with kubernetes enabled, for instance: colima start -k -r docker --mount-type=9p --cpu 6 --memory 24 --disk 100. This is just an example command, it appears to be equally bad for both docker/containerd or sshfs/9pfs. The cause seems to be having the Kubernetes feature enabled.
  2. top from the Mac host shows a qemu-system process using 30-100% cpu all the time. top inside the VM (colima ssh) shows virtually no CPU usage at all. The QEMU process on the host is busy (never drops below 30-40% cpu) even when the VM isn't doing anything (<5% CPU usage).

Expected behaviour

Colima VM CPU usage only spikes if its actually in use.

Additional context

No response

jstaf commented 1 year ago

Closing this after doing a comparison with some existing alternatives and having them be no better in terms of CPU usage (Docker Desktop, Podman, etc.).

fungiboletus commented 1 year ago

I also observed this behaviour when colima runs in docker mode, and I run kubernetes inside a docker container, not using the colima kubernetes. Kubernetes seems to put a lot of load on the qemu VM.