Hi! I updated a litle my dumpcache patch.
http://riemann.fmi.uni-sofia.bg/docs/djbdns-dumpcache.html
It can dump and reload cache periodically (automatic cleans expired
entries). By loading it calculetes (blowup) new RAM cachesize using
C = A*(len/100) + B # default: A=200, B=32768, C - new cachesize
On this way the program finds the best cachesize. One can change
parameters A and B using soft link
cd /path/to/dnscache/dir
cd root/dump
ln -sf 180:200000 data.blowup # sets A=180, B=200000
Three parameters: 'dump interval', A, B controls RAM cachesize.
RAM cachezize is always less than $CACHESIZE.
The advantige of above is obvious. If CACHESIZE=10mb and the programs
have 400K cache entreis it allocs only A*(400000/100) +B bytes RAM.
The RAM cachesize is calculated/updated for each reaload. The
cachesize is updated with realloc (not alloc_re).
Russ if you want make a link on www.tinydns.org
next to Florent Guillaume patch.
Nikola
|