1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

MCOL-1847. Addressed feedback from Daniel.

Instead of a seperate param for cache size, we decided
to allow an override of the NumBlocksPct param instead.
If NumBlocksPct ends in an 'm' or a 'g', it will be interpreted
as megabytes or gigabytes instead of a %age.
This commit is contained in:
Patrick LeBlanc
2018-11-20 12:43:05 -06:00
parent a4f4580f03
commit 9363504dd4
3 changed files with 15 additions and 28 deletions

View File

@@ -427,12 +427,9 @@
</DBRM_Worker10> </DBRM_Worker10>
<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% -->
<!-- Alternatively, this can be specified in absolute terms using
the suffixes 'm' or 'g' to denote size in megabytes or gigabytes.-->
<!-- <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

@@ -419,12 +419,9 @@
</DBRM_Worker10> </DBRM_Worker10>
<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% -->
<!-- Alternatively, this can be specified in absolute terms using
the suffixes 'm' or 'g' to denote size in megabytes or gigabytes.-->
<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,16 +503,10 @@ int main(int argc, char* argv[])
} }
string strBlockPct = cf->getConfig(dbbc, "NumBlocksPct"); string strBlockPct = cf->getConfig(dbbc, "NumBlocksPct");
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()); temp = atoi(strBlockPct.c_str());
else
temp = atoi(strBlockAbs.c_str());
#ifdef _MSC_VER #ifdef _MSC_VER
/* TODO: implement handling for NumBlocksInMB */ /* TODO: implement handling for the 'm' or 'g' chars in NumBlocksPct */
if (temp > 0) if (temp > 0)
BRPBlocksPct = temp; BRPBlocksPct = temp;
@@ -532,19 +526,18 @@ int main(int argc, char* argv[])
} }
#else #else
if (usePct)
{
if (temp > 0) if (temp > 0)
BRPBlocksPct = temp; BRPBlocksPct = temp;
BRPBlocks = ((BRPBlocksPct / 100.0) * (double) cg.getTotalMemory()) / 8192; /* MCOL-1847. Did the user specify this in MB or GB? */
} int len = strBlockPct.length();
else if (strBlockPct[len-1] == 'g' || strBlockPct[len-1] == 'm')
{ {
if (temp > 0) if (strBlockPct[len-1] == 'g')
BRPBlocks = temp * 128; // 128 blocks per MB. BRPBlocksPct *= 1024;
else BRPBlocks = BRPBlocksPct * 128; // 128 blocks per MB
BRPBlocks = 131072; // 1GB, why not.
} }
else
BRPBlocks = ((BRPBlocksPct / 100.0) * (double) cg.getTotalMemory()) / 8192;
#endif #endif
#if 0 #if 0
temp = toInt(cf->getConfig(dbbc, "NumThreads")); temp = toInt(cf->getConfig(dbbc, "NumThreads"));