Skip to content

IGN-15046: Add “auto” mode for max RAM percentage#11

Open
thirdgen88 wants to merge 4 commits intoinductiveautomation:mainfrom
thirdgen88:IGN-15046-dynamic-heap-calc
Open

IGN-15046: Add “auto” mode for max RAM percentage#11
thirdgen88 wants to merge 4 commits intoinductiveautomation:mainfrom
thirdgen88:IGN-15046-dynamic-heap-calc

Conversation

@thirdgen88
Copy link
Copy Markdown
Member

@thirdgen88 thirdgen88 commented Apr 14, 2026

📖 Background

When the Ignition Helm Chart was introduced, we had the gateway.maxRAMPercentage value and associated feature that would drive additional wrapper and JVM args to enable a percentage based JVM Max Heap setting. You could set it to 0 to disable it, at which point you'd end up with whatever defaults come with the Docker image, i.e. 1GiB JVM Max Heap.

Missing was the ability to have the JVM Heap percentage scale automatically with memory resource limit changes, similar to how Ignition Cloud Edition VMs work.

⚙️ Changes

This PR introduces an opt-in auto mode for gateway.maxRAMPercentage that, when set, will set the JVM Max Heap percentage to a dynamic value based on applied resource limits. It is done via wrapper/JVM args like before in order to help easily diff the changes that will result from increasing memory limits. This is opposed to implementing the logic in runtime within the entrypoint shim.

Existing options to set to either 0 (disabled) or another number remain available.

There were a couple new helper templates added in order to keep things sane:

  • ignition.failIfNotNumber - This will fail the chart rendering if the input isn't a valid number. This helps catch a lot of invalid conditions earlier and keeps downstream code from having to worry about it.
  • ignition.memoryLimitToBytes - This is the key part of the dynamic heap percentage settings.
  • ignition.gateway.maxRAMPercentage - Assumed to be gated behind ignition.gateway.useMaxRAMPercentage template, this breaks out the logic for rendering the correct max RAM percentage that is to be applied.
  • ignition.gateway.initialRAMPercentage - Same general function as the max version, but defaults to that max when unspecified.

The ignition.gateway.useMaxRAMPercentage template was updated to accommodate the newly allowed auto value

☑️ QA Notes

We should be able to evaluate a lot of this via helm template without actually installing the chart. Consider capturing the output of a base install, e.g.:

helm template ignition path/to/pr/chart > default-output.yaml

Inspect the StatefulSet gateway container args. Look for this portion:
SCR-20260414-pnyc

You can then setup a values file to experiment with various settings, e.g.:

# ign-15046-values.yaml
gateway:
  maxRAMPercentage: "auto"
  resources:
    limits:
      cpu: 2000m
      memory: 1.5Gi
    requests:
      cpu: 2000m
      memory: 1.5Gi

... and re-run helm template:

# Run with custom values
helm template ignition path/to/pr/chart --values ign-15046-values.yaml > new-output.yaml
# Diff it and check for 50% settings (based on example above)
diff default-output.yaml new-output.yaml

Consider inspecting the unit tests as well that are now part of the chart, you can tweak those and run the tests locally with:

helm unittest path/to/pr/chart

Fixes IGN-15046

@thirdgen88 thirdgen88 force-pushed the IGN-15046-dynamic-heap-calc branch from 7e36a5e to 3dfac37 Compare April 20, 2026 22:16
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