Preallocate VM images to avoid over provisioning and improve performance
Allocate storage for VM images up front for performance improvements and space availability guarantees. This is implemented by calling fallocate where available to allocate file system blocks efficiently when the VM is initially provisioned. This will give immediate feedback if enough space isn't available. Also it should significantly improve performance on writes to new blocks, and may even improve I/O performance to prewritten blocks due to reduced fragmentation.
A new config option is added: preallocate_
With preallocate_
References used when implementing this:
commands and perf tests for using fallocate on vm images:
http://
== Future work ==
For performance reasons it helps to enable the preallocation=
So we may in future also support a preallocate_
Reference info on preallocation=
preallocation
http://
preallocation
http://
preallocation
http://
qemu notes on qcow2 performance
http://
preallocation
I can't see how this is effective, and in my testing it's not.
http://
reason for qcow -> raw conversion in base
https:/
http://
Performance notes for various image types.
Tests done by writing in a VM backed by a local file system, using:
dd if=/dev/zero of=file bs=1M count=1k conv=notrunc,
I didn't see gradual degradation as some have seen on NFS at least,
but did see quite different performance depending on the formats used:
disk performance outside VM = 120MB/s
raw in $instance_dir/ = 105MB/s
qcow copy with preallocation=
qcow CoW with fallocate full size in $instance_dir/ = 55MB/s
Note perf a bit more stable than without fallocate
I didn't test with full host disk where improvements would be more noticeable
qcow CoW in $instance_dir/ = 52MB/s
qcow CoW in $instance_dir/ backed by qcow with preallocation=
Another thing to consider in future is having allocation supported as a flavor type rather than as a global setting. Perhaps something along the lines of "Instance disk I/O control" at: https:/
Blueprint information
- Status:
- Complete
- Approver:
- Russell Bryant
- Priority:
- Low
- Drafter:
- None
- Direction:
- Approved
- Assignee:
- Pádraig Brady
- Definition:
- Approved
- Series goal:
- Accepted for grizzly
- Implementation:
- Implemented
- Milestone target:
- 2013.1
- Started by
- Pádraig Brady
- Completed by
- Thierry Carrez
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
support preallocated VM images