--------------------- PatchSet 12260 Date: 2008/06/27 20:55:16 Author: hno Branch: SQUID_2_7 Tag: (none) Log: Author: Arkin Bug #2387: The calculation of the number of hash buckets need to account for the memory size, not only disk size cache_mem only setups without a cache_dir miscalculates the hash table size, resulting in poor performance if cache_mem is very large. Members: src/store.c:1.584.2.4->1.584.2.5 Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid/squid/src/store.c,v retrieving revision 1.584.2.4 retrieving revision 1.584.2.5 diff -u -r1.584.2.4 -r1.584.2.5 --- squid/src/store.c 19 Jun 2008 01:08:30 -0000 1.584.2.4 +++ squid/src/store.c 27 Jun 2008 20:55:16 -0000 1.584.2.5 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.584.2.4 2008/06/19 01:08:30 hno Exp $ + * $Id: store.c,v 1.584.2.5 2008/06/27 20:55:16 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1612,9 +1612,9 @@ { long int i; /* Calculate size of hash table (maximum currently 64k buckets). */ - i = Config.Swap.maxSize / Config.Store.avgObjectSize; - debug(20, 1) ("Swap maxSize %lu KB, estimated %ld objects\n", - (unsigned long int) Config.Swap.maxSize, i); + i = (Config.Swap.maxSize + (Config.memMaxSize >> 10)) / Config.Store.avgObjectSize; + debug(20, 1) ("Swap maxSize %lu + %lu KB, estimated %ld objects\n", + (unsigned long int) Config.Swap.maxSize, (Config.memMaxSize >> 10), i); i /= Config.Store.objectsPerBucket; debug(20, 1) ("Target number of buckets: %ld\n", i); /* ideally the full scan period should be configurable, for the