When creating a new index, we often see a significant and sustained increase in the number of internal refreshes. Merges are constantly triggered, affecting CPU usage and search speed accordingly. The only workaround we have found so far is to recreate the index with exactly the same parameters (preferably after restarting the cluster), but this is not always effective.
What could be causing this issue?
Some details:
Elasticsearch 7.17.5
refresh_interval - 5 minutes (though this seems unrelated, as the problematic index consistently shows a much higher number of internal refreshes compared to external ones)
We don't use Reindex API. Our service creates a new index with the same templates and then indexes the same documents there.
We rarely recreate indexes, so it's unclear what could be triggering this problem now. The only recent changes were the addition of new fields and a rank-feature.
I'm attaching a graph for elasticsearch_indices_merges_total_time_seconds_total parameter. You can see how merge time increased after creating a new index.