How is the size of the Cache Digest in Squid determined?
Upon initialisation, the capacity is set to the number of objects that can be (are) stored in the cache. Note that there are upper and lower limits here. An arbitrary constant, bits_per_entry (currently set to 5), is used to calculate the size of the array using the following formula: number of bits in array = capacity * bits_per_entry + 7 The size of the digest, in bytes, is therefore: digest size = int (number of bits in array / 8) When a digest rebuild occurs, the change in the cache size (capacity) is measured. If the capacity has changed by a large enough amount (10%) then the digest array is freed and reallocated memory, otherwise the same digest is re-used.
” http://squid.nlanr.net/Squid/FAQ/FAQ-16.html#ss16.4 I have two proxies with around 16Gb of cache data each; both have cache digests of around 886Kb. As to whether or not to enable digests – it shouldn’t hurt to compile Squid with cache digests enabled, then selectively enable/disable them for each peer: – no-query (don’t use ICP, use CDs instead) – no-digest (don’t use CDs, use ICP instead) – no-digest no-query (don’t use either CDs or ICP – no point!) Cheers..