RRset and Message cache functionality

Hi,

I'm trying to understand the cache memory usage of unbound a bit better. I
noticed that unbound-control only responds with the message and rrset
cache usage so I assume these are responsible for most of the memory
usage.

I also notice in the tuning documentation it's recommended the rrset cache
be allocated roughly twice the memory of the message cache, but on my
system the message cache catches and surpasses the rrset at around 130MB
using the default configuration for everything but the sizes.

I really have no idea how these two caches are being used(what they
contain, when they're referenced, ect.) so I'm not sure if the behavior is
normal or not. I'm hoping someone can offer insight or point me towards
any relevant documentation.

Thanks for any input.

Hi Sheridan,

The way that is measured it by setting the sizes very large, and before
they fill up, measure.

The things you say about your system are because of your local config.
If you configured different that would happen. What you describe is
intended and normal, and caused by your configuration of the sizes. If
you want unbound to have a 130Mb rrset cache, then it will do that. :slight_smile:

If you want to know everything about them you would have to read the
source. Short summary is that the message cache contains message
formats, and the rrset cache contains rr data from the internet. So if
your queries are different, and have less number of records per message,
but very large ones (say TXT or NAPTR), then the rrset cache would grow
faster. If you have many small rrsets then the message cache may grow
faster. For typical internet, roughly 2-to-1.

Best regards,
   Wouter