containers / containers/crun-vm

Limit container CPU and memory usage

Open
#21 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
268
Forks
18
PR merge metrics
No merged PRs in 30d

Description

We currently launch a container without CPU or memory limits, and trust libvirt and QEMU to do the right thing. We should instead set actual limits on the container.

One difficulty is that, since the limits specified by the user (using `--cpu`, `--memory`, etc.) apply to the VM and not the container, we must set a higher memory limit than requested on the container to account for QEMU memory requirements. The KubeVirt project has solved the same problem by estimating that overhead (see [`GetMemoryOverhead()`](https://github.com/kubevirt/kubevirt/blob/f67d2698b001e87f589e4263c5491afdfe62aa7b/pkg/virt-controller/services/renderresources.go#L303)). We could follow a similar approach.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.