Repository navigation
fix: remove MALLOC_ARENA_MAX from VTA, DID hosting and VTC tuning - #163
Merged
Merged
Conversation
MALLOC_ARENA_MAX=2 capped glibc's malloc arenas so idle pods gave memory back (#143, #149). The VTA, VTC and DID hosting images now link jemalloc, which does not read the variable, so it does nothing on any current image. - internal/k8s/vta_resources.go: drop the variable from VtaTuningEnv, DidsTuningEnv and VtcTuningEnv. Add retiredTuningEnv and rename ensureTuningEnv to reconcileTuningEnv, which now also removes retired variables from existing Deployments. - internal/k8s/upgrade.go: SetDeploymentImage and RecoverDeploymentImage call the renamed helper, so the variable leaves each Deployment in the rollout of its next image change. No extra restart. - scripts/backfill-vta-malloc-arena.sh: deleted; there is nothing left to backfill. Hand-tuned Fjall values are still left alone. The variable is also removed when a Deployment is moved back to an image built before the jemalloc change, which then runs without the cap. Signed-off-by: Geoff Turk <geoff@ic3.dev>
vthwang
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
MALLOC_ARENA_MAX=2capped glibc's malloc arenas so idle pods gave memory back (#143, #149). The VTA, VTC and DID hosting images now link jemalloc, which does not read the variable, so it does nothing on any current image. Dev, staging and production are all on jemalloc images.What changes
VtaTuningEnv,DidsTuningEnvandVtcTuningEnvno longer setMALLOC_ARENA_MAX, so new Deployments are created without it.ensureTuningEnvbecomesreconcileTuningEnv. It still adds missing template variables, and now also removes the variables listed inretiredTuningEnv(onlyMALLOC_ARENA_MAXtoday).scripts/backfill-vta-malloc-arena.shis deleted.Effect on running Deployments
Nothing restarts when this is deployed. Each VTA, DID hosting and VTC Deployment loses the variable in the rollout of its next image upgrade, rollback or recovery, the same way it gained it.
Things to notice
STORAGE_FJALL_*values are still left alone. A hand-setMALLOC_ARENA_MAXis removed whatever its value.Testing
go vetandgo test ./internal/k8s/... ./internal/setup/... ./internal/upgrade/...pass in agolang:1.26container. New tests cover removal onvta,fs-vta,fs-didsandfs-vtcthrough bothSetDeploymentImageandRecoverDeploymentImage. Not exercised against a cluster.Related: ic3software/devops#165