# Optimum value for "max\_num\_segments"

**URL:** <https://discuss.elastic.co/t/optimum-value-for-max-num-segments/12733>\
**Category:** Elasticsearch\
**Created:** [July 10, 2013, 5:06am UTC](https://discuss.elastic.co/t/optimum-value-for-max-num-segments/12733 "2013-07-10T05:06:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![subin](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@subin](https://discuss.elastic.co/u/subin)\
**Post date:** [July 10, 2013, 5:06am UTC](https://discuss.elastic.co/t/optimum-value-for-max-num-segments/12733/1 "2013-07-10T05:06:53Z")

</div>

Hi,

I have an ES v0.90.0 running on a single server with 1 shard 0 replica per  
index configuration.  
What is the optimum value for the old index optimize call:

curl -XPOST '[http://localhost:9200/twitter/\_optimize?max\_num\_segments=](http://localhost:9200/twitter/_optimize?max_num_segments=)_2_'

Should it be 2 or 3? How should it be decided? These are Logstash indexes  
and they are rotated  
daily. Therefore I plan to run the call once everyday.

Thanks,

--  
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:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [July 10, 2013, 8:34am UTC](https://discuss.elastic.co/t/optimum-value-for-max-num-segments/12733/2 "2013-07-10T08:34:44Z")

</div>

Hello,

1 will give you the best search times, but it will put the most stress on  
your system. So I would use 1, unless I'd be bothered by load.

If you are bothered by load, the best way to find a good trade-off is to  
test different values while monitor your system with something like  
SPM[http://sematext.com/spm/elasticsearch-performance-monitoring/](http://sematext.com/spm/elasticsearch-performance-monitoring/)  
.

Best regards,  
Radu

On Wed, Jul 10, 2013 at 8:06 AM, subin [ksubins321@gmail.com](mailto:ksubins321@gmail.com) wrote:

> Hi,
> 
> I have an ES v0.90.0 running on a single server with 1 shard 0 replica per  
> index configuration.  
> What is the optimum value for the old index optimize call:
> 
> curl -XPOST '[http://localhost:9200/twitter/\_optimize?max\_num\_segments=\*2](http://localhost:9200/twitter/_optimize?max_num_segments=*2)\*'
> 
> Should it be 2 or 3? How should it be decided? These are Logstash indexes  
> and they are rotated  
> daily. Therefore I plan to run the call once everyday.
> 
> Thanks,
> 
> --  
> 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).

--  
[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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:** ![subin](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@subin](https://discuss.elastic.co/u/subin)\
**Post date:** [July 11, 2013, 6:03am UTC](https://discuss.elastic.co/t/optimum-value-for-max-num-segments/12733/3 "2013-07-11T06:03:21Z")

</div>

1 will give you the best search times, but it will put the most stress on

> your system.

Does this extra stress occur on the system during the time optimize call is  
being run? Or does optimizing by 1 put more stress on the system later  
on also, when each time a search is run than what would have been if it was  
2 or 3?

Re,

--  
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:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [July 11, 2013, 10:43am UTC](https://discuss.elastic.co/t/optimum-value-for-max-num-segments/12733/4 "2013-07-11T10:43:02Z")

</div>

Hello,

No, just during the optimize call. Later, your searches should be faster,  
and should put less stress on your system.

If you need to find out "how much faster" and "how much less load", you'd  
probably have to test for your particular use-case.

On Thu, Jul 11, 2013 at 9:03 AM, subin ks [ksubins321@gmail.com](mailto:ksubins321@gmail.com) wrote:

> 1 will give you the best search times, but it will put the most stress on
> 
> > your system.
> 
> Does this extra stress occur on the system during the time optimize call  
> is being run? Or does optimizing by 1 put more stress on the system later  
> on also, when each time a search is run than what would have been if it  
> was 2 or 3?
> 
> Re,
> 
> --  
> 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).

--  
[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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:** ![subin](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@subin](https://discuss.elastic.co/u/subin)\
**Post date:** [July 11, 2013, 3:21pm UTC](https://discuss.elastic.co/t/optimum-value-for-max-num-segments/12733/5 "2013-07-11T15:21:09Z")

</div>

That is nice.

Thanks Radu,  
Subin

On Thu, Jul 11, 2013 at 4:13 PM, Radu Gheorghe  
[radu.gheorghe@sematext.com](mailto:radu.gheorghe@sematext.com)wrote:

> Hello,
> 
> No, just during the optimize call. Later, your searches should be faster,  
> and should put less stress on your system.
> 
> If you need to find out "how much faster" and "how much less load", you'd  
> probably have to test for your particular use-case.
> 
> On Thu, Jul 11, 2013 at 9:03 AM, subin ks [ksubins321@gmail.com](mailto:ksubins321@gmail.com) wrote:
> 
> > 1 will give you the best search times, but it will put the most stress on
> > 
> > > your system.
> > 
> > Does this extra stress occur on the system during the time optimize call  
> > is being run? Or does optimizing by 1 put more stress on the system later  
> > on also, when each time a search is run than what would have been if it  
> > was 2 or 3?
> > 
> > Re,
> > 
> > --  
> > 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).
> 
> --  
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/LSbF1Q0XTDY/unsubscribe](https://groups.google.com/d/topic/elasticsearch/LSbF1Q0XTDY/unsubscribe).  
> To unsubscribe from this group and all its topics, 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:** ![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:26am UTC](https://discuss.elastic.co/t/optimum-value-for-max-num-segments/12733/6 "2017-07-06T02:26:58Z")

</div>


