[helm] force 2 procs to JVM when cpu.requests <= 1000 #1693
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.
Issue(s)
k8s - force 2 procs to JVM when cpu.requests <= 1000
Description
For small or lightly used environments, we'd like to have cpu.requests<=1000m.
Problem when we do this is java thinks there is only one proc and this hurts the parallel computation capabilities, especially in the simple create flow
Java behaviour based on cpu.requests
When cpu.requests is smaller than or equal to 1000m, we should pass the argument
-XX:ActiveProcessorCount=2
This PR adds the logic to dynamically pass this argument in JAVA_OPTS of coordinator / scheduler / worker deployments based on the cpu request count
Testing
Tested via helm install dry run with different values for cpu requests of coordinator, scheduler and workers
helm install startree-thirdeye --dry-run --debug --generate-name --set coordinator.resources.requests.cpu=<coordinator-cpu> --set scheduler.resources.requests.cpu=<scheduler-cpu> --set worker.resources.requests.cpu=<worker-cpu>
Snippets from helm output:
Cases when cpu requests <= 1.0 / 1000m
Cases when cpu requests > 1.0 / 1000m