Search code examples
postgresqlkubernetesgitlabbitnami

GitLab Bitnami PostgreSQL not overriding shared_buffers


Following this topic: Bitnami postgresql change max_connections

With the update to 16.x version for self-hosted GitLab we needed to increase our max_connections from 100 to 200.

After doing that, we noticed that our shared_buffers were set to 4MB which is too low and according to docs a reasonable starting value for shared_buffers is 1/4 of the memory in your system. If you have less RAM you'll have to account more carefully for how much RAM the OS is taking up; closer to 15% is more typical there.

I have added the following in our values.yaml:

postgresql:
  install: true
  primary:
    extendedConfiguration: |
      max_connections = 200
      shared_buffers = 512MB

Tested this on one of our test environments and we saw that it allocated 512 MB but when we applied the same changes to live, it increased to 16MB.

Checking instede the gitlab-chart-postgresql-0 and going to gitlab-chart-postgresql-0:/bitnami/postgresql/conf/conf.:

We can find the override.conf file that has:

cat override.conf
max_connections = 200
shared_buffers = 512MB

In theory, we should have 512 MB as we saw in the test environment instead of 16MB we see allocated now.

I am pretty lost on why it's not working. One theory is that when I did the helm upgrade gitlab-chart gitlab/gitlab --version x.x.x -f ./prod.yaml -n gitlab not all the deployments and pods restarted, the postgresql pod did and we saw the change from 4MB to 16MB so there was something but not the intended value.

Any leads?


Solution

  • Did an ALTER to the database and resetted the postgresql pod and the changes went through.

    It seems if it does not restart all the necessary deployments, replicasets the changes do not get through all the time.