# Switching back to ConcurrentMergeScheduler

**URL:** <https://discuss.elastic.co/t/switching-back-to-concurrentmergescheduler/17085>\
**Category:** Elasticsearch\
**Created:** [April 18, 2014, 7:01pm UTC](https://discuss.elastic.co/t/switching-back-to-concurrentmergescheduler/17085 "2014-04-18T19:01:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Smith\_2](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@David\_Smith\_2](https://discuss.elastic.co/u/David_Smith_2)\
**Post date:** [April 18, 2014, 7:01pm UTC](https://discuss.elastic.co/t/switching-back-to-concurrentmergescheduler/17085/1 "2014-04-18T19:01:06Z")

</div>

I see that ES switch back to ConcurrentMergeScheduler in 1.1.1 due to it  
affecting indexing performance in 1.1.0.

> <https://github.com/elastic/elasticsearch/issues/5817>

We're on 1.1.0 and cannot upgrade to 1.1.1 for the time being. Is there a  
way to switch it back using the API? I tried the following command, but it  
seems to not take.

curl -i -XPUT localhost:9200/\_cluster/settings -d '{ "persistent": {  
"index.merge.scheduler.type":  
"org.elasticsearch.index.merge.scheduler.ConcurrentMergeSchedulerProvider"  
} }'  
HTTP/1.1 200 OK  
Content-Type: application/json; charset=UTF-8  
Content-Length: 52

{"acknowledged":true,"persistent":{},"transient":{}}

It does not seem to be set when I try to re-GET it (and no errors in logs  
at DEBUG level or above).

curl -i -XGET localhost:9200/\_cluster/settings  
HTTP/1.1 200 OK  
Content-Type: application/json; charset=UTF-8  
Content-Length: 66

{"persistent":{"threadpool":{"bulk":{"size":"8"}}},"transient":{}}

Am using the wrong way of specifying the scheduler? I also tried just  
specifying ConcurrentMergeSchedulerProvider instead of the full class name,  
but that didn't work.

Any ideas?  
David

--  
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/601a831d-2c8e-4615-b816-435a6d4e4d9c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/601a831d-2c8e-4615-b816-435a6d4e4d9c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [April 19, 2014, 8:48am UTC](https://discuss.elastic.co/t/switching-back-to-concurrentmergescheduler/17085/2 "2014-04-19T08:48:48Z")

</div>

I use this on 1.1.0 in my config/elasticsearch.yml

index:  
merge:  
scheduler:  
type: concurrent  
max\_thread\_count: 4  
policy:  
type: tiered  
max\_merged\_segment: 1gb  
segments\_per\_tier: 4  
max\_merge\_at\_once: 4  
max\_merge\_at\_once\_explicit: 4

threadpool:  
merge:  
type: fixed  
size: 4  
queue\_size: 32

Explanation:

- use concurrent scheduler and limit it to 4 threads. I find 4 threads  
being able to keep up with the highest bulk insertion rate I could generate
- use tiered policy (the default, it is most flexible in selecting segments  
to merge)
- create segments less than 1gb in a tier (this limits the file size of the  
segments files, the smaller the files, the faster the merges, but the more  
files are created)
- create 4 segments per tier (do not create segments numbers that are too  
high per tier)
- merge 4 segments at each merge step (this limits the total run time and  
resource consumption of a segment merge step)
- also limit merge for explicit \_optimize API call
- extend thread pool to 4 merge threads with a maximum of 32 merge  
operations in the queue (32 should be sufficient to handle outstanding  
merges)

From time to time, if the number of files get very high (\>500) and index is  
calm (no indexing, no heavy search), I do a manual \_optimize.

Jörg

On Fri, Apr 18, 2014 at 9:01 PM, David Smith [davidksmith2k@gmail.com](mailto:davidksmith2k@gmail.com)wrote:

> I see that ES switch back to ConcurrentMergeScheduler in 1.1.1 due to it  
> affecting indexing performance in 1.1.0.  
> [Switch back to ConcurrentMergeScheduler as the default · Issue #5817 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/5817)
> 
> We're on 1.1.0 and cannot upgrade to 1.1.1 for the time being. Is there a  
> way to switch it back using the API? I tried the following command, but it  
> seems to not take.
> 
> curl -i -XPUT localhost:9200/\_cluster/settings -d '{ "persistent": {  
> "index.merge.scheduler.type":  
> "org.elasticsearch.index.merge.scheduler.ConcurrentMergeSchedulerProvider"  
> } }'  
> HTTP/1.1 200 OK  
> Content-Type: application/json; charset=UTF-8  
> Content-Length: 52
> 
> {"acknowledged":true,"persistent":{},"transient":{}}
> 
> It does not seem to be set when I try to re-GET it (and no errors in logs  
> at DEBUG level or above).
> 
> curl -i -XGET localhost:9200/\_cluster/settings  
> HTTP/1.1 200 OK  
> Content-Type: application/json; charset=UTF-8  
> Content-Length: 66
> 
> {"persistent":{"threadpool":{"bulk":{"size":"8"}}},"transient":{}}
> 
> Am using the wrong way of specifying the scheduler? I also tried just  
> specifying ConcurrentMergeSchedulerProvider instead of the full class  
> name, but that didn't work.
> 
> Any ideas?  
> David
> 
> --  
> 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/601a831d-2c8e-4615-b816-435a6d4e4d9c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/601a831d-2c8e-4615-b816-435a6d4e4d9c%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/601a831d-2c8e-4615-b816-435a6d4e4d9c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/601a831d-2c8e-4615-b816-435a6d4e4d9c%40googlegroups.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/CAKdsXoGwnPYyBPYRSPz5c9WGzfH68CHX7gXb7UwmgMbwXdOnMg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGwnPYyBPYRSPz5c9WGzfH68CHX7gXb7UwmgMbwXdOnMg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![David\_Smith\_2](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@David\_Smith\_2](https://discuss.elastic.co/u/David_Smith_2)\
**Post date:** [April 19, 2014, 1:22pm UTC](https://discuss.elastic.co/t/switching-back-to-concurrentmergescheduler/17085/3 "2014-04-19T13:22:56Z")

</div>

Thanks, Jörg. Is it possible to set these via API instead of changing the  
yaml?

--  
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/bbf0936b-84eb-4e4a-b7c4-7fa2dcaad963%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bbf0936b-84eb-4e4a-b7c4-7fa2dcaad963%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [April 19, 2014, 2:05pm UTC](https://discuss.elastic.co/t/switching-back-to-concurrentmergescheduler/17085/4 "2014-04-19T14:05:39Z")

</div>

No, you can not change the merge scheduler settings via API. Threadpool  
settings updating works.

Jörg

On Sat, Apr 19, 2014 at 3:22 PM, David Smith [davidksmith2k@gmail.com](mailto:davidksmith2k@gmail.com)wrote:

> Thanks, Jörg. Is it possible to set these via API instead of changing the  
> yaml?
> 
> --  
> 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/bbf0936b-84eb-4e4a-b7c4-7fa2dcaad963%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bbf0936b-84eb-4e4a-b7c4-7fa2dcaad963%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/bbf0936b-84eb-4e4a-b7c4-7fa2dcaad963%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bbf0936b-84eb-4e4a-b7c4-7fa2dcaad963%40googlegroups.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/CAKdsXoF\_gH1iZsws1mNqNjtxLnkoEpn14Fs6o0DD5XtMqrKc7g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoF_gH1iZsws1mNqNjtxLnkoEpn14Fs6o0DD5XtMqrKc7g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![David\_Smith\_2](https://avatars.discourse-cdn.com/v4/letter/d/a9a28c/32.png) [@David\_Smith\_2](https://discuss.elastic.co/u/David_Smith_2)\
**Post date:** [April 19, 2014, 4:19pm UTC](https://discuss.elastic.co/t/switching-back-to-concurrentmergescheduler/17085/5 "2014-04-19T16:19:00Z")

</div>

Ahh, got it. Thanks.

On Saturday, April 19, 2014 10:05:39 AM UTC-4, Jörg Prante wrote:

> No, you can not change the merge scheduler settings via API. Threadpool  
> settings updating works.
> 
> Jörg
> 
> On Sat, Apr 19, 2014 at 3:22 PM, David Smith \<[davidk...@gmail.com](mailto:davidk...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Thanks, Jörg. Is it possible to set these via API instead of changing the  
> > yaml?
> > 
> > --  
> > 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:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/bbf0936b-84eb-4e4a-b7c4-7fa2dcaad963%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bbf0936b-84eb-4e4a-b7c4-7fa2dcaad963%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/bbf0936b-84eb-4e4a-b7c4-7fa2dcaad963%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bbf0936b-84eb-4e4a-b7c4-7fa2dcaad963%40googlegroups.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/040d8e5d-5a1a-4ffb-8c48-b39d59c14245%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/040d8e5d-5a1a-4ffb-8c48-b39d59c14245%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, 1:34am UTC](https://discuss.elastic.co/t/switching-back-to-concurrentmergescheduler/17085/6 "2017-07-06T01:34:49Z")

</div>


