Refresh Interval Value for Read-only index

Does it really matter what values we set in refresh_interval for a read-only index? I'm re-indexing a huge index that contains legacy data and is never updated i.e read-only (RO).

Before re-indexing, in order to boost performance I'm setting "refresh_interval": -1. Once re-indexing is over, it is necessary for me to reset the refresh_interval back to say "30s" or "60s".

I'm wondering if not re-setting back to 30s or 60s will make any difference since this index isn't going to get any data post re-indexing.

ELK Stack Version: 5.5.1

You can also keep it to -1 and call the refresh API explicitly.

2 Likes

Yes in theory you need to at least refresh it once when your done, unless something else did it for you. Thats why @dadoonet says you can leave it disabled but need to refresh it manually after.

1 Like

Thank you @martinr_ubi and @dadoonet for the succinct clarification.

So if i fire a GET _cat/indices/<that_index_name> does it get refreshed?

1 Like

No. It does not call refresh.

2 Likes

For the benefit of future readers, in 7.0 and later the right thing to do in this case is to leave index.refresh_interval unset, thanks to the new index.search.idle.after setting. The default behaviour is now not to refresh indices that are not being searched, even if you are indexing into them.

Way back in 5.5.1, however, I think the best thing to do is as David suggests: leave it at -1 and explicitly call POST /index/_refresh when you have finished indexing. I think you will also see no ill effects if you set it to a time like 30s or 60s (or even back to the default of 1s) since Elasticsearch will skip refreshes on indices that have not changed since the last refresh.

3 Likes

Excellent. Thank you for the additional details @DavidTurner

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.