Scaling the OpenPages database server pod

You can scale the Db2 database server pod.

Before you begin

Review the minimum system requirements before you make changes. See System requirements.

About this task

Note: If you are using a database that is outside of IBM® Software Hub, this task does not apply.
For the Db2 database server pod, you can:
  • Increase or decrease the number of vCPUs.
  • Increase or decrease the memory.
Tip: To check the current vCPUs and memory of the database server, run the following command:
oc describe sts/c-db2oltp-<*>-db2u-sts
For example,
oc describe sts/c-db2oltp-1601355983782494-db2u-sts
Note: Run scaling operations when the cluster is quiet.

Procedure

  1. Run the following command to find the respective Db2uCluster or Db2uInstance resource names .
    oc get db2ucluster,db2uinstance --all-namespaces
  2. Set the Db2uCluster or Db2uInstance custom resource name to the DB2_CR_ID environment variable
    DB2_CR_ID=<db2ucluster_cr_name/db2uinstance_cr_name>
  3. Run the following command for Db2uCluster or Db2uInstance to configure your namespace:
    For Db2uCluster
    namespace=$(oc get db2ucluster --all-namespaces | grep ${DB2_CR_ID} | awk {'print $1'})
    For Db2uInstance
    namespace=$(oc get db2uinstance --all-namespaces | grep ${DB2_CR_ID} | awk {'print $1'})
  4. Use the following commands to patch the Red Hat® OpenShift® Db2uCluster or Db2uInstance custom resource for the OpenPages pod to set memory and CPU limits.

    In the following examples, we patch the Db2uCluster or Db2uInstance custom resources with these entries to set CPU to 12 vCPU and memory to 36 Gi.

    oc patch db2ucluster ${DB2_CR_ID} -n ${namespace} --type merge --patch '{"spec": {
    "podConfig": {
        "db2u": {
            "resource": {   
                "db2u": {
                    "limits": {
                        "cpu": "12",
                        "memory": "36Gi"
                    }
                }
            }
        }
    }
    }}'
    oc patch db2uinstance ${DB2_CR_ID} -n ${namespace} --type merge --patch '{"spec": {
    "podConfig": {
        "db2u": {
            "resource": {   
                "db2u": {
                    "limits": {
                        "cpu": "12",
                        "memory": "36Gi"
                    }
                }
            }
        }
    }
    }}'

    After the patch command, your OpenPages pod will restart. Wait for Ready state to indicate 1/1 to confirm that your OpenPages pod is ready for use.