Kong Mesh resource sizing guidelines

Uses: Kong Mesh
Related Documentation
Incompatible with
konnect

Sizing your control plane

Generally, a Kong Mesh control plane with 4vCPU and 2GB of memory will be able to accommodate more than 1000 data planes.

A good rule of thumb is to assign about 1MB of memory per data plane. When it comes to CPUs, Kong Mesh handles parallelism extremely well since its architecture uses a lot of shared-nothing goroutines, so more CPUs usually enable quicker propagation of changes.

However, we highly recommend that you to run your own load tests prior to going to production. There are many ways to run workloads and deploy applications, and while we test some of them, you are in the best position to build a realistic benchmark of what you do.

To see if you may need to increase your control plane’s spec, there are two main metrics to pay attention to:

  • Propagation time (xds_delivery): This is the time it takes between a change in the mesh and the data plane receiving its updated configuration. Think about it as the reactivity of your mesh.
  • Configuration generation time (xds_generation): This is the time it takes for the configuration to be generated.

For any large mesh using a transparent proxy, we recommend using reachable services.

You can also find tuning configuration in the performance fine-tuning documentation.

Sizing your sidecar container on Kubernetes

When deploying Kong Mesh on Kubernetes, the sidecar is deployed as a separate container, kuma-sidecar, in your pods. By default it has the following resource requests and limits:

resources:
    requests:
        cpu: 50m
        memory: 64Mi
    limits:
        cpu: 1000m
        memory: 512Mi

This configuration should be enough for most use cases. In some cases (for example, when you can’t scale horizontally or your service handles lots of concurrent traffic), you may need to change these values. You can do this using the ContainerPatch resource.

For example, you can modify individual parameters under resources:

apiVersion: kuma.io/v1alpha1
kind: ContainerPatch
metadata:
  name: container-patch-1
  namespace: kong-mesh-system
spec:
  sidecarPatch:
    - op: add
      path: /resources/requests/cpu
      value: '"1"'

Or you can modify the entire limits, request or resources sections:

apiVersion: kuma.io/v1alpha1
kind: ContainerPatch
metadata:
  name: container-patch-1
  namespace: kong-mesh-system
spec:
  sidecarPatch:
    - op: add
      path: /resources/limits
      value: '{
        "cpu": "1",
        "memory": "1G"
      }'

Check the ContainerPatch documentation to learn how to apply these resources to specific pods.

Note: When changing these resources, remember that they must be described using Kubernetes resource units.

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!