IGN-15046: Add “auto” mode for max RAM percentage#11
Open
thirdgen88 wants to merge 4 commits intoinductiveautomation:mainfrom
Open
IGN-15046: Add “auto” mode for max RAM percentage#11thirdgen88 wants to merge 4 commits intoinductiveautomation:mainfrom
thirdgen88 wants to merge 4 commits intoinductiveautomation:mainfrom
Conversation
7e36a5e to
3dfac37
Compare
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.
📖 Background
When the Ignition Helm Chart was introduced, we had the
gateway.maxRAMPercentagevalue and associated feature that would drive additional wrapper and JVM args to enable a percentage based JVM Max Heap setting. You could set it to0to disable it, at which point you'd end up with whatever defaults come with the Docker image, i.e.1GiBJVM 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
automode forgateway.maxRAMPercentagethat, 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 behindignition.gateway.useMaxRAMPercentagetemplate, 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.useMaxRAMPercentagetemplate was updated to accommodate the newly allowedautovalue☑️ QA Notes
We should be able to evaluate a lot of this via
helm templatewithout actually installing the chart. Consider capturing the output of a base install, e.g.:helm template ignition path/to/pr/chart > default-output.yamlInspect the StatefulSet

gatewaycontainer args. Look for this portion:You can then setup a values file to experiment with various settings, e.g.:
... and re-run
helm template:Consider inspecting the unit tests as well that are now part of the chart, you can tweak those and run the tests locally with:
Fixes IGN-15046