# How to load /data directory into memory when I start ES

**URL:** <https://discuss.elastic.co/t/how-to-load-data-directory-into-memory-when-i-start-es/11575>\
**Category:** Elasticsearch\
**Created:** [April 14, 2013, 4:12pm UTC](https://discuss.elastic.co/t/how-to-load-data-directory-into-memory-when-i-start-es/11575 "2013-04-14T16:12:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Burak\_Emre\_Kabakci](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/burak_emre_kabakci/32/2212_2.png) [@Burak\_Emre\_Kabakci](https://discuss.elastic.co/u/Burak_Emre_Kabakci)\
**Post date:** [April 14, 2013, 4:12pm UTC](https://discuss.elastic.co/t/how-to-load-data-directory-into-memory-when-i-start-es/11575/1 "2013-04-14T16:12:31Z")

</div>

I have indexed my data in default index.store configuration (fs). However I  
have enough memory to keep all /data directory and I want to load /data  
directory into the memory when I start elasticsearch to boost performance.  
AFAIK if I change index.store.type to memory, there is no backup in  
filesystem and if I need to reboot the server I lose all data indexed in ES.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 15, 2013, 7:00am UTC](https://discuss.elastic.co/t/how-to-load-data-directory-into-memory-when-i-start-es/11575/2 "2013-04-15T07:00:20Z")

</div>

Hey

your assumptions are correct regarding the memory setting. If you do not  
have the chance to preload your data after creating an in-memory index, you  
might want to go with the store type 'mmapfs' (persistent, but using memory  
mapped files for reading).  
To read more about lucene and MMapDirectory, check out this excellent blog  
post [The Generics Policeman Blog: Use Lucene’s MMapDirectory on 64bit platforms, please!](http://blog.thetaphi.de/2012/07/use-lucenes-mmapdirectory-on-64bit.html)

Hope this helps

On Sun, Apr 14, 2013 at 6:12 PM, Burak Emre Kabakcı  
[emrekabakci@gmail.com](mailto:emrekabakci@gmail.com)wrote:

> I have indexed my data in default index.store configuration (fs). However  
> I have enough memory to keep all /data directory and I want to load /data  
> directory into the memory when I start elasticsearch to boost performance.  
> AFAIK if I change index.store.type to memory, there is no backup in  
> filesystem and if I need to reboot the server I lose all data indexed in ES.
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Burak\_Emre\_Kabakci](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/burak_emre_kabakci/32/2212_2.png) [@Burak\_Emre\_Kabakci](https://discuss.elastic.co/u/Burak_Emre_Kabakci)\
**Post date:** [April 18, 2013, 2:34pm UTC](https://discuss.elastic.co/t/how-to-load-data-directory-into-memory-when-i-start-es/11575/3 "2013-04-18T14:34:10Z")

</div>

Thanks, the article is awesome for newbies like me. I assume that I need to  
re-index my data because elasticsearch doesn't allow me to change  
index.store setting for existing index. I will give it a try and compare it  
to default filesystem index.store setting.

On Monday, April 15, 2013 10:00:20 AM UTC+3, Alexander Reelsen wrote:

> Hey
> 
> your assumptions are correct regarding the memory setting. If you do not  
> have the chance to preload your data after creating an in-memory index, you  
> might want to go with the store type 'mmapfs' (persistent, but using memory  
> mapped files for reading).  
> To read more about lucene and MMapDirectory, check out this excellent blog  
> post  
> [The Generics Policeman Blog: Use Lucene’s MMapDirectory on 64bit platforms, please!](http://blog.thetaphi.de/2012/07/use-lucenes-mmapdirectory-on-64bit.html)
> 
> Hope this helps
> 
> On Sun, Apr 14, 2013 at 6:12 PM, Burak Emre Kabakcı \<[emrek...@gmail.com](mailto:emrek...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I have indexed my data in default index.store configuration (fs). However  
> > I have enough memory to keep all /data directory and I want to load /data  
> > directory into the memory when I start elasticsearch to boost performance.  
> > AFAIK if I change index.store.type to memory, there is no backup in  
> > filesystem and if I need to reboot the server I lose all data indexed in ES.
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:40am UTC](https://discuss.elastic.co/t/how-to-load-data-directory-into-memory-when-i-start-es/11575/4 "2017-07-06T02:40:37Z")

</div>


