# Can a node run more than on \_optimize concurrently?

**URL:** <https://discuss.elastic.co/t/can-a-node-run-more-than-on--optimize-concurrently/833>\
**Category:** Elasticsearch\
**Created:** [May 18, 2015, 10:16am UTC](https://discuss.elastic.co/t/can-a-node-run-more-than-on--optimize-concurrently/833 "2015-05-18T10:16:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eran\_Eidinger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_eidinger/32/44831_2.png) [@Eran\_Eidinger](https://discuss.elastic.co/u/Eran_Eidinger)\
**Post date:** [May 18, 2015, 10:16am UTC](https://discuss.elastic.co/t/can-a-node-run-more-than-on--optimize-concurrently/833/1 "2015-05-18T10:16:13Z")

</div>

I'm sending a REST call to optimize several indices together:

```
127.0.0.1:9200/index1,index2,index3/_optimize?max_num_segments=1&force=true

```

looking at the segments on disk, it is evident that the node optimizes one index at a time (finishes the rist, and then starts the next).  
More than that, it sometimes optimizes 1-3 indices and then stops.

Is there a way to tell the node to optimize several indices concurrently? (the machine has 16 CPUs)

Regards,  
Eran

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 18, 2015, 11:12am UTC](https://discuss.elastic.co/t/can-a-node-run-more-than-on--optimize-concurrently/833/2 "2015-05-18T11:12:04Z")

</div>

when sending an optimize request, it optimizes one shard at a time on a node. It gets executed on an `optimize` thread pool, and the thread pool is configured with size set to 1. This is intentional in order not to overload a node with heavy optimizations going on while other operations are happening, it also means there is less concurrent load IO wise (not CPU).

You can change the optimize thread pool to have more than 1 thread, by setting `threadpool.optimize.size : 2` in the config, but this is typically not needed and might get different optimizations to throttle each other.

---

<div class="post-metadata">

**Author:** ![Eran\_Eidinger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eran_eidinger/32/44831_2.png) [@Eran\_Eidinger](https://discuss.elastic.co/u/Eran_Eidinger)\
**Post date:** [May 18, 2015, 12:15pm UTC](https://discuss.elastic.co/t/can-a-node-run-more-than-on--optimize-concurrently/833/3 "2015-05-18T12:15:28Z")

</div>

Great.

Thanks for the quick answer!

Eran.

---

<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, 12:13am UTC](https://discuss.elastic.co/t/can-a-node-run-more-than-on--optimize-concurrently/833/4 "2017-07-06T00:13:32Z")

</div>

Closed on July 6, 2017, 12:13am UTC


