From eb4caa8dcc7ff15a5092e49622a8b148d7bea6e6 Mon Sep 17 00:00:00 2001 From: Om Mishra <32200996+mishraomp@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:29:16 -0800 Subject: [PATCH] fix: resource allocation (#336) --- backend/Dockerfile | 4 ++-- .../templates/frontend/templates/deployment.yaml | 2 +- charts/nr-epd-organics-info/values.yaml | 16 +++++----------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 1c7520f9..ddbedff5 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -24,5 +24,5 @@ EXPOSE 3000 HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/:3000/api || exit 1 USER nonroot -# Start up command with 50MB of heap size, each application needs to determine what is the best value. DONT use default as it is 4GB. -CMD ["--max-old-space-size=50", "/app/dist/main"] +# Start up command with 200MB of heap size, each application needs to determine what is the best value. DONT use default as it is 4GB. +CMD ["--max-old-space-size=200", "/app/dist/main"] diff --git a/charts/nr-epd-organics-info/templates/frontend/templates/deployment.yaml b/charts/nr-epd-organics-info/templates/frontend/templates/deployment.yaml index dba34aa1..dda31e37 100644 --- a/charts/nr-epd-organics-info/templates/frontend/templates/deployment.yaml +++ b/charts/nr-epd-organics-info/templates/frontend/templates/deployment.yaml @@ -73,7 +73,7 @@ spec: periodSeconds: 30 timeoutSeconds: 5 resources: - {{- toYaml .Values.backend.containerResources | nindent 12 }} + {{- toYaml .Values.frontend.containerResources | nindent 12 }} volumeMounts: - name: data mountPath: /data diff --git a/charts/nr-epd-organics-info/values.yaml b/charts/nr-epd-organics-info/values.yaml index e6db95f7..2714786d 100644 --- a/charts/nr-epd-organics-info/values.yaml +++ b/charts/nr-epd-organics-info/values.yaml @@ -34,15 +34,10 @@ backend: #-- the deployment strategy, can be "Recreate" or "RollingUpdate" deploymentStrategy: Recreate imagePullPolicy: Always - #-- autoscaling for the component. it is optional and is an object. - initContainerResources: - requests: - cpu: 30m - memory: 100Mi containerResources: requests: cpu: 30m - memory: 100Mi + memory: 300Mi autoscaling: #-- enable or disable autoscaling. enabled: true @@ -71,10 +66,6 @@ frontend: # -- the deployment strategy, can be "Recreate" or "RollingUpdate" deploymentStrategy: Recreate imagePullPolicy: Always - containerResources: - requests: - cpu: 50m - memory: 30Mi #-- autoscaling for the component. it is optional and is an object. autoscaling: #-- enable or disable autoscaling. @@ -92,7 +83,10 @@ frontend: pdb: enabled: false # enable it in PRODUCTION for having pod disruption budget. minAvailable: 1 # the minimum number of pods that must be available during the disruption budget. - + containerResources: + requests: + cpu: 50m + memory: 100Mi env: osmGrayscaleFlag: "false" zoomToResultsControlFlag: "true"