We have an extra server that we have been using to restore our vzdump backups as part of our backup validation process.
The performance of the qmrestore was quite poor and we spent a lot of time trying to figure out why.
The solution to this problem was mentioned here, thanks kefear!:
http://forum.proxmox.com/threads/4830-Poor-performance-with-qmrestore?p=27545#post27545
We tried everything possible, the only thing that made the restore process faster was to edit qmrestore and add "oflag=direct" to the dd command.
exec 'dd', 'bs=256K', "of=$path", "oflag=direct";
It was mentioned in the other thread that this might have a bad impact on performance of other vms on the system.
While this is true I also agree with kefear, if I am restoring something bad has happened and I want the issue fixed ASAP even if it might impact performance a bit.
4802 Seconds ~79MB/sec to restore without oflag=direct
921 Seconds ~414MB/sec to restore with oflag=direct
I would gladly trade 15 minutes of slowness to reduce my downtime from 80 minutes to 15 minutes.
In our case I doubt it would cause a slowdown anyway since even at 414MB/sec our IO is not saturated, uncompressing the tar file is the bottleneck.
I feel qmrestore should always use oflag=direct or at least make an option to turn it on with a command line switch or configuration file.
Without oflag=direct :
With oflag=direct:
The performance of the qmrestore was quite poor and we spent a lot of time trying to figure out why.
The solution to this problem was mentioned here, thanks kefear!:
http://forum.proxmox.com/threads/4830-Poor-performance-with-qmrestore?p=27545#post27545
We tried everything possible, the only thing that made the restore process faster was to edit qmrestore and add "oflag=direct" to the dd command.
exec 'dd', 'bs=256K', "of=$path", "oflag=direct";
It was mentioned in the other thread that this might have a bad impact on performance of other vms on the system.
While this is true I also agree with kefear, if I am restoring something bad has happened and I want the issue fixed ASAP even if it might impact performance a bit.
4802 Seconds ~79MB/sec to restore without oflag=direct
921 Seconds ~414MB/sec to restore with oflag=direct
I would gladly trade 15 minutes of slowness to reduce my downtime from 80 minutes to 15 minutes.
In our case I doubt it would cause a slowdown anyway since even at 414MB/sec our IO is not saturated, uncompressing the tar file is the bottleneck.
I feel qmrestore should always use oflag=direct or at least make an option to turn it on with a command line switch or configuration file.
Without oflag=direct :
Code:
INFO: restore QemuServer backup '/backup1/vzdump-qemu-101-2011_08_29-22_00_06.tgz' using ID 1101
INFO: extracting 'qemu-server.conf' from archive
INFO: extracting 'vm-disk-virtio0.raw' from archive
INFO: Rounding up size to full physical extent 32.00 GB
INFO: Logical volume "vm-1101-disk-1" created
INFO: new volume ID is 'DRBD0:vm-1101-disk-1'
INFO: restore data to '/dev/drbdvg0/vm-1101-disk-1' (34359738368 bytes)
INFO: 0+995464 records in
INFO: 0+995464 records out
INFO: 34359738368 bytes (34 GB) copied, 455.777 s, 75.4 MB/s
INFO: extracting 'vm-disk-virtio1.raw' from archive
INFO: Rounding up size to full physical extent 250.00 GB
INFO: Logical volume "vm-1101-disk-2" created
INFO: new volume ID is 'DRBD0:vm-1101-disk-2'
INFO: restore data to '/dev/drbdvg0/vm-1101-disk-2' (268435456000 bytes)
INFO: 0+4083496 records in
INFO: 0+4083496 records out
INFO: 268435456000 bytes (268 GB) copied, 2889.31 s, 92.9 MB/s
INFO: extracting 'vm-disk-virtio2.raw' from archive
INFO: Rounding up size to full physical extent 100.00 GB
INFO: Logical volume "vm-1101-disk-3" created
INFO: new volume ID is 'DRBD0:vm-1101-disk-3'
INFO: restore data to '/dev/drbdvg0/vm-1101-disk-3' (107374182400 bytes)
INFO: 2+1798722 records in
INFO: 2+1798722 records out
INFO: 107374182400 bytes (107 GB) copied, 1456.95 s, 73.7 MB/s
INFO: restore QemuServer backup '/backup1/vzdump-qemu-101-2011_08_29-22_00_06.tgz' successful
With oflag=direct:
Code:
INFO: restore QemuServer backup '/backup1/vzdump-qemu-101-2011_08_29-22_00_06.tgz' using ID 3101
INFO: extracting 'qemu-server.conf' from archive
INFO: extracting 'vm-disk-virtio0.raw' from archive
INFO: Rounding up size to full physical extent 32.00 GB
INFO: Logical volume "vm-3101-disk-1" created
INFO: new volume ID is 'DRBD0:vm-3101-disk-1'
INFO: restore data to '/dev/drbdvg0/vm-3101-disk-1' (34359738368 bytes)
INFO: 0+1203040 records in
INFO: 0+1203040 records out
INFO: 34359738368 bytes (34 GB) copied, 129.033 s, 266 MB/s
INFO: extracting 'vm-disk-virtio1.raw' from archive
INFO: Rounding up size to full physical extent 250.00 GB
INFO: Logical volume "vm-3101-disk-2" created
INFO: new volume ID is 'DRBD0:vm-3101-disk-2'
INFO: restore data to '/dev/drbdvg0/vm-3101-disk-2' (268435456000 bytes)
INFO: 0+4707404 records in
INFO: 0+4707404 records out
INFO: 268435456000 bytes (268 GB) copied, 576.755 s, 465 MB/s
INFO: extracting 'vm-disk-virtio2.raw' from archive
INFO: Rounding up size to full physical extent 100.00 GB
INFO: Logical volume "vm-3101-disk-3" created
INFO: new volume ID is 'DRBD0:vm-3101-disk-3'
INFO: restore data to '/dev/drbdvg0/vm-3101-disk-3' (107374182400 bytes)
INFO: 0+2102632 records in
INFO: 0+2102632 records out
INFO: 107374182400 bytes (107 GB) copied, 245.053 s, 438 MB/s
INFO: restore QemuServer backup '/backup1/vzdump-qemu-101-2011_08_29-22_00_06.tgz' successful