Pablo Morelli
Pablo Morelli

Reputation: 133

ElasticSearch - Setting readonly to an index improves performance?

I have this scenario where a system generates an index every day inside a node. Each index has 1 primary shard.

So, all the documents indexed in a day goes to a certain index, and after the day passed, a new index is created.

I keep the indices of the last 60 days (so this means that I always have 60 shards in the node). I can't close the old indices because I want them to support searches. After the 60th day passed then I delete them.

As I was reading the following article I noticed this about the index buffer:

It defaults to 10%, meaning that 10% of the total memory allocated to a node will be used as the indexing buffer size. This amount is then divided between all the different shards

This means that for the index of the day I have 10% / 60 of buffer index memory. So I am not really using the 10%.

The question is, what happens if I set to read only the older indices:

index.blocks.read_only Set to true to make the index and index metadata read only, false to allow writes and metadata changes.

Will I see a benefit for doing this? Like having the entire 10% of index buffer in my only writable index? Or an improve in the searches of the other indices since they can be merged in an only segmented as they do not longer recieves writes?

Thanks!

Pablo

PD: Im using ElasticSearch 1.7.3 but Im looking forward to migrate to 2.2 in a future. I would like to know, if possible, if I have a benefit if this would be translated to 2.2

Upvotes: 1

Views: 957

Answers (1)

Lee H
Lee H

Reputation: 5177

No, you won't get a benefit from adding the read_only block. The only way you would free up the buffer is to close the index entirely.

Also, you may be interested to know about https://github.com/elastic/elasticsearch/pull/14121 which gives "actively indexing" shards a bigger share of the buffer. Coming in Elasticsearch 5.0.

Upvotes: 1

Related Questions