A cache entry for one DNS address, on a 64 bit machine, with IPv6 support compiled in, is 100 bytes. A few other datastructures grow in proportion to the cache size, but not by much. If you assumed 128 bytes per cache entry that should be pretty close.
That gives memory usage around 62Mb for you 500,000 cache size, which is pretty trivial on a big server. Note that, whilst forward cache lookups are efficient to very large cache sizes, reverse (ie address to name) ones will get slower linearly with cache size, so check you're not burning CPU and elapsed time on those. Simon. On 25/07/18 18:44, Urgen Sherpa wrote: > Hello :) > Any idea on memory usage per cached dns address ? Lets say if i have > 500,000 cache size(and if cache is full) how much memory is expected to > be used on linux server with spare 160G memory? > > Currently when cachesize is set to 50, the ps aux RSS is 2500kB with > below logs > > Jul 25 17:41:54 servlp6 dnsmasq: cache size 50, 52/358 cache > insertions re-used unexpired cache entries. > > Jul 25 17:41:54 servlp6 dnsmasq: queries forwarded 687, queries > answered locally 1 > > Jul 25 17:41:54 servlp6 dnsmasq: queries for authoritative zones 0 > > Jul 25 17:41:54 servlp6 dnsmasq: server 10.0.3.2#53: queries sent > 687, retried or failed 144 > > > root@servlp6:~# ps aux | grep dnsmasq > > *dnsmasq* 15701 0.0 0.0 52864 2504 ? S 16:28 0:00 > /usr/sbin/*dnsmasq*-x /var/run/*dnsmasq*/*dnsmasq*.pid -u *dnsmasq*-r > /var/run/*dnsmasq*/resolv.conf -7 > /etc/*dnsmasq*.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service > --trust-anchor=.,19036,8,2,49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5 > > > > Warm Regards > Sherpa > > > _______________________________________________ > Dnsmasq-discuss mailing list > Dnsmasqfirstname.lastname@example.org > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss > _______________________________________________ Dnsmasq-discuss mailing list Dnsmasqemail@example.com http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss