[PATCH] Fix IP cache accounting

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Fri, 14 Jan 2011 09:14:49 -0700

Fix IP cache accounting to avoid idle caches on busy servers.

When maintaining the IP cache size, use the number of entries in the
cache rather than the number of allocated and not freed
MEM_IPCACHE_ENTRY objects. MEM_IPCACHE_ENTRY 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
cache encapsulation boundaries because it effectively prevents others
from using the same memory pool.

Alex.
P.S. I believe other recent changes may have fixed DNS query leaks
mentioned here.

Received on Fri Jan 14 2011 - 16:15:06 MST

This archive was generated by hypermail 2.2.0 : Sat Jan 15 2011 - 12:00:05 MST