Add hint to allocate more memory if Elasticsearch crashes (#1456)

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.
This commit is contained in:
alxhu 2024-09-13 11:25:19 +02:00 committed by GitHub
parent 54659f9371
commit 599173ae8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 0 deletions

View File

@ -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}