Fix Elasticsearch memory hogging the right way #2909
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.
Fixes
Related to 6cdfb59
Description
I noticed that Elasticsearch was happily using 60% of my system RAM. At one point today this actually caused an OOM issue in my kernel during a
just recreate
run, despite having 32 GB RAM! The overrides file does not work for me (ES just crashes instead of staying within the limit). However, I remembered from the work I recently did to fix our production ES 8 cluster's heap configuration, that ES will respect heap limits passed as JVM args. Therefore, we can get rid of the overrides file (which we didn't really like any way) and use the heap limits. I've set them to half a gig, which should be just fine for local testing.Testing Instructions
Checkout this branch and run
just down && just up
and confirm that Elasticsearch does not use 60% of your system memory 😁Run
just down -v && just up && just init
and confirm that ingestion still works locally.Note: This might slow down ingestion locally by a very small amount of time. When I run it locally I don't see an issue but for other computer configurations it may behave differently. If that's the case, we can increase it to 1 GB or all the way to the 2 GB that the previous overrides would have forced ES to use (remember it doesn't use the full amount of system memory available to it by default!).
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin