Skip to content

Conversation

@mg12
Copy link
Member

@mg12 mg12 commented Aug 18, 2016

This patch series adds some vhd-tool VDI import and export performance features to Xapi to improve its VM import and export performance. This is considered a better option than calling vhd-tool from Xapi, because adding Xapi VM import and export features to vhd-tool is considerably more difficult and error-prone.

The resulting VM import and export performance in Xapi is better than the corresponding VDI import and export performance in vhd-tool, for the same amount of VDI data:

Time for a 10GiB VDI with random data xe vm-export vhd-tool export xe vm-import vhd-tool import
before patches 131s (sha1sum) 68s (ocaml-sha) 102s (sha1sum) 66s (ocaml-sha)
after patches 60s (faster than vhd-tool export) 56s (faster than vhd-tool import)

@euanh
Copy link
Contributor

euanh commented Aug 18, 2016

@mg12 You need to depend on sha in the opam file, not sha1. There is no sha1 package.

@mg12 mg12 force-pushed the master branch 2 times, most recently from 5df8c34 to ae1156d Compare August 18, 2016 15:58
This saves an enormous amount of time because the sha1 hash can be
computed without forking a new process for each 1MiB chunk of data.

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
This reduces the vm-export time in about 20%.

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
By using really_read, we can use Tar_unix.multicast_n_string instead of
Tar_unix.multicast_n and at the same time extract the buffer from inside
Tar_unix.multicast_n_string, so that it can be reused to improve performance.

The exception behaviour is the same: really_read also checks if Unix.read
returns 0 and raises the same End_of_file exception in this case,
compare https://github.com/xapi-project/xen-api-libs/blob/master/stdext/unixext.ml#L426
and https://github.com/mirage/ocaml-tar/blob/master/lib/tar_unix.ml#L123

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
This reduces the vm-import time slightly as in vm-export.

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
@robhoes
Copy link
Member

robhoes commented Aug 22, 2016

Looks good!

@robhoes robhoes merged commit 6316b66 into xapi-project:master Aug 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants