Changing the connection pooling configuration of the EDB PostgreSQL database

You can configure the platform-auth-idp configmap to change the connection pooling configuration of the PostgreSQL database. You can override the default values of the pool settings based on your requirements to optimize the performance of the database connection. For more information about the connection pooling parameters, see Table 1.Description of the connection pooling parameters of the PostgreSQL database.

You can change the connection pooling configuration with one of the following methods:

Connection pooling parameters

Table 1. Description of the connection pooling parameters of the PostgreSQL database
Parameter Description Default value
DB_CONNECT_TIMEOUT The DB_CONNECT_TIMEOUT parameter is used to set the maximum time (in seconds) to establish a new database connection. Specify a positive integer with the unit of time such as hours (h), minutes (m), seconds (s), or milliseconds (ms). 60000
DB_IDLE_TIMEOUT The DB_IDLE_TIMEOUT parameter is used to set the maximum time (in seconds) that the database connection remains idle. Specify a positive integer with the unit of time such as hours (h), minutes (m), seconds (s), or milliseconds (ms). 20000
DB_POOL_MAX_SIZE The DB_POOL_MAX_SIZE parameter is used to set the maximum size of the database connection pool. 15
DB_POOL_MIN_SIZE The DB_POOL_MIN_SIZE parameter is used to set the minimum size of the database connection pool. 5
DB_CONNECT_MAX_RETRIES The DB_CONNECT_MAX_RETRIES parameter is used to set the maximum retry attempts to establish the database connection. 5
SEQL_LOGGING The SEQL_LOGGING parameter is used to enable or disable the connection pool to log the SQL statement information. You can set to true to enable the connection pool to log the SQL statements information. false

The following is the sample YAML file with the connection pooling parameters:

apiVersion: v1
kind: ConfigMap
metadata:
  name: platform-auth-idp
  namespace: <your-foundational-services-namespace>
data:
  DB_CONNECT_TIMEOUT: "60000"
  DB_IDLE_TIMEOUT: "20000"
  DB_POOL_MAX_SIZE: "15"
  DB_POOL_MIN_SIZE: "5"
  DB_CONNECT_MAX_RETRIES: "5"
  SEQL_LOGGING: false

Changing the parameter values with the console

To change the connection pooling parameter values with the console, complete the following steps:

  1. Log in to the OpenShift Container Platform console as a user with cluster administrator access.
  2. From the navigation menu, click Workloads > Config Maps.
  3. Search for platform-auth-idp.
  4. Click ... > Edit Config Map.
  5. Change the following attribute values as required:
    • DB_CONNECT_TIMEOUT
    • DB_IDLE_TIMEOUT
    • DB_POOL_MAX_SIZE
    • DB_POOL_MIN_SIZE
    • DB_CONNECT_MAX_RETRIES
    • SEQL_LOGGING
  6. Click Save.
  7. From the navigation menu, click Workloads > Deployments.
  8. Locate platform-auth-service.
  9. Click ... > Edit Deployment. A window for editing displays.
  10. Click Save without changes in the configmap to reload the platform-auth-service pods with the updated configmap values.
  11. Click platform-auth-service.
  12. Wait for some time. Then, check the status of the platform-auth-service pods in the Pods pane. The status of all the pods must show as 4/4 in the Ready field name.

Changing the parameter values with the CLI

To change the connection pooling parameter values with the CLI, complete the following steps:

Replace <your-foundational-services-namespace> in the commands with the namespace where you deployed the foundational services.

  1. Log in to your cluster with the oc login command.

  2. Edit the platform-auth-idp configmap.

    oc -n <your-foundational-services-namespace> edit configmap platform-auth-idp
    
  3. Change the following attribute values as required:

    • DB_CONNECT_TIMEOUT
    • DB_IDLE_TIMEOUT
    • DB_POOL_MAX_SIZE
    • DB_POOL_MIN_SIZE
    • DB_CONNECT_MAX_RETRIES
    • SEQL_LOGGING
  4. Save the platform-auth-idp configmap.

  5. Restart the platform-auth-service pods.

    1. Get the platform-auth-service pod names.

      oc -n <your-foundational-services-namespace> get pods | grep platform-auth-service
      
    2. Delete the platform-auth-service pod.

      oc -n <your-foundational-services-namespace> delete pods <pod-name>
      
  6. Wait for some time and then check the status of the platform-auth-service pods. The status of all platform-auth-service pods must show as Running.

    oc -n <your-foundational-services-namespace> get pods | grep platform-auth-service