1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-05 16:15:50 +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:
Patrick LeBlanc
2018-11-19 14:32:14 -06:00
parent 929ae5681a
commit 39e784abd2
3 changed files with 32 additions and 7 deletions

View File

@@ -428,6 +428,11 @@
<DBBC> <DBBC>
<!-- The percentage of RAM to use for the disk block cache. Defaults to 70% --> <!-- The percentage of RAM to use for the disk block cache. Defaults to 70% -->
<!-- <NumBlocksPct>70</NumBlocksPct> --> <!-- <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. --> <!-- <NumThreads>16</NumThreads> --> <!-- 1-256. Default is 16. -->
<NumCaches>1</NumCaches><!-- # of parallel caches to instantiate --> <NumCaches>1</NumCaches><!-- # of parallel caches to instantiate -->
<IOMTracing>0</IOMTracing> <IOMTracing>0</IOMTracing>

View File

@@ -418,8 +418,13 @@
<Module>unassigned</Module> <Module>unassigned</Module>
</DBRM_Worker10> </DBRM_Worker10>
<DBBC> <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> <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. --> <!-- <NumThreads>16</NumThreads> --> <!-- 1-256. Default is 16. -->
<NumCaches>1</NumCaches><!-- # of parallel caches to instantiate --> <NumCaches>1</NumCaches><!-- # of parallel caches to instantiate -->
<IOMTracing>0</IOMTracing> <IOMTracing>0</IOMTracing>

View File

@@ -503,12 +503,19 @@ int main(int argc, char* argv[])
} }
string strBlockPct = cf->getConfig(dbbc, "NumBlocksPct"); 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) if (temp > 0)
BRPBlocksPct = temp; BRPBlocksPct = temp;
#ifdef _MSC_VER
MEMORYSTATUSEX memStat; MEMORYSTATUSEX memStat;
memStat.dwLength = sizeof(memStat); memStat.dwLength = sizeof(memStat);
@@ -525,10 +532,18 @@ int main(int argc, char* argv[])
} }
#else #else
// _SC_PHYS_PAGES is in 4KB units. Dividing by 200 converts to 8KB and gets ready to work in pct if (usePct)
// _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 (temp > 0)
BRPBlocks = ((BRPBlocksPct / 100.0) * (double) cg.getTotalMemory()) / 8192; 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 #endif
#if 0 #if 0
temp = toInt(cf->getConfig(dbbc, "NumThreads")); temp = toInt(cf->getConfig(dbbc, "NumThreads"));