Skip to content

fix(helm): size the eBPF maps for the chart's default memory limit - #673

Merged
pirog-spb merged 1 commit into
edgecomllc:mainfrom
martin-mat:chart-max-sessions
Oct 22, 2026
Merged

pirog-spb merged 1 commit into
edgecomllc:mainfrom
martin-mat:chart-max-sessions

Conversation

@martin-mat

Copy link
Copy Markdown
Contributor

Fixes #670.

Since #622 an unset map size is derived from max_sessions, whose default is 65535: PDR, FAR and URR maps of 131,070 entries and a QER map of 65,535, allocated at startup and charged to the pod, about 115 MiB (a working set of about 140 MiB with the process). The chart's default memory limit is 128 Mi, set for the 1024-entry maps of the 0.7.1 image, so an image built from main fails at startup with the chart's defaults: creating map: map create: cannot allocate memory.

Change

  • values.yaml: UPF_MAX_SESSIONS: "1024" in defaultEnv, which keeps the maps at the size the limit was set for (a working set of about 30 MiB), with the reasoning in the comment.
  • README, new section "Sessions and memory": how max_sessions and resources.limits.memory scale together (about 1.8 MiB per 1024 sessions on top of the process's ~30 MiB), and that in ConfigMap mode max_sessions goes into config.data, since the default variables are not injected there.
  • Chart 0.7.2.

This is option 1 of #670; raising the default limit to carry 65535 sessions (option 2) is the alternative, if that capacity is meant to be the chart's default.

Verification

Measured with the kubelet's accounting on a kind cluster (run 38941479851): main's defaults need a working set of ~140 MiB and start under 192 Mi and above, not under 128 Mi; with UPF_MAX_SESSIONS=1024 the working set is ~30 MiB. With this change and the chart's defaults, an image built from main starts and passes the CNTi essential tests like 0.7.1, 15 of 19 (run 38942371982).

#672 also bumps the chart to 0.7.2; whichever merges second needs a one-line rebase.

🤖 Generated with Claude Code

Since edgecomllc#622 an unset map size is derived from max_sessions, whose default
is 65535: PDR, FAR and URR maps of 131,070 entries and a QER map of
65,535. Those maps are allocated at startup and charged to the pod, about
115 MiB, a working set of about 140 MiB with the process. The chart's
default memory limit is 128 Mi, set for the 1024-entry maps of the 0.7.1
image, so an image built from main fails at startup with the chart's
defaults: "creating map: map create: cannot allocate memory".

The chart now sets UPF_MAX_SESSIONS to 1024 in defaultEnv, which keeps the
maps at the size the limit was set for (a working set of about 30 MiB),
and the README says how max_sessions and the memory limit scale together:
about 1.8 MiB per 1024 sessions on top of the process's ~30 MiB. In
ConfigMap mode max_sessions goes into config.data, since the default
variables are not injected there.

Measured on a kind cluster with the kubelet's accounting: main's defaults
start under 192 Mi and above, not under 128 Mi; with UPF_MAX_SESSIONS=1024
the pod starts under 128 Mi and passes the same tests as 0.7.1.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Martin Matyas <martin.matyas@tieto.com>
@pirog-spb
pirog-spb merged commit 4d53c90 into edgecomllc:main Oct 22, 2026
8 checks passed
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.

main doesn't start with the chart's defaults: maps sized from max_sessions need more than the 128 Mi memory limit

2 participants