[pve-devel] [PATCH] Increases the dd read/write speed when migrating LVM disks. This should bring LVM migration speed up to match that of rsyncing qcows.

jlavoy jalavoy at gmail.com
Tue Aug 23 10:17:16 CEST 2016


For example:
```
abrams Code # time dd if=1GB.file |ssh mary "dd of=/root/1GB.file"
2097152+0 records in
2097152+0 records out
1073741824 bytes (1.1 GB) copied, 34.0764 s, 31.5 MB/s
2097152+0 records in
2097152+0 records out
1073741824 bytes (1.1 GB) copied, 33.9548 s, 31.6 MB/s

real    0m34.079s
user    0m16.284s
sys     0m45.384s
abrams Code # time dd if=1GB.file bs=64M |ssh mary "dd of=/root/1GB.file
bs=64M"
16+0 records in
16+0 records out
1073741824 bytes (1.1 GB) copied, 10.6471 s, 101 MB/s
0+65517 records in
0+65517 records out
1073741824 bytes (1.1 GB) copied, 10.5291 s, 102 MB/s

real    0m10.652s
user    0m7.477s
sys     0m3.016s
```

Signed-off-by: jlavoy <jalavoy at gmail.com>
---
 PVE/Storage.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 25ff545..42b6423 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -559,11 +559,11 @@ sub storage_migrate {
 
 	    eval {
 		if ($tcfg->{type} eq 'lvmthin') {
-		    run_command([["dd", "if=$src"],["/usr/bin/ssh", "root\@${target_host}",
-			      "dd", 'conv=sparse', "of=$dst"]]);
+		    run_command([["dd", "if=$src", "bs=64M"],["/usr/bin/ssh", "root\@${target_host}",
+			      "dd", 'conv=sparse', "of=$dst", "bs=64M"]]);
 		} else {
-		    run_command([["dd", "if=$src"],["/usr/bin/ssh", "root\@${target_host}",
-			      "dd", "of=$dst"]]);
+		    run_command([["dd", "if=$src", "bs=64M"],["/usr/bin/ssh", "root\@${target_host}",
+			      "dd", "of=$dst", "bs=64M"]]);
 		}
 	    };
 	    if (my $err = $@) {
-- 
2.7.3




More information about the pve-devel mailing list