# Why disk read is high than disk write?

**URL:** https://discuss.elastic.co/t/why-disk-read-is-high-than-disk-write/20574
**Category:** Elasticsearch
**Created:** [November 5, 2014, 8:14am UTC](https://discuss.elastic.co/t/why-disk-read-is-high-than-disk-write/20574 "2014-11-05T08:14:53Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![11172](https://avatars.discourse-cdn.com/v4/letter/1/43a26b/32.png) [@11172](https://discuss.elastic.co/u/11172)
#### Post date: [November 5, 2014, 8:14am UTC](https://discuss.elastic.co/t/why-disk-read-is-high-than-disk-write/20574/1 "2014-11-05T08:14:53Z")

</div>

hi! my first question!

if replica 0 bulk index, then disk read, write ratio same.  
but batch finish after... disk read is high than write.  
disk read = 10 X disk write...

so cpu load is high, then batch index very slow.. T.T

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8b0c64a1-6aec-4e3c-a13a-723087919c77%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8b0c64a1-6aec-4e3c-a13a-723087919c77%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [November 5, 2014, 8:24am UTC](https://discuss.elastic.co/t/why-disk-read-is-high-than-disk-write/20574/2 "2014-11-05T08:24:53Z")

</div>

I think there are two potential causes:

- refreshes
- id lookups

Refreshes run periodically in order to make data fast to search,

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

gives recommandations to improve indexing speed by increasing the refresh  
interval.

Id lookups are required in order to check if the document that you are  
indexing is replacing another document. Note however that since  
Elasticsearch 1.2, Elasticsearch can skip this step if you use  
auto-generated ids: [https://github.com/elasticsearch/elasticsearch/pull/5917](https://github.com/elasticsearch/elasticsearch/pull/5917)

On Wed, Nov 5, 2014 at 9:14 AM, 이윤동 [leeyd81@gmail.com](mailto:leeyd81@gmail.com) wrote:

> hi! my first question!
> 
> if replica 0 bulk index, then disk read, write ratio same.  
> but batch finish after... disk read is high than write.  
> disk read = 10 X disk write...
> 
> so cpu load is high, then batch index very slow.. T.T
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/8b0c64a1-6aec-4e3c-a13a-723087919c77%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8b0c64a1-6aec-4e3c-a13a-723087919c77%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/8b0c64a1-6aec-4e3c-a13a-723087919c77%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8b0c64a1-6aec-4e3c-a13a-723087919c77%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6GROAzcX0BChLjfcgKP7TaKt-sBoTukrpc2a4W2U0%2BuA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6GROAzcX0BChLjfcgKP7TaKt-sBoTukrpc2a4W2U0%2BuA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [November 5, 2014, 8:32am UTC](https://discuss.elastic.co/t/why-disk-read-is-high-than-disk-write/20574/3 "2014-11-05T08:32:59Z")

</div>

Merges probably also play a part here.

On 5 November 2014 19:24, Adrien Grand [adrien.grand@elasticsearch.com](mailto:adrien.grand@elasticsearch.com)  
wrote:

> I think there are two potential causes:
> 
> - refreshes
> - id lookups
> 
> Refreshes run periodically in order to make data fast to search,  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/performance-considerations-elasticsearch-indexing/)  
> gives recommandations to improve indexing speed by increasing the refresh  
> interval.
> 
> Id lookups are required in order to check if the document that you are  
> indexing is replacing another document. Note however that since  
> Elasticsearch 1.2, Elasticsearch can skip this step if you use  
> auto-generated ids:  
> [https://github.com/elasticsearch/elasticsearch/pull/5917](https://github.com/elasticsearch/elasticsearch/pull/5917)
> 
> On Wed, Nov 5, 2014 at 9:14 AM, 이윤동 [leeyd81@gmail.com](mailto:leeyd81@gmail.com) wrote:
> 
> > hi! my first question!
> > 
> > if replica 0 bulk index, then disk read, write ratio same.  
> > but batch finish after... disk read is high than write.  
> > disk read = 10 X disk write...
> > 
> > so cpu load is high, then batch index very slow.. T.T
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/8b0c64a1-6aec-4e3c-a13a-723087919c77%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8b0c64a1-6aec-4e3c-a13a-723087919c77%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/8b0c64a1-6aec-4e3c-a13a-723087919c77%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8b0c64a1-6aec-4e3c-a13a-723087919c77%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> Adrien Grand
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6GROAzcX0BChLjfcgKP7TaKt-sBoTukrpc2a4W2U0%2BuA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6GROAzcX0BChLjfcgKP7TaKt-sBoTukrpc2a4W2U0%2BuA%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6GROAzcX0BChLjfcgKP7TaKt-sBoTukrpc2a4W2U0%2BuA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6GROAzcX0BChLjfcgKP7TaKt-sBoTukrpc2a4W2U0%2BuA%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAF3ZnZ%3DV0Z79i\_CWyZBV-9UdfF%2BX-6gatQJ0wzLnwHTVg\_RbWw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAF3ZnZ%3DV0Z79i_CWyZBV-9UdfF%2BX-6gatQJ0wzLnwHTVg_RbWw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![11172](https://avatars.discourse-cdn.com/v4/letter/1/43a26b/32.png) [@11172](https://discuss.elastic.co/u/11172)
#### Post date: [November 5, 2014, 8:51am UTC](https://discuss.elastic.co/t/why-disk-read-is-high-than-disk-write/20574/4 "2014-11-05T08:51:37Z")

</div>

thanks answer!

when replica 0, index speed fast,  
when replica 1, index speed very slow...

refresh interval same.120s  
id lookup is good point.  
but we need out id, can't use auto-generated id.. T.T

and when replica 0 and 1, always id lookup.

2014년 11월 5일 수요일 오후 5시 14분 54초 UTC+9, 이윤동 님의 말:

> hi! my first question!
> 
> if replica 0 bulk index, then disk read, write ratio same.  
> but batch finish after... disk read is high than write.  
> disk read = 10 X disk write...
> 
> so cpu load is high, then batch index very slow.. T.T

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/99a66b9e-2373-49d1-be46-c47c2c76987a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/99a66b9e-2373-49d1-be46-c47c2c76987a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)
#### Post date: [November 5, 2014, 9:00am UTC](https://discuss.elastic.co/t/why-disk-read-is-high-than-disk-write/20574/5 "2014-11-05T09:00:32Z")

</div>

Something that could happen is that with 0 replicas all the data fit into  
your filesystem cache (so everything is done in memory) while with 1  
replica, some filesystem operations are translated to actual disk seeks.

Another different between 0 and 1 replicas is that in the latter case,  
elasticsearch will wait for the data to be written on 2 shards before  
returning. When indexing is slow, are you maxing out the CPU and I/O of  
your machine? If not then maybe you just need to increase the concurrency  
of indexing requests on client side?

On Wed, Nov 5, 2014 at 9:51 AM, 이윤동 [leeyd81@gmail.com](mailto:leeyd81@gmail.com) wrote:

> thanks answer!
> 
> when replica 0, index speed fast,  
> when replica 1, index speed very slow...
> 
> refresh interval same.120s  
> id lookup is good point.  
> but we need out id, can't use auto-generated id.. T.T
> 
> and when replica 0 and 1, always id lookup.
> 
> 2014년 11월 5일 수요일 오후 5시 14분 54초 UTC+9, 이윤동 님의 말:
> 
> > hi! my first question!
> > 
> > if replica 0 bulk index, then disk read, write ratio same.  
> > but batch finish after... disk read is high than write.  
> > disk read = 10 X disk write...
> > 
> > so cpu load is high, then batch index very slow.. T.T
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/99a66b9e-2373-49d1-be46-c47c2c76987a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/99a66b9e-2373-49d1-be46-c47c2c76987a%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/99a66b9e-2373-49d1-be46-c47c2c76987a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/99a66b9e-2373-49d1-be46-c47c2c76987a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7Ki0k3BNtbLo%3DaRToOJMCtyuBGO3u\_%3D6UymNcejjkPwg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j7Ki0k3BNtbLo%3DaRToOJMCtyuBGO3u_%3D6UymNcejjkPwg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![11172](https://avatars.discourse-cdn.com/v4/letter/1/43a26b/32.png) [@11172](https://discuss.elastic.co/u/11172)
#### Post date: [November 5, 2014, 9:36am UTC](https://discuss.elastic.co/t/why-disk-read-is-high-than-disk-write/20574/6 "2014-11-05T09:36:05Z")

</div>

our index data is over 10T, so not enough in memory. ( 10 machine, memory  
max 24g )

cpu is now 20 ~ 30%, wait cpu 20 ~ 25%.  
disk read 60m, write 6m  
cpu load 20

the problem...

- disk read very high( no search ) -\> cpu load high -\> index slow...  
out goal disk read decrease.

add question!  
our cluster 10 machine. but 1 ~ 2 machie converge bulk request.  
we use java TransportClinet

2014년 11월 5일 수요일 오후 5시 14분 54초 UTC+9, 이윤동 님의 말:

> hi! my first question!
> 
> if replica 0 bulk index, then disk read, write ratio same.  
> but batch finish after... disk read is high than write.  
> disk read = 10 X disk write...
> 
> so cpu load is high, then batch index very slow.. T.T

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/91324af8-dc4a-449f-939a-1594c4a8e0fa%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/91324af8-dc4a-449f-939a-1594c4a8e0fa%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [July 6, 2017, 12:52am UTC](https://discuss.elastic.co/t/why-disk-read-is-high-than-disk-write/20574/7 "2017-07-06T00:52:04Z")

</div>


