From b4bf1dde6bbda492188770d8fac6a72b7f9df359 Mon Sep 17 00:00:00 2001 From: Gavin Halliday Date: Wed, 24 Jul 2024 16:22:53 +0100 Subject: [PATCH] HPCC-31726 Optimize MALLOC_ARENA_MAX for containerized systems Signed-off-by: Gavin Halliday --- helm/hpcc/templates/_helpers.tpl | 6 +++--- helm/hpcc/templates/dafilesrv.yaml | 2 +- helm/hpcc/templates/dali.yaml | 2 +- helm/hpcc/templates/dfuserver.yaml | 2 +- helm/hpcc/templates/eclagent.yaml | 4 ++-- helm/hpcc/templates/eclccserver.yaml | 4 ++-- helm/hpcc/templates/eclscheduler.yaml | 2 +- helm/hpcc/templates/esp.yaml | 2 +- helm/hpcc/templates/localroxie.yaml | 2 +- helm/hpcc/templates/roxie.yaml | 6 +++--- helm/hpcc/templates/thor.yaml | 8 ++++---- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/helm/hpcc/templates/_helpers.tpl b/helm/hpcc/templates/_helpers.tpl index 7307367562b..5249a5cf702 100644 --- a/helm/hpcc/templates/_helpers.tpl +++ b/helm/hpcc/templates/_helpers.tpl @@ -1426,7 +1426,7 @@ Pass in dict with root, me and dali if container in dali pod {{- include "hpcc.addResources" (dict "me" .me.resources "root" .root) | indent 2 }} {{- include "hpcc.addSecurityContext" . | indent 2 }} env: -{{ include "hpcc.mergeEnvironments" $env | indent 2 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 2 -}} - name: "SENTINEL" value: "/tmp/{{ $serviceName }}.sentinel" {{- with (dict "name" $serviceName) }} @@ -2507,8 +2507,8 @@ global.noResourceValidation flag. This behavior can be overridden by the caller A template to output a merged environment. Pass in a list with global then local environments. Only the last specified value for each named environment variable will be output */}} {{- define "hpcc.mergeEnvironments" -}} -{{- $result := dict "MALLOC_ARENA_MAX" 8 -}}{{- /* HPCC arena default, can be overriden by component config */ -}} -{{- range . -}} +{{- $result := dict "MALLOC_ARENA_MAX" 8 -}}{{- /* HPCC arena default, can be overridden by component config */ -}} +{{- range .env -}} {{- $_ := set $result .name .value -}} {{- end -}} {{- range $key,$value := $result -}} diff --git a/helm/hpcc/templates/dafilesrv.yaml b/helm/hpcc/templates/dafilesrv.yaml index e378c759bf5..0f34aa44604 100644 --- a/helm/hpcc/templates/dafilesrv.yaml +++ b/helm/hpcc/templates/dafilesrv.yaml @@ -69,7 +69,7 @@ spec: {{ include "hpcc.configArg" . }} ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ .name }}.sentinel" {{ include "hpcc.addSentinelProbes" . | indent 8 }} diff --git a/helm/hpcc/templates/dali.yaml b/helm/hpcc/templates/dali.yaml index 2adfbbd328d..bf7c28a0ac8 100644 --- a/helm/hpcc/templates/dali.yaml +++ b/helm/hpcc/templates/dali.yaml @@ -122,7 +122,7 @@ spec: {{ include "hpcc.configArg" $dali }} ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ $dali.name }}.sentinel" {{ include "hpcc.addSentinelProbes" $dali | indent 8 }} diff --git a/helm/hpcc/templates/dfuserver.yaml b/helm/hpcc/templates/dfuserver.yaml index 4622e253e30..924095914f0 100644 --- a/helm/hpcc/templates/dfuserver.yaml +++ b/helm/hpcc/templates/dfuserver.yaml @@ -79,7 +79,7 @@ spec: {{ include "hpcc.daliArg" (dict "root" $ "component" "DFU Server" "optional" false) }} ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ .name }}.sentinel" {{ include "hpcc.addSentinelProbes" . | indent 8 }} diff --git a/helm/hpcc/templates/eclagent.yaml b/helm/hpcc/templates/eclagent.yaml index 954184a51dc..784c8c2c674 100644 --- a/helm/hpcc/templates/eclagent.yaml +++ b/helm/hpcc/templates/eclagent.yaml @@ -88,7 +88,7 @@ data: {{- $appCmd := printf "%s %s %s _HPCC_ARGS_" $apptype (include "hpcc.configArg" .me) (include "hpcc.daliArg" (dict "root" .root "component" "ECL Agent" "optional" false )) }} {{ include "hpcc.addCommandAndLifecycle" (. | merge (dict "command" $appCmd)) | indent 12 }} env: -{{ include "hpcc.mergeEnvironments" .env | indent 12 }} +{{ include "hpcc.mergeEnvironments" (dict "env" .env) | indent 12 }} workingDir: /var/lib/HPCCSystems volumeMounts: {{ include "hpcc.addConfigMapVolumeMount" .me | indent 12 }} @@ -161,7 +161,7 @@ spec: {{ include "hpcc.daliArg" (dict "root" $ "component" "ECL Agent" "optional" false) }} ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ .name }}.sentinel" {{ include "hpcc.addSentinelProbes" . | indent 8 }} diff --git a/helm/hpcc/templates/eclccserver.yaml b/helm/hpcc/templates/eclccserver.yaml index ccfbd73a288..9f8b3b01131 100644 --- a/helm/hpcc/templates/eclccserver.yaml +++ b/helm/hpcc/templates/eclccserver.yaml @@ -88,7 +88,7 @@ data: {{- $eclccserverCmd := printf "eclccserver %s %s _HPCC_ARGS_" (include "hpcc.configArg" .me) (include "hpcc.daliArg" (dict "root" .root "component" "ECLCC Server" "optional" false)) }} {{ include "hpcc.addCommandAndLifecycle" (. | merge (dict "command" $eclccserverCmd)) | indent 12 }} env: -{{ include "hpcc.mergeEnvironments" .env | indent 12 }} +{{ include "hpcc.mergeEnvironments" (dict "env" .env) | indent 12 }} workingDir: /tmp volumeMounts: {{ include "hpcc.addConfigMapVolumeMount" .me | indent 12 }} @@ -171,7 +171,7 @@ spec: {{ include "hpcc.daliArg" (dict "root" $ "component" "ECLCC Server" "optional" false) }} ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ .name }}.sentinel" {{ include "hpcc.addSentinelProbes" . | indent 8 }} diff --git a/helm/hpcc/templates/eclscheduler.yaml b/helm/hpcc/templates/eclscheduler.yaml index 9738de3223d..47907061242 100644 --- a/helm/hpcc/templates/eclscheduler.yaml +++ b/helm/hpcc/templates/eclscheduler.yaml @@ -88,7 +88,7 @@ spec: {{ include "hpcc.daliArg" (dict "root" $ "component" "ECL Scheduler" "optional" false) }} ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ .name }}.sentinel" {{ include "hpcc.addSentinelProbes" . | indent 8 }} diff --git a/helm/hpcc/templates/esp.yaml b/helm/hpcc/templates/esp.yaml index 6b9fc36695a..8f041eee001 100644 --- a/helm/hpcc/templates/esp.yaml +++ b/helm/hpcc/templates/esp.yaml @@ -153,7 +153,7 @@ spec: {{ include "hpcc.daliArg" (dict "root" $ "component" $application "optional" (has $application (list "esdl" "ldapenvironment" "loggingservice")) )}} ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ .name }}.sentinel" {{ include "hpcc.addSentinelProbes" . | indent 8 }} diff --git a/helm/hpcc/templates/localroxie.yaml b/helm/hpcc/templates/localroxie.yaml index c764ab1f8f3..ab8af2f2a41 100644 --- a/helm/hpcc/templates/localroxie.yaml +++ b/helm/hpcc/templates/localroxie.yaml @@ -99,7 +99,7 @@ spec: "--resolveLocally=false" ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ $roxie.name }}.sentinel" {{- $local := dict "first" true }} diff --git a/helm/hpcc/templates/roxie.yaml b/helm/hpcc/templates/roxie.yaml index 3fb3c33f137..258c7024a72 100644 --- a/helm/hpcc/templates/roxie.yaml +++ b/helm/hpcc/templates/roxie.yaml @@ -155,7 +155,7 @@ spec: {{ include "hpcc.configArg" $toposerver }} ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ $commonCtx.toponame }}.sentinel" volumeMounts: @@ -277,7 +277,7 @@ spec: "--server=true" ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ $roxie.name }}.sentinel" {{- $local := dict "first" true }} @@ -383,7 +383,7 @@ spec: "--server={{ not $roxie.serverReplicas }}", ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ $roxie.name }}.sentinel" {{- if not $roxie.serverReplicas }} diff --git a/helm/hpcc/templates/thor.yaml b/helm/hpcc/templates/thor.yaml index 0f65429e5ee..f4243690b8c 100644 --- a/helm/hpcc/templates/thor.yaml +++ b/helm/hpcc/templates/thor.yaml @@ -115,7 +115,7 @@ data: {{- $agentCmd := printf "%s %s %s _HPCC_ARGS_" $eclAgentType (include "hpcc.configArg" .me) (include "hpcc.daliArg" (dict "root" .root "component" "Thor" "optional" false)) }} {{ include "hpcc.addCommandAndLifecycle" (. | merge (dict "command" $agentCmd)) | indent 12 }} env: -{{ include "hpcc.mergeEnvironments" .env | indent 12 }} +{{ include "hpcc.mergeEnvironments" (dict "env" .env) | indent 12 }} workingDir: /var/lib/HPCCSystems volumeMounts: {{ include "hpcc.addConfigMapVolumeMount" .me | indent 12 }} @@ -182,7 +182,7 @@ data: {{- $thorManagerCmd := printf "thormaster_lcr %s %s _HPCC_ARGS_" (include "hpcc.configArg" .me) (include "hpcc.daliArg" (dict "root" .root "component" "Thor" "optional" false)) }} {{ include "hpcc.addCommandAndLifecycle" (. | merge (dict "command" $thorManagerCmd)) | indent 12 }} env: -{{ include "hpcc.mergeEnvironments" .env | indent 12 }} +{{ include "hpcc.mergeEnvironments" (dict "env" .env) | indent 12 }} workingDir: /var/lib/HPCCSystems volumeMounts: {{ include "hpcc.addConfigMapVolumeMount" .me | indent 12 }} @@ -379,7 +379,7 @@ spec: {{ printf "\"--name=%s\"" .name }} ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ $commonCtx.eclAgentName }}.sentinel" {{- include "hpcc.addSecurityContext" $commonCtx | indent 8 }} @@ -442,7 +442,7 @@ spec: {{ printf "\"--name=%s\"" .name }} ] env: -{{ include "hpcc.mergeEnvironments" $env | indent 8 -}} +{{ include "hpcc.mergeEnvironments" (dict "env" $env) | indent 8 -}} - name: "SENTINEL" value: "/tmp/{{ $commonCtx.thorAgentName }}.sentinel" {{- include "hpcc.addSecurityContext" $commonCtx | indent 8 }}