]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Some changes to store hash_table buckets to improve performance.
authorwessels <>
Sat, 11 Dec 1999 22:57:42 +0000 (22:57 +0000)
committerwessels <>
Sat, 11 Dec 1999 22:57:42 +0000 (22:57 +0000)
The default is changed from 50 objects/bucket to 20.  Rewrote
storeKeyHashBuckets() and removed the 64K bucket limit.  Users
report this change makes a very big difference.

src/cf.data.pre
src/store_key_md5.cc

index ee96aae267e8375244801ed64afd083fc5ce3cf1..dbec2ae184bdd0201bbeb346f979473db273c26a 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.162 1999/10/04 05:05:01 wessels Exp $
+# $Id: cf.data.pre,v 1.163 1999/12/11 15:57:43 wessels Exp $
 #
 #
 # SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -2265,14 +2265,14 @@ DOC_END
 
 NAME: store_objects_per_bucket
 TYPE: int
-DEFAULT: 50
+DEFAULT: 20
 LOC: Config.Store.objectsPerBucket
 DOC_START
        Target number of objects per bucket in the store hash table.
        Lowering this value increases the total number of buckets and
-       also the storage maintenance rate.  The default is 50.
+       also the storage maintenance rate.  The default is 20.
 
-store_objects_per_bucket 50
+store_objects_per_bucket 20
 DOC_END
 
 NAME: client_db
index ef85fbf21e6d861009e1132d99b71c2d3f664d30..d0d4ea344e7b60da7d0c6b30cb994c8efbdbd9fa 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_key_md5.cc,v 1.21 1999/04/23 02:57:38 wessels Exp $
+ * $Id: store_key_md5.cc,v 1.22 1999/12/11 15:57:42 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager MD5 Cache Keys
  * AUTHOR: Duane Wessels
@@ -142,15 +142,12 @@ storeKeyFree(const cache_key * key)
 }
 
 int
-storeKeyHashBuckets(int nobj)
+storeKeyHashBuckets(int nbuckets)
 {
-    if (nobj < 0x2000)
-       return 0x2000;
-    if (nobj < 0x4000)
-       return 0x4000;
-    if (nobj < 0x8000)
-       return 0x8000;
-    return 0x10000;
+    int n = 0x2000;
+    while (n < nbuckets)
+       n <<= 1;
+    return n;
 }
 
 int