@@ -146,48 +147,58 @@ for the changes to take effect.
...
@@ -146,48 +147,58 @@ for the changes to take effect.
## Special recommendations
## Special recommendations
### Indexing huge repositories
Here are some tips to use Elasticsearch with GitLab more efficiently.
Indexing huge git repositories can take a while, to speed up a process you can disable an auto refreshing. In our experience you can expect 20% time drop.
```
### Indexing large repositories
# Disable refreshing
curl -XPUT localhost:9200/_settings -d '{
Indexing large Git repositories can take a while. To speed up the process, you
can temporarily disable auto-refreshing. In our experience you can expect a 20%
time drop.
1. Disable refreshing:
```bash
curl -XPUT localhost:9200/_settings -d '{
"index" : {
"index" : {
"refresh_interval" : "-1"
"refresh_interval" : "-1"
} }'
} }'
```
1. (optional) You may want to disable replication and enable it after indexing:
# Enable refreshing again(after indexing)
```bash
curl -XPUT localhost:9200/_settings -d '{
curl -XPUT localhost:9200/_settings -d '{
"index" : {
"index" : {
"refresh_interval" : "1s"
"number_of_replicas" : 0
} }'
} }'
```
1.[Create the indexes](#add-gitlabs-data-to-the-elasticsearch-index)
# A force merge should be called after enabling the refreshing above
1. (optional) If you disabled replication in step 2, enable it after