Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Elasticsearch memory hogging the right way #2909

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

sarayourfriend
Copy link
Collaborator

@sarayourfriend sarayourfriend commented Aug 28, 2023

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

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • [N/A] I added or updated tests for the changes I made (if applicable).
  • [N/A] I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • [N/A] I ran the DAG documentation generator (if applicable).

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@sarayourfriend sarayourfriend added 🟨 priority: medium Not blocking but should be addressed soon 🛠 goal: fix Bug fix 🤖 aspect: dx Concerns developers' experience with the codebase 🧱 stack: mgmt Related to repo management and automations labels Aug 28, 2023
@sarayourfriend sarayourfriend requested a review from a team as a code owner August 28, 2023 02:39
@github-actions github-actions bot added 🧱 stack: api Related to the Django API 🧱 stack: ingestion server Related to the ingestion/data refresh server labels Aug 28, 2023
@sarayourfriend sarayourfriend force-pushed the fix/elasticsearch-memory-hog branch from f0fbf67 to f678460 Compare August 28, 2023 02:44
Copy link
Member

@krysal krysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with api/recreate as it does the same in one command for the API only 😄 I confirm it uses fewer memory resources.

Nice to remove a file here. If it's slowing down ingestion even by a bit then it's better to give it a full GB, a reasonable middle term I think.

@sarayourfriend sarayourfriend merged commit 9afc32a into main Aug 28, 2023
@sarayourfriend sarayourfriend deleted the fix/elasticsearch-memory-hog branch August 28, 2023 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API 🧱 stack: ingestion server Related to the ingestion/data refresh server 🧱 stack: mgmt Related to repo management and automations
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants