SingleStore DB

Vertical Scaling

Scaling a cluster up or down vertically means increasing or decreasing the resource capacity in each node. The following resources can be scaled up or down.

CPU

The CPU can be scaled up or scaled down. CPU request and CPU limit are determined by the following formulas:

  • cpu_limit = spec.[aggregatorSpec/leafSpec].height * 8

    • Where spec.[aggregatorSpec/leafSpec].height is a float that can be specified in the memsql-cluster.yaml file. Refer to the memsql-cluster.yaml file for an explanation of height.

  • cpu_request = cpu_limit

Both the cpu_limit and cpu_request will be passed into the node pod’s spec.

  • spec.containers[“node”].resources.limits.cpu

  • spec.containers[“node”].resources.requests.cpu

Memory

Memory can be scaled up or scaled down. Memory request and memory limit are determined by the following formulas:

  • memory_limit = spec.[aggregatorSpec/leafSpec].height * 32

    • Where spec.[aggregatorSpec/leafSpec].height is the same height as for CPU.

  • memory_request = memory_limit

Both memory_limit and memory_request will be passed into the node pod’s spec.

  • spec.containers[“node”].resources.limits.memory

  • spec.containers[“node”].resources.requests.memory

Storage

Storage can only be scaled up, and scaling up is only possible if the defined StorageClass has allowVolumeExpansion set to true.

The following fields in memsql-cluster.yaml control the persisted volume size for each pod, which must be expressed as integer values:

  • spec.aggregatorSpec.storageGB

  • spec.leafSpec.storageGB

  1. To scale up storage, ensure that there is available storage space and increase these values to the desired amount.

  2. Apply the new values.

    kubectl apply -f memsql-cluster.yaml