prefetch details

Yorgos Thessalonikefs yorgos at nlnetlabs.nl
Tue Sep 24 13:13:40 UTC 2024


Hi Ian,

On 09/08/2024 03:00, Ian Z via Unbound-users wrote:
> Hello. I'd like to understand correctly and precisely the meaning of
> the _prefetch_ server config option. The only documentation I've been
> able to find is the unbound.conf manpage, which has this to say:
> 
>    prefetch: <yes or no>
> 
>    If yes, message cache elements are prefetched before they expire to
>    keep the cache up to date.  Default is no.  Turning it on gives
>    about 10 percent more traffic and load on the machine, but popular
>    items do not expire from the cache.
> 
> This is clear but not precise enough. Under what circumstances are
> cache entries refreshed? Do they have to be close to expiration? How
> close?  Or is there some other condition that triggers a refresh?
The prefetch happens when there is a cache hit and the record is on its 
last 10% of the TTL.

> 
> And then there is the _minimal-responses_ option. I have a good idea
> what it does, by itself, but the documentation helpfully drags in
> prefetching again:
> 
>    minimal-responses: <yes or no>
> 
>    If yes, Unbound does not insert authority/additional sections into
>    response messages when those sections are not required.  This
>    reduces response size significantly, and may avoid TCP fallback for
>    some responses.  This may cause a slight speedup.  The default is
>    yes, even though the DNS protocol RFCs mandate these sections, and
>    the additional content could be of use and save roundtrips for
>    clients.  Because they are not used, and the saved roundtrips are
>    easier saved with prefetch, whilst this is faster.
> 
> That last sentence sounds like Google Translate before LLM era :-(
> What's "they" and "this" there?  Why is prefetch "easier", given the
> 10 percent figure in the quote above?
>
It tries to say that providing the additional content in the reply can 
save roundtrips for clients that need them. However almost no client 
reads that content. And for those that do, enabling prefetch will help 
keep that data in the cache.

I do hope that I solved both text issues with
https://github.com/NLnetLabs/unbound/commit/24ebca7df6039ddcff52884c19db846024d162a4

The online documentation will be updated when a new release is out.

Best regards,
-- Yorgos


More information about the Unbound-users mailing list