--------------------- PatchSet 12275 Date: 2008/06/27 21:10:39 Author: hno Branch: SQUID_2_6 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.570.2.4->1.570.2.5 Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid/squid/src/store.c,v retrieving revision 1.570.2.4 retrieving revision 1.570.2.5 diff -u -r1.570.2.4 -r1.570.2.5 --- squid/src/store.c 31 Aug 2007 13:51:27 -0000 1.570.2.4 +++ squid/src/store.c 27 Jun 2008 21:10:39 -0000 1.570.2.5 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.570.2.4 2007/08/31 13:51:27 hno Exp $ + * $Id: store.c,v 1.570.2.5 2008/06/27 21:10:39 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1556,9 +1556,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