# Doc Values Storage

**URL:** https://discuss.elastic.co/t/doc-values-storage/27476
**Category:** Elasticsearch
**Created:** [August 17, 2015, 6:25am UTC](https://discuss.elastic.co/t/doc-values-storage/27476 "2015-08-17T06:25:16Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![alexkru](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@alexkru](https://discuss.elastic.co/u/alexkru)
#### Post date: [August 17, 2015, 6:25am UTC](https://discuss.elastic.co/t/doc-values-storage/27476/1 "2015-08-17T06:25:16Z")

</div>

Hi all,  
We are using ES on AWS EC2 instances and we are want to reduce our JVM usage. The most common solution to this is to use doc values and thus reducing the in memory field data. When we tried it on a test system this is resulted with high I/O consumption and very large storage.  
We want to use the doc values in the ephemeral storage but when I looked into it the doc values files are stored with the all the other data.  
Is it possible to make a way to store the doc values only on another filesystem?

Thanks in advance,  
Alex.

---

<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: [August 17, 2015, 6:35am UTC](https://discuss.elastic.co/t/doc-values-storage/27476/2 "2015-08-17T06:35:44Z")

</div>

It's not, they are stored with the shards.

However doc values should not be generating large amounts of data, do you have more information around what you saw?

---

<div class="post-metadata">

### Author: ![alexkru](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@alexkru](https://discuss.elastic.co/u/alexkru)
#### Post date: [August 17, 2015, 7:35am UTC](https://discuss.elastic.co/t/doc-values-storage/27476/3 "2015-08-17T07:35:23Z")

</div>

First of all, thanks a lot for a quick response!

The file amount wasn't high, the I/O issues were because of read I/O and not write.  
This happened when we got about 1 mil documents per minute and then did a query for a few hours through the Kibana. Before the change to doc values the search crashed due to OutOfMemoryError, when we changed it to doc values the query could be after a very long time and the read I/O on the instance was very high in the time of the search.  
We thought maybe we could put the doc values files in a SSD disk with high IOPS but as you confirmed it cant be done.  
Can you suggest any other way to handle very high amount of data and not hurt the performance while searching?

---

<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: [August 17, 2015, 7:37am UTC](https://discuss.elastic.co/t/doc-values-storage/27476/4 "2015-08-17T07:37:31Z")

</div>

SSDs will help.

Do you have graphs of before and after doc values were implemented?

---

<div class="post-metadata">

### Author: ![alexkru](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@alexkru](https://discuss.elastic.co/u/alexkru)
#### Post date: [August 17, 2015, 8:02am UTC](https://discuss.elastic.co/t/doc-values-storage/27476/5 "2015-08-17T08:02:13Z")

</div>

Hi warkolm,

We don't have the graphs showing the described behavior.

I would like to emphasize that we have few TB of data in a write intensive cluster and the total heap size in the cluster isn't big enough to contain the needed field data cache for searches.

In order to overcome this, we manually deletes every 20 mins the field data cache so it's being generate from scratch each time user perform sort on data.

Putting all of the data on Ephemeral storage isn't an option (will multiple the total cost of the cluster).

Few questions:

1. Is it lucene restriction or Elasticsearch to have the doc values in a different FS (storage)?
2. Do you plan to support such feature in the future?
3. What do you suggest in such circumstances?

Your help is much appreciated.

Thanks,  
Alex.

---

<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: [August 17, 2015, 8:23am UTC](https://discuss.elastic.co/t/doc-values-storage/27476/6 "2015-08-17T08:23:23Z")

</div>

1. Elasticsearch, Lucene doesn't have field data.
2. I'm not aware of any feature requests for this.
3. Use SSDs/faster storage or add more nodes.

---

<div class="post-metadata">

### Author: ![alexkru](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@alexkru](https://discuss.elastic.co/u/alexkru)
#### Post date: [August 17, 2015, 8:55am UTC](https://discuss.elastic.co/t/doc-values-storage/27476/7 "2015-08-17T08:55:16Z")

</div>

While I did my research on the matter I saw that doc values are a Lucene feature, you can see a reference to this here:  
[https://lucene.apache.org/core/5\_1\_0/core/org/apache/lucene/index/DocValues.html](https://lucene.apache.org/core/5_1_0/core/org/apache/lucene/index/DocValues.html)  
[https://lucene.apache.org/core/5\_1\_0/core/org/apache/lucene/codecs/lucene50/Lucene50DocValuesFormat.html](https://lucene.apache.org/core/5_1_0/core/org/apache/lucene/codecs/lucene50/Lucene50DocValuesFormat.html)

I wanted to know whether the definition of the doc values data path is hard coded to be with the other data in Lucene or is it in Elasticsearch?

---

<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: [August 17, 2015, 10:14am UTC](https://discuss.elastic.co/t/doc-values-storage/27476/8 "2015-08-17T10:14:56Z")

</div>

Yep. You're right and I'm wrong! I thought it was purely an ES abstraction.

It may be defined in Lucene, but you won't be able to alter this in Elasticsearch without some hacking.

---

<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 5, 2017, 11:55pm UTC](https://discuss.elastic.co/t/doc-values-storage/27476/9 "2017-07-05T23:55:34Z")

</div>


