From 5a859230cf5d9097d4d6c8d8e33981ebb3eac1a6 Mon Sep 17 00:00:00 2001 From: alxhu <32041622+alxhu-dev@users.noreply.github.com> Date: Sat, 1 Jun 2024 22:58:08 +0200 Subject: [PATCH] Add tip to allocate more memory if Elasticsearch crashes to elasticsearch.md When creating Elasticsearch indicies, the process could crash if there is not enough memory allocated to the JVM runtime. This commit adds a hint for administrators to try to allocate more memory to Elasticsearch if they're experiencing out-of-memory issues. --- content/en/admin/elasticsearch.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/content/en/admin/elasticsearch.md b/content/en/admin/elasticsearch.md index 17bb3e2b3..db4bc35ad 100644 --- a/content/en/admin/elasticsearch.md +++ b/content/en/admin/elasticsearch.md @@ -151,6 +151,23 @@ cd live RAILS_ENV=production bin/tootctl search deploy ``` +{{< hint style="info" >}} +Creating Elasticsearch indicies could require more memory than the JVM (Java Virtual Machine) provides. If Elasticsearch crashes while creating indicies, try to allocate more memory. + +1. Create and open a file in the directory ```/etc/elasticsearch/jvm.options.d/``` (for example: ```nano /etc/elasticsearch/jvm.options.d/ram.options```) +2. Add following text and edit the allocated memory to your needs. As a rule of thumb, Elasticsearch should use about 25%-50% of your available memory. Do not allocate more memory than available. +``` +# Xms represents the initial size of total heap space +# Xmx represents the maximum size of total heap space +# Both values should be the same +-Xms2048m +-Xmx2048m +``` +3. Save the file. +4. Restart Elasticsearch using ```systemctl restart elasticsearch```. +5. Retry creating Elasticsearch indicies. If Elasticsearch still crashes, try to set a higher number. +{{< /hint >}} + ## Search optimization for other languages ### Chinese search optimization {#chinese-search-optimization}