Skip to content

Add Elasticsearch memory configuration settings

Terri Chu requested to merge tchu-add-elasticsearch-memory-config-settings into main

What does this Merge Request do and why?

This MR has two changes in it:

  1. Add custom configuration for Elasticsearch JVM Heap Size
  2. Refactor how elasticsearch is configured to use the config.rake file instead of Ruby scripting

JVM Heap Size

Elasticsearch by default takes up 50% of available memory. This change overrides the minimum (Xms) and maximum (Xmx) JVM heap size and sets it to 2GB. The Xms and Xmx settings must be the same per the Elasticsearch documentation.

I believe this is enough for development due to the very small size of the Elasticsearch indexes created from the data seeded into gdk. Even after I've imported a large project, the total size of all indexes is < 1 GB.

Elasticsearch index sizes

image

Before / After Memory Consumption

elasticsearch usage before

PID 49004

image

elasticsearch usage after

PID 93350

image

How to test

I've tested this out locally using gdk reconfigure and it does the following:

with elasticsearch enabled: true in gdk.yml

  • creates the configuration files if it does not exist and uses the template to populate the new file
  • does not modify the file if it exists (This should be OK because if a user modifies the configuration files, they won't want them over-written after a reconfigure.)

with elasticsearch enabled: false in gdk.yml

  • does not create the configuration files

Merge Request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise Issue to follow-up.
  • Documentation added/updated, if needed.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.
Edited by Terri Chu

Merge request reports