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

reduce the memory usage for the guest image #280

Merged
merged 2 commits into from
Dec 31, 2024
Merged

Conversation

danmihai1
Copy link

@danmihai1 danmihai1 commented Dec 27, 2024

Reduce the memory usage for the guest image by:

  1. Using a smaller guest image size.
  2. Using virtio-blk instead of pmem for the guest image.

Change the default image size alignment from 128Mb to 2Mb. The guest
image size is 48Mb smaller after this change.

A custom size aligment can be specified using the new variable
IMAGE_SIZE_ALIGNMENT.

Using a smaller guest image size is currently significant on AKS-Kata
hosts, because the entire image gets copied into guest MAP_PRIVATE
pages when using cloud-hypervisor's "--pmem discard_writes=on".

Signed-off-by: Dan Mihai <[email protected]>
@danmihai1 danmihai1 requested review from a team as code owners December 27, 2024 23:55
@danmihai1 danmihai1 changed the title Danmihai1/no pmem reduce the memory usage for the guest image Dec 27, 2024
@danmihai1 danmihai1 requested a review from ms-mahuber December 27, 2024 23:58
Use virtio-blk for the AKS-Kata Pod VM root storage device. When using
"--pmem discard_writes=on" the entire Pod VM image gets copied into the
Pod VM memory, thus resulting in higher memory consumption.

AKS-CC was already using virtio-blk (not pmem).

Signed-off-by: Dan Mihai <[email protected]>
@danmihai1 danmihai1 merged commit 79931de into msft-main Dec 31, 2024
47 of 55 checks passed
@danmihai1 danmihai1 deleted the danmihai1/no-pmem branch December 31, 2024 20:54
sprt pushed a commit that referenced this pull request Feb 10, 2025
reduce the memory usage for the guest image
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

Successfully merging this pull request may close these issues.

2 participants