Improve Kubeappsapis default config #3699
Merged
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.
Description of the change
As outlined in #3567 (comment), this PR addresses one of the proposals to mitigate the effect of some memory peeks we don't control (that is, instant allocated memory prior to a GC pass). It mostly limits the number of concurrent operations. For instance, with 256MB only ~3-4 upgrades operations can be performed, due to we (well, the Helm library in this case) need to parse the data, validate it and other stuff.
Also, this PR increases the number of default replicas (as in the original Kubeops pod) from
1
to2
. This way, in case of an OOMKilled event, the user won't notice any error (unless they were doing many concurrent actions and they continue doing so).Finally, it decreases the temporary memory increase we did for merging the deps PR. The value decreases from
512
to256
MB.Benefits
This PR tries to increase the velocity the GC is called (it has a "price", which is a slightly higher CPU consumption, but since we don't have any CPU-intensive process, I think the tradeoff is worth it. Nevertheless. the chosen value
GOGC
is rather arbitrary so a more thoughtful analysis would be required in order to determine the value that maximizes the overall performance. Note this is not a trivial thing and ever there are some commercial solutions for doing so (example).Possible drawbacks
Even though this PR does its best to improve the overall performance and error rate, some changes in the code are still required. Also, note these changes just mitigates the problem, but do not solve it completely.
Applicable issues
getChart
fetches the whole repo each time it's invoked #3567Additional information
N/A