Not able to increase max_connection param in tsdb (postgres)

354 Views Asked by At

i want to update max_connections in my running tsdb

i have tried to change this in patroni cm tried to change directly in postgresql.conf file from different pod but Changes does not work tried changing parameter in helm chart and after i updated my chart but still the same old value

currently i am using this helm : https://artifacthub.io/packages/helm/fairwinds-incubator/timescaledb-single

it's not possible to change or delete helm bcoz we have loaded large number of data so any one have alternate idea so i can do it without losing data?

i have already try with changing some params like below

PATRONI.BOOTSTRAP.DCS.POSTGRESQL.PARAMETERS.MAX_CONNECTIONS PG_MAX_CONNECTIONS PATRONI_PG_MAX_CONNECTIONS PATRONI_POSTGRESQL_MAX_CONNECTIONS

already try with it but not working also try with upgrading helm but not reflecting

1

There are 1 best solutions below

0
jonatasdp On

probably your postgresql.conf file is readonly as you're using the helm charts.

It appears that you have tried changing the max_connections parameter in various ways but have not been successful yet.

One approach to update the max_connections in your running TimescaleDB without losing data is to follow these steps:

Backup your data: Before making any changes, ensure you have a backup of your data using tools like pg_dump or pg_basebackup.

This will help you restore the data if anything goes wrong.

Edit your Helm values.yaml file: Locate the values.yaml file for your TimescaleDB Helm chart, and update the max_connections parameter under the config section:


config:
  postgresql:
    max_connections: <new_value>

Replace <new_value> with the desired number of maximum connections.

Upgrade your Helm release: Run the following command to upgrade your Helm release with the updated values.yaml file:

helm upgrade <release_name> fairwinds-incubator/timescaledb-single -f values.yaml

Replace <release_name> with the name of your Helm release. Confirm the changes: After the upgrade is complete, connect to your TimescaleDB instance and check if the new max_connections value has been applied:

SELECT name, setting FROM pg_settings WHERE name = 'max_connections';

In case the above steps do not work, you can try the following:

Scale down and up your TimescaleDB pods: Run the following command to scale down your TimescaleDB pods to zero:

kubectl scale --replicas=0 statefulset/<your_statefulset_name>

Manually update the max_connections in the ConfigMap: Locate the ConfigMap that contains the postgresql.conf file, and update the max_connections parameter with the desired value.

Scale up your TimescaleDB pods: Run the following command to scale your TimescaleDB pods back up:

kubectl scale --replicas=<desired_number_of_replicas> statefulset/<your_statefulset_name>

Confirm the changes: Connect to your TimescaleDB instance and check if the new max_connections value has been applied.

Always make sure you have a backup of your data before making any changes to your deployment.