How can I check what is in the cache?

Hi All,

I was wondering how to check what is in the cache. Is there a direct command or do I have to dump the cache first?

Best regards,
Michael Van Der Beek

Support Division (Project)
Senior Systems Engineer (Team Leader)
Email: michael.van@antlabs.com
Tel: +65 68586789 ext. 144
Fax: +65 64874567
URL: http://www.antlabs.com
ANTlabs on: LinkedIn Facebook Twitter

Connectivity Made Easy

The information contained in this message and any attached document(s) is intended for the named recipient(s) only. The information may be privileged and/or confidential. If you are not the intended recipient, you must not copy, disclose, disseminate or otherwise make use of the information. If you have received this message in error, please immediately notify the sender and delete or destroy any copy of this message. Thank you.

`unbound-control dump_cache` will dump the cache to stdout.

Hi Sadig,

Do you know if it will lock unbound during a dump?
Meaning it will stop recursion during a dump?

Regards,

Michael

Michael Van Der Beek:

Do you know if it will lock unbound during a dump?
Meaning it will stop recursion during a dump?

yes, as far as I remember unbound will not answer any query while dumping the cache.
On my big caches it took 10-15 seconds. That hurts ...

Andreas

Hi Andreas,

Thanks! :slight_smile: Yup that sucks.. same problem with pdns.

Regards,

Michael

Hi,

Hi Andreas,

Thanks! :slight_smile: Yup that sucks.. same problem with pdns.

If you want to check a specific name, then you can dig +norecurse
example.com. Unbound will then check if the item is in cache, and if
so return it to you. If the item is not in cache an NS set is
returned (that would be used to query for the item). Unbound by
default refuses these queries, but you can allow your own IP addresses
(with access-control 127.0.0.0/8 allow_snoop).

Best regards,
   Wouter

Hello Andreas,

On my machine the dump takes 2.5 seconds, but I was never successful
in getting it to contain more than 170k entries (as measured by lines
in the dump).

Could you share what cache and memory related settings you've got, please?

Best regards,
Maciej

Hi,

Well my vm took almost a minute to generate 3.7million entries (199meg file) and that was doing a test of urls for about 5-6 hours.
Of course vm would be slower.. haven't tried it for a real server yet.

VM using 2 processors with 2G ram.
Having,
       num-threads: 2
    so-rcvbuf: 4m
    so-sndbuf: 4m
       msg-cache-size: 200m
       msg-cache-slabs: 4
       rrset-cache-size: 400m
       rrset-cache-slabs: 4
       infra-cache-slabs: 4
       infra-cache-numhosts: 100000

Regards,

Michael

Thanks Michael. I now was able to see my cache grow.

Is there anybody with an idea on how to dump the contents of the cache
without blocking queries?

Best regards,
Maciej