Skip to content

Commit

Permalink
Lower qemu-img convert priority during conversion instead of limiting…
Browse files Browse the repository at this point in the history
… cpu time (#13787)

Lower `qemu-img convert` priority instead of limiting it to 2 minutes
during the image conversion. This also make it consistent with
ImageUnpack.
  • Loading branch information
tomponline authored Jul 21, 2024
2 parents 6fcc631 + 8355390 commit ed28438
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lxd/storage/backend_lxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -1826,8 +1826,8 @@ func (b *lxdBackend) imageConversionFiller(imgPath string, imgFormat string) fun

// Convert uploaded image from backups directory into RAW format on the instance volume.
cmd := []string{
// Use prlimit to limit QEMU to 1 GiB address space and 120 seconds of CPU time.
"prlimit", "--cpu=120", "--as=1073741824",
// Run with low priority to reduce CPU impact on other processes.
"nice", "-n19",
"qemu-img", "convert", "-f", imgFormat, "-O", "raw", imgPath, diskPath,
}

Expand Down

0 comments on commit ed28438

Please sign in to comment.