From: Dmitry Kurochkin Date: Wed, 27 Apr 2011 23:40:56 +0000 (+0400) Subject: Store Config.Store.avgObjectSize in bytes. X-Git-Tag: take07~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=58d5c5ddd0260477a1ab4b6a3f47596e61ecb989;p=thirdparty%2Fsquid.git Store Config.Store.avgObjectSize in bytes. --- diff --git a/src/cf.data.pre b/src/cf.data.pre index ede2562c5d..baf71ef105 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -4030,8 +4030,8 @@ DOC_START DOC_END NAME: store_avg_object_size -COMMENT: (kbytes) -TYPE: kb_int64_t +COMMENT: (bytes) +TYPE: b_int64_t DEFAULT: 13 KB LOC: Config.Store.avgObjectSize DOC_START diff --git a/src/store_digest.cc b/src/store_digest.cc index 25cfda70c6..14649ab5f1 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -506,8 +506,8 @@ storeDigestCalcCap(void) * the bits are off). However, we do not have a formula to calculate the * number of _entries_ we want to pre-allocate for. */ - const int hi_cap = (Store::Root().maxSize() >> 10) / Config.Store.avgObjectSize; - const int lo_cap = 1 + (Store::Root().currentSize() >> 10) / Config.Store.avgObjectSize; + const int hi_cap = Store::Root().maxSize() / Config.Store.avgObjectSize; + const int lo_cap = 1 + Store::Root().currentSize() / Config.Store.avgObjectSize; const int e_count = StoreEntry::inUseCount(); int cap = e_count ? e_count :hi_cap; debugs(71, 2, "storeDigestCalcCap: have: " << e_count << ", want " << cap << diff --git a/src/store_dir.cc b/src/store_dir.cc index 833457e855..dd4390491d 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -871,7 +871,7 @@ StoreHashIndex::init() /* Calculate size of hash table (maximum currently 64k buckets). */ /* this is very bogus, its specific to the any Store maintaining an * in-core index, not global */ - size_t buckets = ((Store::Root().maxSize() + Config.memMaxSize) >> 10) / Config.Store.avgObjectSize; + size_t buckets = (Store::Root().maxSize() + Config.memMaxSize) / Config.Store.avgObjectSize; debugs(20, 1, "Swap maxSize " << (Store::Root().maxSize() >> 10) << " + " << ( Config.memMaxSize >> 10) << " KB, estimated " << buckets << " objects"); buckets /= Config.Store.objectsPerBucket;