v2v: nbdkit: Add the readahead filter unconditionally if it is available.

The readahead filter is a self-configuring filter that makes
sequential reads faster when the plugin is slow (and all of the
plugins we use here are always slow).

I observed the behaviour of the readahead filter with our qcow2
overlay when converting a guest from a vCenter source.  Even when
doing random reads, qemu issues 64K reads which happen to also be the
minimum request size of the readahead filter, so there is no extra
overhead.  When doing the sequential copy the readahead filter
performed better than qemu curl’s readahead because it scaled the
prefetched data appropriately on long contiguous stretches and then
shrunk it back to 64K around fragmented parts of the base image.
This commit is contained in:
Richard W.M. Jones
2019-04-05 15:33:14 +01:00
parent 0796092e05
commit d481598067

View File

@@ -144,6 +144,13 @@ let common_create plugin_name plugin_args plugin_env =
Sys.command cmd <> 0
in
(* Adding the readahead filter is always a win for our access
* patterns. However if it doesn't exist don't worry.
*)
if probe_filter "readahead" then (
add_arg "--filter"; add_arg "readahead"
);
let args = get_args () @ [ plugin_name ] @ plugin_args in
{ plugin_name; args; env; dump_config; dump_plugin }