You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
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.
This commit is contained in:
@@ -428,6 +428,11 @@
|
||||
<DBBC>
|
||||
<!-- The percentage of RAM to use for the disk block cache. Defaults to 70% -->
|
||||
<!-- <NumBlocksPct>70</NumBlocksPct> -->
|
||||
|
||||
<!-- If preferred, the user can specify cache size in terms of megabytes.
|
||||
If both Pct and MB are specified, PrimProc will use Pct. -->
|
||||
<!-- <NumBlocksInMB>2048</NumBlocksInMB> -->
|
||||
|
||||
<!-- <NumThreads>16</NumThreads> --> <!-- 1-256. Default is 16. -->
|
||||
<NumCaches>1</NumCaches><!-- # of parallel caches to instantiate -->
|
||||
<IOMTracing>0</IOMTracing>
|
||||
|
@@ -418,8 +418,13 @@
|
||||
<Module>unassigned</Module>
|
||||
</DBRM_Worker10>
|
||||
<DBBC>
|
||||
<!-- The percentage of RAM to use for the disk block cache. Defaults to 86% -->
|
||||
<!-- The percentage of RAM to use for the disk block cache. Defaults to 70% -->
|
||||
<NumBlocksPct>50</NumBlocksPct>
|
||||
|
||||
<!-- If preferred, the user can specify cache size in terms of megabytes.
|
||||
If both Pct and MB are specified, PrimProc will use Pct. -->
|
||||
<!-- <NumBlocksInMB>2048</NumBlocksInMB> -->
|
||||
|
||||
<!-- <NumThreads>16</NumThreads> --> <!-- 1-256. Default is 16. -->
|
||||
<NumCaches>1</NumCaches><!-- # of parallel caches to instantiate -->
|
||||
<IOMTracing>0</IOMTracing>
|
||||
|
@@ -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;
|
||||
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"));
|
||||
|
Reference in New Issue
Block a user