# Optimization not working

**URL:** <https://discuss.elastic.co/t/optimization-not-working/11532>\
**Category:** Elasticsearch\
**Created:** [April 10, 2013, 2:29pm UTC](https://discuss.elastic.co/t/optimization-not-working/11532 "2013-04-10T14:29:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarang\_dawer](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@tarang\_dawer](https://discuss.elastic.co/u/tarang_dawer)\
**Post date:** [April 10, 2013, 2:29pm UTC](https://discuss.elastic.co/t/optimization-not-working/11532/1 "2013-04-10T14:29:57Z")

</div>

Hi all  
i have an index of around 10 gb , with 5 shards , and 0 replicas.  
i submit an optimize command through rest with max\_number\_segments =5 ,  
while using default merge policy. Although it returns with a proper  
response on the browser , i do not see any activity happening in the  
background, no io waits increasing , no cpu cycle increase in utilization .  
The index is distributed on 5 nodes , along with other indexes , with each  
shard on separate machine/node , with being allocated 8 Gb heap size each.

Could somebody please help me figure out how/why this is happening and how  
could i resolve it ?

Thanks  
Tarang Dawer

--  
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:** ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)\
**Post date:** [April 10, 2013, 2:46pm UTC](https://discuss.elastic.co/t/optimization-not-working/11532/2 "2013-04-10T14:46:06Z")

</div>

can you check how many segments you actually have via the segments API?

> **[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.

simon

On Wednesday, April 10, 2013 4:29:57 PM UTC+2, tarang dawer wrote:

> Hi all  
> i have an index of around 10 gb , with 5 shards , and 0 replicas.  
> i submit an optimize command through rest with max\_number\_segments =5 ,  
> while using default merge policy. Although it returns with a proper  
> response on the browser , i do not see any activity happening in the  
> background, no io waits increasing , no cpu cycle increase in utilization .  
> The index is distributed on 5 nodes , along with other indexes , with each  
> shard on separate machine/node , with being allocated 8 Gb heap size each.
> 
> Could somebody please help me figure out how/why this is happening and how  
> could i resolve it ?
> 
> Thanks  
> Tarang Dawer

--  
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:** ![tarang\_dawer](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@tarang\_dawer](https://discuss.elastic.co/u/tarang_dawer)\
**Post date:** [April 10, 2013, 3:30pm UTC](https://discuss.elastic.co/t/optimization-not-working/11532/3 "2013-04-10T15:30:53Z")

</div>

i checked , i still have 18 segments for the index , each consisting of  
varying size, 90 , 51 , 65 42 mb's etc, for each shard . Despite the  
optimize command , the segments structure remains the same. is there  
something else required to be done to "force" merging / optimization ?

On Wed, Apr 10, 2013 at 8:16 PM, simonw  
[simon.willnauer@elasticsearch.com](mailto:simon.willnauer@elasticsearch.com)wrote:

> can you check how many segments you actually have via the segments API?
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-segments/)
> 
> simon
> 
> On Wednesday, April 10, 2013 4:29:57 PM UTC+2, tarang dawer wrote:
> 
> > Hi all  
> > i have an index of around 10 gb , with 5 shards , and 0 replicas.  
> > i submit an optimize command through rest with max\_number\_segments =5 ,  
> > while using default merge policy. Although it returns with a proper  
> > response on the browser , i do not see any activity happening in the  
> > background, no io waits increasing , no cpu cycle increase in utilization .  
> > The index is distributed on 5 nodes , along with other indexes , with  
> > each shard on separate machine/node , with being allocated 8 Gb heap size  
> > each.
> > 
> > Could somebody please help me figure out how/why this is happening and  
> > how could i resolve it ?
> > 
> > Thanks  
> > Tarang Dawer
> 
> --  
> 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:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [April 11, 2013, 1:42am UTC](https://discuss.elastic.co/t/optimization-not-working/11532/4 "2013-04-11T01:42:48Z")

</div>

That math is right. You will have max 5 segments per shard. You can force  
down to 5 segments total, 1 per shard by setting max\_number\_segments=1.

Best Regards,  
Paul

On Wednesday, April 10, 2013 9:30:53 AM UTC-6, tarang dawer wrote:

> i checked , i still have 18 segments for the index , each consisting of  
> varying size, 90 , 51 , 65 42 mb's etc, for each shard . Despite the  
> optimize command , the segments structure remains the same. is there  
> something else required to be done to "force" merging / optimization ?
> 
> On Wed, Apr 10, 2013 at 8:16 PM, simonw \<[simon.w...@elasticsearch.com](mailto:simon.w...@elasticsearch.com)\<javascript:\>
> 
> > wrote:
> 
> > can you check how many segments you actually have via the segments API?
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-segments/)
> > 
> > simon
> > 
> > On Wednesday, April 10, 2013 4:29:57 PM UTC+2, tarang dawer wrote:
> > 
> > > Hi all  
> > > i have an index of around 10 gb , with 5 shards , and 0 replicas.  
> > > i submit an optimize command through rest with max\_number\_segments =5 ,  
> > > while using default merge policy. Although it returns with a proper  
> > > response on the browser , i do not see any activity happening in the  
> > > background, no io waits increasing , no cpu cycle increase in utilization .  
> > > The index is distributed on 5 nodes , along with other indexes , with  
> > > each shard on separate machine/node , with being allocated 8 Gb heap size  
> > > each.
> > > 
> > > Could somebody please help me figure out how/why this is happening and  
> > > how could i resolve it ?
> > > 
> > > Thanks  
> > > Tarang Dawer
> > 
> > --  
> > 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:41am UTC](https://discuss.elastic.co/t/optimization-not-working/11532/5 "2017-07-06T02:41:39Z")

</div>


