Skip to content

docs: configure proxy workers alongside Helm CPU resources - #2170

Open
lbarrosby wants to merge 1 commit into
linkerd:mainfrom
lbarrosby:docs/proxy-concurrency-helm-workers
Open

lbarrosby wants to merge 1 commit into
linkerd:mainfrom
lbarrosby:docs/proxy-concurrency-helm-workers

Conversation

@lbarrosby

Copy link
Copy Markdown

Problem

Configuring Proxy Concurrency says that setting proxy.resources.cpu.request or proxy.resources.cpu.limit in the control-plane Helm values configures the proxy's runtime ("rounding up to the next whole number"). That isn't what happens. Only the config.linkerd.io/proxy-cpu-request / proxy-cpu-limit annotations (pkg/inject/inject.go) and the --proxy-cpu-* CLI flags derive runtime.workers from the CPU quantities. Helm values go straight to the container resources, and the chart's own values.yaml says they have to be kept in sync with runtime.workers by hand.

So a cluster that follows the page and sets a 2-core limit through Helm still runs single-threaded proxies:

$ helm template x charts/linkerd-control-plane ... \
    --set proxy.resources.cpu.request=100m --set proxy.resources.cpu.limit=2000m
        - name: LINKERD2_PROXY_CORES
          value: "1"
        - name: LINKERD2_PROXY_CORES_MIN
          value: "1"

No LINKERD2_PROXY_CORES_MAX is rendered, so Workers::cores() falls back to one worker.

Solution

State that the Helm CPU values only set the container resources, and show proxy.runtime.workers.minimum / maximum next to them (minimum at least the request, maximum matching the limit, both in whole cores). runtime.workers.maximum is already read by _proxy.tpl and ProxyRuntimeWorkers, but it isn't documented anywhere yet. The annotation section and the note about rounding annotation values are unchanged, because they are correct.

Applied to 2.18, 2.19 and 2-edge. The page is identical in the three versions, and workers.maximum exists in all of them (checked _proxy.tpl at edge-25.4.4).

Validation

With the documented values:

        - name: LINKERD2_PROXY_CORES
          value: "1"
        - name: LINKERD2_PROXY_CORES_MIN
          value: "1"
        - name: LINKERD2_PROXY_CORES_MAX
          value: "2"

The same workers block is rendered into linkerd-config, which the injector uses for meshed workloads. markdownlint -c linkerd.io/.markdownlint.yaml passes on the changed files.

Related to #1495.

AI disclosure: written with the help of Claude Code, reviewed and tested by me.

Problem

The proxy concurrency task says that setting proxy.resources.cpu.request
or .limit in the control-plane Helm values configures the proxy's
runtime. It doesn't: only the config.linkerd.io/proxy-cpu-* annotations
and the CLI flags derive runtime.workers from the CPU quantities. With
Helm values alone the proxy gets LINKERD2_PROXY_CORES=1 and no
LINKERD2_PROXY_CORES_MAX, so it runs single-threaded no matter the limit.
The chart's values.yaml already says these values must be kept in sync
with runtime.workers by hand.

Solution

Say that the Helm CPU values only set the container resources, and show
proxy.runtime.workers.minimum and maximum next to them. Applied to 2.18,
2.19 and 2-edge, which share this page and support workers.maximum.

Validation

helm template of charts/linkerd-control-plane with the documented values
renders LINKERD2_PROXY_CORES_MIN=1 and LINKERD2_PROXY_CORES_MAX=2, and
the same workers block lands in linkerd-config for the injector. Without
the runtime block only LINKERD2_PROXY_CORES=1 is rendered. markdownlint
passes on the changed files.

Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant