]> git.ipfire.org Git - thirdparty/squid.git/commit
Author: Alex Rousskov <rousskov@measurement-factory.com>
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 27 Jan 2011 09:29:04 +0000 (11:29 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 27 Jan 2011 09:29:04 +0000 (11:29 +0200)
commitac49890a255f5cfbf2242434c98b74da81b90dd4
tree1fcf789ee6c767d59c856c14bb0922afaea765a3
parentdb98b2bd97a7be81044418c9013bb3f84c692102
Author: Alex Rousskov <rousskov@measurement-factory.com>
Fix IP/FQDN cache accounting to avoid idle caches on busy servers.

When maintaining the IP/FQDN cache size, use the number of entries in the cache
rather than the number of allocated and not freed MEM_IPCACHE_ENTRY and
MEM_FQDNCACHE_ENTRY objects. These objects are used outside the cache
for DNS queries. If queries leak (or perhaps when there are just a lot of them),
the memory-pool-based count overestimates the cache size, sometimes to
such a degree that the cache remains nearly empty despite lots of misses.

Use memory-pool-based counter to estimate cache size also violates IP/FQDN cache
encapsulation boundaries because it effectively prevents others from using
the same memory pool.
src/fqdncache.cc
src/ipcache.cc