aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-01-22 12:47:29 +0000
committerGeir Storli <geirst@oath.com>2018-01-22 12:47:29 +0000
commit6b8cccc45e2580298f48462d9341e32a1ae22b8f (patch)
tree8bd71b7b6d74c2e41a19f1abe4eae8671efd80f3 /searchcore
parenteac3947f1275207660547f040b69127c18c08bff (diff)
Add config for the alloc grow factor used when allocating buffers in multi-value attributes.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/config/proton.def4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp21
2 files changed, 21 insertions, 4 deletions
diff --git a/searchcore/src/vespa/searchcore/config/proton.def b/searchcore/src/vespa/searchcore/config/proton.def
index f46f6c67fd4..d7b1cbfa45f 100644
--- a/searchcore/src/vespa/searchcore/config/proton.def
+++ b/searchcore/src/vespa/searchcore/config/proton.def
@@ -205,6 +205,10 @@ grow.add int default=1 restart
## The number of documents to amortize memory spike cost over
grow.numdocs int default=10000 restart
+## The grow factor used when allocating buffers in the array store
+## used in multi-value attribute vectors to store underlying values.
+grow.multivalueallocfactor double default=0.2 restart
+
## Control cache size in bytes.
summary.cache.maxbytes long default=0
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
index 4c1dd47569b..46233af1a45 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
@@ -11,12 +11,25 @@
#include <vespa/searchcore/proton/metrics/documentdb_metrics_collection.h>
using proton::matching::SessionManager;
-using search::index::Schema;
+using search::GrowStrategy;
using search::SerialNum;
+using search::index::Schema;
using searchcorespi::IFlushTarget;
namespace proton {
+namespace {
+
+GrowStrategy
+makeGrowStrategy(uint32_t docsInitialCapacity,
+ const DocumentSubDBCollection::ProtonConfig::Grow &growCfg)
+{
+ return GrowStrategy(docsInitialCapacity, growCfg.factor,
+ growCfg.add, growCfg.multivalueallocfactor);
+}
+
+}
+
DocumentSubDBCollection::DocumentSubDBCollection(
IDocumentSubDBOwner &owner,
search::transactionlog::SyncProxy &tlSyncer,
@@ -49,9 +62,9 @@ DocumentSubDBCollection::DocumentSubDBCollection(
const ProtonConfig::Distribution & distCfg = protonCfg.distribution;
_bucketDB = std::make_shared<BucketDBOwner>();
_bucketDBHandler.reset(new bucketdb::BucketDBHandler(*_bucketDB));
- search::GrowStrategy searchableGrowth(growCfg.initial * distCfg.searchablecopies, growCfg.factor, growCfg.add);
- search::GrowStrategy removedGrowth(std::max(1024l, growCfg.initial/100), growCfg.factor, growCfg.add);
- search::GrowStrategy notReadyGrowth(growCfg.initial * (distCfg.redundancy - distCfg.searchablecopies), growCfg.factor, growCfg.add);
+ GrowStrategy searchableGrowth = makeGrowStrategy(growCfg.initial * distCfg.searchablecopies, growCfg);
+ GrowStrategy removedGrowth = makeGrowStrategy(std::max(1024l, growCfg.initial/100), growCfg);
+ GrowStrategy notReadyGrowth = makeGrowStrategy(growCfg.initial * (distCfg.redundancy - distCfg.searchablecopies), growCfg);
size_t attributeGrowNumDocs(growCfg.numdocs);
size_t numSearcherThreads = protonCfg.numsearcherthreads;