Skip to content

Instantly share code, notes, and snippets.

@hivefans
Last active September 21, 2020 05:35
Show Gist options
  • Select an option

  • Save hivefans/5e672d76983646ee41f3 to your computer and use it in GitHub Desktop.

Select an option

Save hivefans/5e672d76983646ee41f3 to your computer and use it in GitHub Desktop.
Increase Indexing Performance - Elasticsearch|-|{"files":{"ImproveIndexingPerformance.sh":{"env":"plain"}},"tag":"bigdata"}
#!/bin/bash
#Close index
curl -XPOST "localhost:9200/$1/_close"
#refresh rate
curl -XPUT "localhost:9200/$1/_settings" -d '{
"index" : {
"refresh_interval" :-1
}
}'
#merge policy
curl -XPUT "localhost:9200/$1/_settings" -d '{
"index" : {
"index.merge.policy.merge_factor" : 30
}
}'
#replicas
curl -XPUT "localhost:9200/$1/_settings" -d '{
"index" : {
"number_of_replicas" : 0
}
}'
#flush
curl -XPUT "localhost:9200/$1/_settings" -d '{
"index":{
"index.translog.flush_threshold_size":10000
}
}'
#buffer
curl -XPUT "localhost:9200/$1/_settings" -d '{
"index":{
"indices.memory.index_buffer_size": 30
}
}'
curl -XPOST "localhost:9200/$1/_open"
@the-marlabs
Copy link

How to execute/run this? I'm using ES with Python Client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment