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

Add hint to allocate more memory if Elasticsearch crashes #1456

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions content/en/admin/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down