[pve-devel] [PATCH pve-qemu-kvm] Force enable rbd cache for qmrestore RFC

Eneko Lacunza elacunza at binovo.es
Tue Jul 26 12:04:37 CEST 2016


Hi all,

This is my first code contribution for Proxmox. Please correct my 
wrongdoings with patch creation/code style/solution etc. :-)

This small patch adds a flag to devfn to force rbd cache (writeback 
cache) activation for qmrestore, to improve performance on restore to 
RBD. This follows our last week findings.

Tested with a 10GB disk restore with 44% sparse bytes, in our office 
running cluster I get about 13,5MB/s without patch, 29MB/s with patch 
this morning.

---

Index: b/vma.c
===================================================================
--- a/vma.c
+++ b/vma.c
@@ -328,6 +328,12 @@ static int extract_content(int argc, cha
             }


+            /* Force rbd cache */
+            if (0 == strncmp(devfn, "rbd:", strlen("rbd:"))) {
+                char *devfn_new = 
g_strdup_printf("%s:rbd_cache_writethrough_until_flush=false", devfn);
+                g_free(devfn);
+                devfn = devfn_new;
+            }
             if (errp || !(blk = blk_new_open(devfn, NULL, options, 
flags, &errp))) {
                  g_error("can't open file %s - %s", devfn,
                          error_get_pretty(errp));


-- 
Zuzendari Teknikoa / Director Técnico
Binovo IT Human Project, S.L.
Telf. 943493611
       943324914
Astigarraga bidea 2, planta 6 dcha., ofi. 3-2; 20180 Oiartzun (Gipuzkoa)
www.binovo.es



More information about the pve-devel mailing list