=head1 NAME

nbdkit-readahead-filter - prefetch data when reading sequentially

=head1 SYNOPSIS

 nbdkit --filter=readahead plugin

=head1 DESCRIPTION

C<nbdkit-readahead-filter> is a filter that prefetches data when the
client is reading sequentially.

A common use for this filter is to accelerate sequential copy
operations (like S<C<qemu-img convert>>) when plugin requests have a
high overhead (like L<nbdkit-curl-plugin(1)>).  For example:

 nbdkit -U - --filter=readahead curl https://example.com/disk.img \
        --run 'qemu-img convert $nbd disk.img'

The filter uses a simple adaptive algorithm which accelerates
sequential reads, but has a small penalty if the client does random
reads.  If the client mixes reads with writes or write-like operations
(trimming, zeroing) then it will work but there can be a large
performance penalty.

=head1 PARAMETERS

There are no parameters specific to nbdkit-readahead-filter.  Any
parameters are passed through to and processed by the underlying
plugin in the normal way.

=head1 FILES

=over 4

=item F<$filterdir/nbdkit-readahead-filter.so>

The filter.

Use C<nbdkit --dump-config> to find the location of C<$filterdir>.

=back

=head1 VERSION

C<nbdkit-readahead-filter> first appeared in nbdkit 1.12.

=head1 SEE ALSO

L<nbdkit(1)>,
L<nbdkit-cache-filter(1)>,
L<nbdkit-curl-plugin(1)>,
L<nbdkit-retry-filter(1)>,
L<nbdkit-ssh-plugin(1)>,
L<nbdkit-vddk-plugin(1)>,
L<nbdkit-filter(3)>,
L<qemu-img(1)>.

=head1 AUTHORS

Richard W.M. Jones

=head1 COPYRIGHT

Copyright (C) 2019 Red Hat Inc.
