Scaling up Db2

You can run a patch command to add more memory and CPU to the Db2 service on Cloud Pak for Data to support high-availability or increase processing capacity.

About this task

Db2 does not support the cpd scale command, but you can use the provided script to scale up Db2 to use any increased operating system capacity.

Procedure

  1. Run the following command to find the respective db2ucluster resource name and create a db2ucluster environment variable:
    oc get db2ucluster --all-namespaces
    db2ucluster=db2ucluster_resource_name
  2. Configure your namespace by modifying the following:
    namespace=$(oc get db2ucluster --all-namespaces | grep ${db2ucluster} | awk {'print $1'})
  3. Use the following command to patch the Red Hat® OpenShift® Db2uCluster custom resource for the Db2 pod to set higher or lower memory and CPU limits.

    In the following example, we patch the Db2ucluster custom resource with these entries to set CPU to 12 vCPU and memory to 36 Gi.

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

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