[Unbound-users] howto optimize cachesize ?

Olaf Kolkman olaf at NLnetLabs.nl
Mon Dec 27 14:37:38 UTC 2010


On Dec 23, 2010, at 9:03 AM, Andreas Schulze wrote:

> I'm faced with the question if my unbound's cachesize is large enough.
> 
> The ideal size is reached, if unbound discards entries from the cache
> *only if* their ttl was expired.
> 
> Could anybody recommend a testplan, which values should be measured?



When dealing with the cache you should take the following into account:

* MSG cache contains packet data and meta data with pointers to the RRsets in the RR Cache

* RR Cache contains RRsets

* Cache entries are removed only when needed: Caches will grow to their maximum size. (Unbound will not do any pro-active cleanup).

If you use 'prefetch' you will keep the cache populated with popular requests.

Setting the RR cache about twice MSG cache is reasonable but if you really want to know what the optimal setting is in your environment you should turn on extended statistics and feed them into munin. By flushing the cache and assessing how the message and RRset cache grow you can estimate the ratio between the two.


For example see the image from munin below. You should take the estimate from the area where the memory is still not saturated (where the blue line is still rising, you see that the RRset cache size need is a little more than twice the message cache size need). You can also see that the RRset cache is saturated while the Message cache is still growing. This is an indication that the RRset cache is configured sub-optimal. If they saturate at more or less the same point the ratio is optimal.

Hope this helps.

--Olaf



-------------- next part --------------
A non-text attachment was scrubbed...
Name: unbound_munin_memory-day.png
Type: image/png
Size: 20907 bytes
Desc: not available
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20101227/421d2805/attachment.png>
-------------- next part --------------

________________________________________________________ 

Olaf M. Kolkman                        NLnet Labs
                                       Science Park 140, 
http://www.nlnetlabs.nl/               1098 XG Amsterdam

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2210 bytes
Desc: not available
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20101227/421d2805/attachment.bin>


More information about the Unbound-users mailing list