From 39e784abd240bf622d3a794e43c4ee5f8659dd9f Mon Sep 17 00:00:00 2001 From: Patrick LeBlanc Date: Mon, 19 Nov 2018 14:32:14 -0600 Subject: [PATCH] MCOL-1847. Added a config param for PM cache size. New param is 'NumBlocksInMB', which will be the size of the block cache in MB. --- oam/etc/Columnstore.xml | 5 +++++ oam/etc/Columnstore.xml.singleserver | 7 ++++++- primitives/primproc/primproc.cpp | 27 +++++++++++++++++++++------ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/oam/etc/Columnstore.xml b/oam/etc/Columnstore.xml index 6ffd1efe7..79fb0cff5 100644 --- a/oam/etc/Columnstore.xml +++ b/oam/etc/Columnstore.xml @@ -428,6 +428,11 @@ + + + + 1 0 diff --git a/oam/etc/Columnstore.xml.singleserver b/oam/etc/Columnstore.xml.singleserver index 2ed98d87f..75e741ada 100644 --- a/oam/etc/Columnstore.xml.singleserver +++ b/oam/etc/Columnstore.xml.singleserver @@ -418,8 +418,13 @@ unassigned - + 50 + + + + 1 0 diff --git a/primitives/primproc/primproc.cpp b/primitives/primproc/primproc.cpp index 0ff38f0de..17a3b027f 100644 --- a/primitives/primproc/primproc.cpp +++ b/primitives/primproc/primproc.cpp @@ -503,12 +503,19 @@ int main(int argc, char* argv[]) } string strBlockPct = cf->getConfig(dbbc, "NumBlocksPct"); - temp = atoi(strBlockPct.c_str()); + string strBlockAbs = cf->getConfig(dbbc, "NumBlocksInMB"); + bool usePct = !(strBlockPct.empty()); // which to use. Prefer Pct if both are specified. + if (usePct) + temp = atoi(strBlockPct.c_str()); + else + temp = atoi(strBlockAbs.c_str()); + +#ifdef _MSC_VER + /* TODO: implement handling for NumBlocksInMB */ if (temp > 0) BRPBlocksPct = temp; -#ifdef _MSC_VER MEMORYSTATUSEX memStat; memStat.dwLength = sizeof(memStat); @@ -525,10 +532,18 @@ int main(int argc, char* argv[]) } #else - // _SC_PHYS_PAGES is in 4KB units. Dividing by 200 converts to 8KB and gets ready to work in pct - // _SC_PHYS_PAGES should always be >> 200 so we shouldn't see a total loss of precision - //BRPBlocks = sysconf(_SC_PHYS_PAGES) / 200 * BRPBlocksPct; - BRPBlocks = ((BRPBlocksPct / 100.0) * (double) cg.getTotalMemory()) / 8192; + if (usePct) + { + if (temp > 0) + BRPBlocksPct = temp; + BRPBlocks = ((BRPBlocksPct / 100.0) * (double) cg.getTotalMemory()) / 8192; + } + else + { + if (temp > 0) + BRPBlocks = temp * 128; // 128 blocks per MB. + else + BRPBlocks = 131072; // 1GB, why not. #endif #if 0 temp = toInt(cf->getConfig(dbbc, "NumThreads"));