Skip to content

Commit

Permalink
[HOPSWORKS-2421] Template NumCPUs when configuration type is set to a…
Browse files Browse the repository at this point in the history
…utomatic (logicalclocks#66)
  • Loading branch information
kouzant authored Mar 17, 2021
1 parent 0d687e7 commit 217c867
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
# Read up on this option first. Benefits from setting to "true" node['ndb']['interrupts_isolated_to_single_cpu']
default['ndb']['ThreadConfig'] = ""
default['ndb']['SpinMethod'] = "LatencyOptimisedSpinning"
default['ndb']['default']['NumCPUs'] = "-1"
default['ndb']['NumCPUs'] = "#{node['ndb']['default']['NumCPUs']}"


default['ndb']['interrupts_isolated_to_single_cpu'] = "false"
Expand Down
4 changes: 4 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@
:description => "SpinMethod",
:type => 'string'

attribute "ndb/NumCPUs",
:description => "If configuration type is set to auto controls how many CPUs will be available to ndbmtd. Default: -1 (use all CPUs)",
:type => 'string'

attribute "ndb/TotalMemoryConfig",
:description => "This configuration defines the amount of memory used by ndbmtd when AutomaticMemoryConfig is turned on. Minimum is 3G",
:type => 'string'
Expand Down
1 change: 1 addition & 0 deletions recipes/mgmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
if node['ndb']['configuration']['profile'].casecmp?("tiny")
node.override['ndb']['TotalMemoryConfig'] = "3G"
node.override['ndb']['LockPagesInMainMemory'] = "0"
node.override['ndb']['NumCPUs'] = "4"
end
end

Expand Down
5 changes: 4 additions & 1 deletion templates/default/config.ini.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ TotalMemoryConfig=<%= node['ndb']['TotalMemoryConfig'] %>
<% end -%>

<% if node['ndb']['configuration']['profile'].casecmp?("tiny") -%>
NumCPUs=4
MaxNoOfTables=2000
MaxNoOfOrderedIndexes=1000
MaxNoOfUniqueHashIndexes=1000
Expand All @@ -22,6 +21,10 @@ TransactionMemory=200M
SharedGlobalMemory=400M
<% end -%>

<% if !node['ndb']['NumCPUs'].casecmp?(node['ndb']['default']['NumCPUs']) -%>
NumCPUs=<%= node['ndb']['NumCPUs'] %>
<% end -%>

ClassicFragmentation=false
EnableRedoControl=true

Expand Down

0 comments on commit 217c867

Please sign in to comment.