perf(quickemu): improve disk I/O defaults (cache,aio)

- add cache=writeback and aio=threads to DRIVE_OPTIMISATIONS
- retain existing optimisations: discard=unmap,detect-zeroes=unmap
- improve write performance (host writeback caching) and async I/O
  parallelism via thread-based AIO
- follows Proxmox/libvirt QEMU disk best practices; researched for macOS
  but applies to all guests

Signed-off-by: Martin Wimpress <martin@wimpress.org>
This commit is contained in:
Martin Wimpress 2026-01-25 15:58:17 +00:00 committed by Martin Wimpress
parent 9b54b36492
commit e777817ca9
1 changed files with 3 additions and 2 deletions

View File

@ -1887,8 +1887,9 @@ function vm_boot() {
# Add the disks # Add the disks
# - https://turlucode.com/qemu-disk-io-performance-comparison-native-or-threads-windows-10-version/ # - https://turlucode.com/qemu-disk-io-performance-comparison-native-or-threads-windows-10-version/
# Optimise disk I/O: enable TRIM/discard and zero detection for thin provisioning # Optimise disk I/O: enable TRIM/discard, zero detection for thin provisioning,
DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap" # writeback caching and threaded async I/O
DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap,cache=writeback,aio=threads"
if [[ "${boot}" == *"efi"* ]]; then if [[ "${boot}" == *"efi"* ]]; then
QCOW2CODE=$(is_firmware_qcow2 "${EFI_CODE}") QCOW2CODE=$(is_firmware_qcow2 "${EFI_CODE}")