nbdkit-readahead-filter(1)
π nbdkit-readahead-filter β prefetch data ahead of sequential reads π
okay bestie, so this is a page from the NBDKIT manual set, and honestly? it's a whole vibe. it's called nbdkit-readahead-filter, it's a filter, and it does exactly one iconic thing: it reads ahead so your sequential reads go brrrr. let's get into it π¦
β¨ NAME β¨
nbdkit-readahead-filter β prefetch data ahead of sequential reads
β¨ SYNOPSIS β¨
nbdkit --filter=readahead PLUGIN
nbdkit --filter=readahead --filter=cache PLUGIN
nbdkit --filter=readahead --filter=cow PLUGIN cow-on-cache=true
β¨ DESCRIPTION β¨
so nbdkit-readahead-filter is a filter that prefetches data when the client is reading. that's the whole personality. π
when the client issues a read, this filter issues a parallel prefetch (.cache) for the data that's coming up next. plugins that support this command will go grab that data early, which makes sequential reads faster. and for plugins that don't support this command? no worries bestie, you can inject nbdkit-cache-filter(1) below (after) this filter and you get approximately the same effect. and nbdkit-cow-filter(1) can be used instead of nbdkit-cache-filter, if you add the cow-on-cache=true option. options on options, we love to see it π
the filter uses a simple adaptive algorithm that accelerates sequential reads and β this is the best part β requires no further configuration. it just knows. main character energy fr fr β¨
a similar filter is nbdkit-scan-filter(1), which reads ahead over the whole disk. that one's useful if you already know the client will be reading sequentially across most or all of the disk. different filter, different vibe, iykyk.
π Limitations π
ngl, in a number of significant cases this filter will do nothing. and the filter will print a warning message if that happens, so at least it tells you. it's giving "i tried π".
- Thread model must be parallel β use
nbdkit PLUGIN --dump-pluginto find the thread model of the underlying plugin. if it doesn't support theparallelthread model, this filter cannot perform prefetches in parallel with the read requests. we may be able to lift this restriction in future (manifesting π). - Underlying filters or plugin must support
.cache(prefetch) β very many plugins do not have the concept of prefetching and/or do not implement the.cachecallback, and so there is no way for this filter to issue prefetches. you can usually get around this by adding--filter=cacheafter this filter as explained above. it may be necessary to limit the total size of the cache (see "CACHE MAXIMUM SIZE" in nbdkit-cache-filter(1)). - Clients and kernels may do readahead already β it may be the case that NBD clients are already issuing
NBD_CMD_CACHE(NBD prefetch) commands. it may also be the case that your plugin is using local file functions where the kernel is doing readahead. in such cases this filter is not necessary and may be pessimal. like, actively worse. the audacity of the kernel, honestly π€
πΈ 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. so you don't have to learn anything new, periodt π«Ά
π FILES π
$filterdir/nbdkit-readahead-filter.soβ the filter. that's it, that's the file.
use nbdkit --dump-config to find the location of $filterdir. so helpful, so iconic β¨
β VERSION β
nbdkit-readahead-filter first appeared in nbdkit 1.12. a classic, honestly.
π SEE ALSO π
the whole friend group, okay:
nbdkit(1), nbdkit-cache-filter(1), nbdkit-cow-filter(1), nbdkit-file-plugin(1), nbdkit-retry-filter(1), nbdkit-scan-filter(1), nbdkit-torrent-plugin(1), nbdkit-vddk-plugin(1), nbdkit-filter(3), qemu-img(1).
π AUTHORS π
Richard W.M. Jones
π COPYRIGHT π
Copyright Red Hat
π§ LICENSE π§
redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
okay so that's the whole page and yes, all the legal stuff is still there, i didn't skip it, i would never do that to you π
this was nbdkit-1.48.1 and it's dated 2026-08-29 β that's the version and the date, mwah π
stay hydrated, read ahead, and remember: sequential reads deserve a little pre-game too π¦β¨π
π¦ where this page comes from
- fedora 44: nbdkit-basic-filters 1.48.1-1.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms