From bedef2026c84ea00bb329799cc9bef81687fe88d Mon Sep 17 00:00:00 2001 From: Maja Massarini Date: Thu, 18 Apr 2024 15:12:20 +0200 Subject: [PATCH 1/2] Customize shm size in postgres pod By default shm size is 64MB, dashboard usage page uses around 100MB --- openshift/postgres.yml.j2 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/openshift/postgres.yml.j2 b/openshift/postgres.yml.j2 index fd71d9e..af6bdef 100644 --- a/openshift/postgres.yml.j2 +++ b/openshift/postgres.yml.j2 @@ -35,6 +35,11 @@ spec: ports: - containerPort: 5432 protocol: TCP + # increase shm size, default is 64M + # dashboard usage page requires around 100MB + volumeMounts: + - mountPath: /dev/shm + name: cache-volume livenessProbe: exec: command: @@ -53,12 +58,12 @@ spec: # - /usr/libexec/check-container resources: requests: - memory: "{{ '2Gi' if project == 'packit--prod' else '128Mi' }}" + memory: "{{ '2Gi' if project == 'packit--prod' else '256Mi' }}" cpu: "30m" limits: # The shared_buffers & effective_cache_size values are set by the container # based on this limit, so keep the limit reasonably high. - memory: "{{ '4Gi' if project == 'packit--prod' else '256Mi' }}" + memory: "{{ '4Gi' if project == 'packit--prod' else '512Mi' }}" # Not utilized most of the time, but useful during migrations and for some queries cpu: "1" volumeMounts: @@ -75,6 +80,11 @@ spec: - name: postgres-config configMap: name: postgres-config + - name: cache-volume + emptyDir: + medium: Memory + sizeLimit: 128Mi + replicas: 1 strategy: type: Recreate From 9e9843753da4e3b1dc45d9d33451f0ce07c5dd90 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Thu, 18 Apr 2024 23:58:45 +0200 Subject: [PATCH 2/2] chore(mpp): adjust the templates to current limits During the redeployment (after #558), after fixing the hard-coded project value, it has been discovered that we are hitting limits of the resources we're using on MP+, so there were some ad-hoc adjustments done on the fly. Sync those adjustments to reflect the currently deployed requests/limits. Signed-off-by: Matej Focko --- openshift/packit-service.yml.j2 | 2 +- openshift/postgres.yml.j2 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openshift/packit-service.yml.j2 b/openshift/packit-service.yml.j2 index b076887..c136ddc 100644 --- a/openshift/packit-service.yml.j2 +++ b/openshift/packit-service.yml.j2 @@ -84,7 +84,7 @@ spec: # If you see '/usr/bin/run_httpd.sh: line 16: Killed alembic upgrade head' # you have to temporarily increase (in webUI/console) the limit # and once the alembic upgrade passes, revert. - memory: "{{ '4Gi' if project == 'packit--prod' else '512Mi' }}" + memory: "{{ '1Gi' if project == 'packit--prod' else '512Mi' }}" cpu: "200m" # In TLS world, hostname needs to match whatever is set in the cert # in our cause, k8s is doing here something like curl https://172.15.2.4:8443/api/healthz/ diff --git a/openshift/postgres.yml.j2 b/openshift/postgres.yml.j2 index af6bdef..84068aa 100644 --- a/openshift/postgres.yml.j2 +++ b/openshift/postgres.yml.j2 @@ -58,12 +58,12 @@ spec: # - /usr/libexec/check-container resources: requests: - memory: "{{ '2Gi' if project == 'packit--prod' else '256Mi' }}" + memory: "{{ '1Gi' if project == 'packit--prod' else '256Mi' }}" cpu: "30m" limits: # The shared_buffers & effective_cache_size values are set by the container # based on this limit, so keep the limit reasonably high. - memory: "{{ '4Gi' if project == 'packit--prod' else '512Mi' }}" + memory: "{{ '1536Mi' if project == 'packit--prod' else '512Mi' }}" # Not utilized most of the time, but useful during migrations and for some queries cpu: "1" volumeMounts: