Skip to content

Commit

Permalink
fix: specify jvm env variables explicitly for local profile (#405)
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <[email protected]>
Co-authored-by: JeffreyDallas <[email protected]>
  • Loading branch information
leninmehedy and JeffreyDallas authored Oct 1, 2024
1 parent b251276 commit 3db7e08
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
10 changes: 9 additions & 1 deletion resources/profiles/custom-spec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
local: # 3 nodes, ~950 TPS (Docker Desktop 8 cores, 16 GB RAM)
local: # 3 nodes, ~850 TPS (Docker Desktop 8 cores, 16 GB RAM)
consensus: # use chart defaults
root:
extraEnv:
- name: JAVA_HEAP_MIN
value: 1g
- name: JAVA_HEAP_MAX
value: 3g
- name: JAVA_OPTS
value: "-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:ZAllocationSpikeTolerance=2 -XX:ConcGCThreads=2 -XX:ZMarkStackSpaceLimit=1g -XX:MaxDirectMemorySize=1g -XX:MetaspaceSize=100M -Xlog:gc*:gc.log --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true"
haproxy: # use chart defaults
envoyProxy: # use chart defaults
rpcRelay:
Expand Down
12 changes: 9 additions & 3 deletions src/core/profile_manager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,17 @@ export class ProfileManager {
const dotItems = dot.dot(items)

for (const key in dotItems) {
let itemKey = key

// if it is an array key like extraEnv[0].JAVA_OPTS, convert it into dot separated key as extraEnv.0.JAVA_OPTS
if (key.indexOf('[') !== -1) {
itemKey = key.replace('[', '.').replace(']', '')
}

if (itemPath) {
this._setValue(`${itemPath}.${key}`, dotItems[key], yamlRoot)
this._setValue(`${itemPath}.${itemKey}`, dotItems[key], yamlRoot)
} else {
this._setValue(key, dotItems[key], yamlRoot)
this._setValue(itemKey, dotItems[key], yamlRoot)
}
}
}
Expand All @@ -173,7 +180,6 @@ export class ProfileManager {
for (let nodeIndex = 0; nodeIndex < nodeIds.length; nodeIndex++) {
this._setValue(`hedera.nodes.${nodeIndex}.name`, nodeIds[nodeIndex], yamlRoot)
this._setValue(`hedera.nodes.${nodeIndex}.accountId`, accountMap.get(nodeIds[nodeIndex]), yamlRoot)
this._setChartItems(`hedera.nodes.${nodeIndex}`, profile.consensus, yamlRoot)
}

const stagingDir = Templates.renderStagingDir(
Expand Down

0 comments on commit 3db7e08

Please sign in to comment.