@@ -364,16 +364,15 @@ function typeSetup (processTypeItem) {
364
364
'DiskPageBufferMemory' , 'defaultValueType' ) ;
365
365
}
366
366
diskBuf = Number ( diskBuf ) ;
367
- // If user didn't set it, calculate .
367
+ // Default for SGM is 300M. Adjust if needed .
368
368
if ( diskBuf > 8192 ) {
369
369
mcc . configuration . setPara ( processFamilyName , null ,
370
370
'SharedGlobalMemory' , 'defaultValueType' , 1024 ) ;
371
- } else if ( diskBuf > 64 ) {
372
- mcc . configuration . setPara ( processFamilyName , null ,
373
- 'SharedGlobalMemory' , 'defaultValueType' , 384 ) ;
374
371
} 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
+ }
377
376
}
378
377
// Restrict MaxNoOfTables
379
378
var maxTab = processFamilyItem . getValue (
@@ -416,12 +415,64 @@ function typeSetup (processTypeItem) {
416
415
}
417
416
// These are fine. Cluster is stopped.
418
417
setLow ( 'DataMemory' ) ;
419
- setLow ( 'IndexMemory' ) ;
418
+ // setLow('IndexMemory');
420
419
// parameters.js, constraints: {min: 2, max: 72, thus 2.
421
420
422
421
// Silent change of defaults is handled in processtreedetails.js
423
422
// and html.js on widget level for NoOfReplicas and NoOfFragmentLogParts
424
423
// 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
+
425
476
// Get overridden redo log file size
426
477
var fileSz = processFamilyItem . getValue ( 'FragmentLogFileSize' ) ;
427
478
@@ -801,39 +852,13 @@ function ndbdSetup (processItem, processFamilyItem, host, waitCondition) {
801
852
var nNdbdOnHost = nNodesOnHost [ 'ndbd' ] + nNodesOnHost [ 'ndbmtd' ] ;
802
853
// Set IndexMemory
803
854
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
- }
830
855
// Set DataMemory
831
856
var dataMemory = Math . floor ( multiplier *
832
857
( machineRAM - reserveMemoryToOS - buffers -
833
858
DiskPageBufferMemory - connectionMemory -
834
859
tableObjectMemory - attrsObjectMemory - indexes -
835
- RedoBuffer - ops - backup - SharedGlobalMemory -
836
- realIndexMemory ) / ( 1000 * nNdbdOnHost ) ) ;
860
+ RedoBuffer - ops - backup - SharedGlobalMemory ) /
861
+ ( 1000 * nNdbdOnHost ) ) ;
837
862
// Lower value if simple testing, easier on resources
838
863
if ( cluster . getValue ( 'apparea' ) === 'simple testing' ) {
839
864
dataMemory = Math . floor ( dataMemory / 4 ) ;
0 commit comments