Skip to content

Commit 75aec33

Browse files
author
Mikael Ronström
committed
WL#11018
Updated parameter section of MCC for repo installation fixes Reviewed-by: Mikael Ronström <[email protected]>
1 parent 3d9515e commit 75aec33

File tree

3 files changed

+308
-173
lines changed

3 files changed

+308
-173
lines changed

storage/ndb/mcc/frontend/js/mcc/configuration/calculations.js

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -364,16 +364,15 @@ function typeSetup (processTypeItem) {
364364
'DiskPageBufferMemory', 'defaultValueType');
365365
}
366366
diskBuf = Number(diskBuf);
367-
// If user didn't set it, calculate.
367+
// Default for SGM is 300M. Adjust if needed.
368368
if (diskBuf > 8192) {
369369
mcc.configuration.setPara(processFamilyName, null,
370370
'SharedGlobalMemory', 'defaultValueType', 1024);
371-
} else if (diskBuf > 64) {
372-
mcc.configuration.setPara(processFamilyName, null,
373-
'SharedGlobalMemory', 'defaultValueType', 384);
374371
} else {
375-
mcc.configuration.setPara(processFamilyName, null,
376-
'SharedGlobalMemory', 'defaultValueType', 32);
372+
if (diskBuf > 64) {
373+
mcc.configuration.setPara(processFamilyName, null,
374+
'SharedGlobalMemory', 'defaultValueType', 400);
375+
}
377376
}
378377
// Restrict MaxNoOfTables
379378
var maxTab = processFamilyItem.getValue(
@@ -416,12 +415,64 @@ function typeSetup (processTypeItem) {
416415
}
417416
// These are fine. Cluster is stopped.
418417
setLow('DataMemory');
419-
setLow('IndexMemory');
418+
// setLow('IndexMemory');
420419
// parameters.js, constraints: {min: 2, max: 72, thus 2.
421420

422421
// Silent change of defaults is handled in processtreedetails.js
423422
// and html.js on widget level for NoOfReplicas and NoOfFragmentLogParts
424423
// no more (NoOfFragmentLogFiles and FragmentLogFileSize).
424+
425+
// NoOfFragmentLogParts and MaxNoOfExecutionThreads reintroduced, need
426+
// handling here.
427+
var x = parseInt(processFamilyItem.getValue('MaxNoOfExecutionThreads'));
428+
if (!x) {
429+
mcc.configuration.setPara(processFamilyName, null,
430+
'MaxNoOfExecutionThreads', 'defaultValueType', 8);
431+
x = 8;
432+
}
433+
var flp = 0;
434+
switch (true) {
435+
case (x <= 3): // 1
436+
flp = 4;
437+
break;
438+
case (x <= 6): // 2
439+
flp = 4;
440+
break;
441+
case (x <= 11): // 4
442+
flp = 4;
443+
break;
444+
case (x <= 15): // 6
445+
flp = 6;
446+
break;
447+
case (x <= 19): // 8
448+
flp = 8;
449+
break;
450+
case (x <= 23): // 10
451+
flp = 10;
452+
break;
453+
case (x <= 31): // 12
454+
flp = 12;
455+
break;
456+
case (x <= 39): // 16
457+
flp = 16;
458+
break;
459+
case (x <= 47): // 20
460+
flp = 20;
461+
break;
462+
case (x <= 63): // 24
463+
flp = 24;
464+
break;
465+
case (x <= 72): // 32
466+
flp = 32;
467+
break;
468+
default:
469+
console.warn('[WRN]Failed to set NoOfFragmentLogParts! Will be 32.');
470+
flp = 32;
471+
break;
472+
}
473+
mcc.configuration.setPara(processFamilyName, null,
474+
'NoOfFragmentLogParts', 'defaultValueType', flp);
475+
425476
// Get overridden redo log file size
426477
var fileSz = processFamilyItem.getValue('FragmentLogFileSize');
427478

@@ -801,39 +852,13 @@ function ndbdSetup (processItem, processFamilyItem, host, waitCondition) {
801852
var nNdbdOnHost = nNodesOnHost['ndbd'] + nNodesOnHost['ndbmtd'];
802853
// Set IndexMemory
803854
if (!isNaN(machineRAM)) {
804-
var indexMemory = Math.floor((machineRAM -
805-
reserveMemoryToOS - buffers -
806-
DiskPageBufferMemory - connectionMemory -
807-
tableObjectMemory - attrsObjectMemory -
808-
indexes - RedoBuffer - ops - backup -
809-
SharedGlobalMemory) / (8 * nNdbdOnHost));
810-
// Lower value if simple testing, easier on resources
811-
if (cluster.getValue('apparea') === 'simple testing') {
812-
indexMemory = Math.floor(indexMemory / 4);
813-
}
814-
// Obey constraints
815-
var indexConstraints = mcc.configuration.getPara(processFamilyName, null,
816-
'IndexMemory', 'constraints');
817-
if (indexMemory < indexConstraints.min) {
818-
indexMemory = indexConstraints.min;
819-
} else if (indexMemory > indexConstraints.max) {
820-
indexMemory = indexConstraints.max;
821-
}
822-
mcc.configuration.setPara(processFamilyName, id,
823-
'IndexMemory', 'defaultValueInstance', indexMemory);
824-
// Use overridden indexMemory for dataMemory calc
825-
var realIndexMemory = getRealValue('IndexMemory');
826-
// May not have been set yet
827-
if (isNaN(realIndexMemory)) {
828-
realIndexMemory = indexMemory;
829-
}
830855
// Set DataMemory
831856
var dataMemory = Math.floor(multiplier *
832857
(machineRAM - reserveMemoryToOS - buffers -
833858
DiskPageBufferMemory - connectionMemory -
834859
tableObjectMemory - attrsObjectMemory - indexes -
835-
RedoBuffer - ops - backup - SharedGlobalMemory -
836-
realIndexMemory) / (1000 * nNdbdOnHost));
860+
RedoBuffer - ops - backup - SharedGlobalMemory) /
861+
(1000 * nNdbdOnHost));
837862
// Lower value if simple testing, easier on resources
838863
if (cluster.getValue('apparea') === 'simple testing') {
839864
dataMemory = Math.floor(dataMemory / 4);

0 commit comments

Comments
 (0)