# What is causing refreshes?

**URL:** https://discuss.elastic.co/t/what-is-causing-refreshes/119289
**Category:** Elasticsearch
**Created:** [February 9, 2018, 6:11pm UTC](https://discuss.elastic.co/t/what-is-causing-refreshes/119289 "2018-02-09T18:11:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![apechimp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apechimp/32/27582_2.png) [@apechimp](https://discuss.elastic.co/u/apechimp)
#### Post date: [February 9, 2018, 6:11pm UTC](https://discuss.elastic.co/t/what-is-causing-refreshes/119289/1 "2018-02-09T18:11:47Z")

</div>

I am using elasticsearch 5.6.4 and I have a very update heavy workload. I have my `refresh_interval` set to `10s`. However, I'm seeing hundreds of concurrent refreshes going on (with a max refresh time of ~5s). Is there a way to determine what is triggering these refreshes?

Based on [this](https://discuss.elastic.co/t/bulk-updates-are-extremely-slow-after-upgrading-to-5-2/79450/26), I've tried setting up a lock system so that the same document is only updated once every five minutes, but I'm still seeing this large amount of refreshes.

I am making all the updates as scripted upserts through the bulk api with `refresh=false`.

---

<div class="post-metadata">

### Author: ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)
#### Post date: [February 9, 2018, 7:42pm UTC](https://discuss.elastic.co/t/what-is-causing-refreshes/119289/2 "2018-02-09T19:42:11Z")

</div>

The updates are causing the refreshes. See [this](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/breaking_50_document_api_changes.html#_get_api) and [this](https://discuss.elastic.co/t/elasticsearch-bulk-update-is-extremely-slow/78258) and [this](https://discuss.elastic.co/t/bulk-updates-are-extremely-slow-after-upgrading-to-5-2/79450/24).

---

<div class="post-metadata">

### Author: ![apechimp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apechimp/32/27582_2.png) [@apechimp](https://discuss.elastic.co/u/apechimp)
#### Post date: [February 9, 2018, 8:57pm UTC](https://discuss.elastic.co/t/what-is-causing-refreshes/119289/3 "2018-02-09T20:57:58Z")

</div>

Yes. The updates are definitely the cause, so I suppose my lock system might not be working as intended. I'm wondering if there's any way to see which doc updates are causing an index refresh

---

<div class="post-metadata">

### Author: ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)
#### Post date: [February 9, 2018, 9:15pm UTC](https://discuss.elastic.co/t/what-is-causing-refreshes/119289/4 "2018-02-09T21:15:48Z")

</div>

if you want to know which index is getting the updates, you can look in the index stats to see which one has high merge activity.

if you want to know which documents are getting the updates, you could turn on slow query logging for a little while with a really low threshold.

---

<div class="post-metadata">

### Author: ![apechimp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apechimp/32/27582_2.png) [@apechimp](https://discuss.elastic.co/u/apechimp)
#### Post date: [February 9, 2018, 9:28pm UTC](https://discuss.elastic.co/t/what-is-causing-refreshes/119289/5 "2018-02-09T21:28:28Z")

</div>

Oh! That's a really good idea with the slow log. I'll give that a shot. Thanks!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 9, 2018, 9:28pm UTC](https://discuss.elastic.co/t/what-is-causing-refreshes/119289/6 "2018-03-09T21:28:50Z")

</div>

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