# How to increase thread pool

**URL:** <https://discuss.elastic.co/t/how-to-increase-thread-pool/101142>\
**Category:** Elasticsearch\
**Created:** [September 20, 2017, 9:57am UTC](https://discuss.elastic.co/t/how-to-increase-thread-pool/101142 "2017-09-20T09:57:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chu\_Jun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chu_jun/32/22102_2.png) [@Chu\_Jun](https://discuss.elastic.co/u/Chu_Jun)\
**Post date:** [September 20, 2017, 9:57am UTC](https://discuss.elastic.co/t/how-to-increase-thread-pool/101142/1 "2017-09-20T09:57:44Z")

</div>

Hi,  
I am having an error while I got 4 client.bulk program run at the same time:

> Error: Request to Elasticsearch failed: "[es\_rejected\_execution\_exception] rejected execution of org.elasticsearch.transport.TransportService$7@22f5ce2b on EsThreadPoolExecutor[bulk, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@bfab946[Running, pool size = 4, active threads = 4, queued tasks = 200, completed tasks = 44665]]"

I tried increase bulk thread pool by adding following into elasticsearch.yml

```
threadpool.bulk.type: fixed
threadpool.bulk.size: 25
threadpool.bulk.queue_size: 1000

```

But I got another error while I try to restart elasticsearch.service

> [2017-09-20T17:44:53,724][INFO][o.e.n.Node] initializing ...  
> [2017-09-20T17:44:54,002][INFO][o.e.e.NodeEnvironment] [s9Tks9F] using [1] data paths, mounts [[/ (/dev/mapper/elasticsearch--vg-root)]], net usable\_space [353.7gb], net total\_space [481.7gb], spins? [possibly], types [ext4]  
> [2017-09-20T17:44:54,003][INFO][o.e.e.NodeEnvironment] [s9Tks9F] heap size [3.9gb], compressed ordinary object pointers [true]  
> [2017-09-20T17:44:54,170][INFO][o.e.n.Node] node name [s9Tks9F] derived from node ID [s9Tks9FwTPy9jE69qW-7mg]; set [node.name] to override  
> [2017-09-20T17:44:54,171][INFO][o.e.n.Node] version[5.5.2], pid[26617], build[b2f0c09/2017-08-14T12:33:14.154Z], OS[Linux/4.4.0-93-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0\_131/25.131-b11]  
> [2017-09-20T17:44:54,171][INFO][o.e.n.Node] JVM arguments [-Xms4g, -Xmx4g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/usr/share/elasticsearch]  
> [2017-09-20T17:44:55,575][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [aggs-matrix-stats]  
> [2017-09-20T17:44:55,575][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [ingest-common]  
> [2017-09-20T17:44:55,575][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [lang-expression]  
> [2017-09-20T17:44:55,575][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [lang-groovy]  
> [2017-09-20T17:44:55,575][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [lang-mustache]  
> [2017-09-20T17:44:55,576][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [lang-painless]  
> [2017-09-20T17:44:55,576][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [parent-join]  
> [2017-09-20T17:44:55,576][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [percolator]  
> [2017-09-20T17:44:55,576][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [reindex]  
> [2017-09-20T17:44:55,576][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [transport-netty3]  
> [2017-09-20T17:44:55,576][INFO][o.e.p.PluginsService] [s9Tks9F] loaded module [transport-netty4]  
> [2017-09-20T17:44:55,577][INFO][o.e.p.PluginsService] [s9Tks9F] no plugins loaded  
> [2017-09-20T17:44:56,763][ERROR][o.e.b.Bootstrap] Exception  
> **[2017-09-20T17:44:56,777][WARN][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]**

Could I know how to solve this? Thank you very much.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 20, 2017, 9:58am UTC](https://discuss.elastic.co/t/how-to-increase-thread-pool/101142/2 "2017-09-20T09:58:32Z")

</div>

Before you do this, I would suggest you read [Any idea what these errors mean version 2.4.2](https://discuss.elastic.co/t/any-idea-what-these-errors-mean-version-2-4-2/70690/5)

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 20, 2017, 10:12am UTC](https://discuss.elastic.co/t/how-to-increase-thread-pool/101142/3 "2017-09-20T10:12:09Z")

</div>

How many indices and shards are you indexing into? How many indexing threads does each loader use?

---

<div class="post-metadata">

**Author:** ![Chu\_Jun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chu_jun/32/22102_2.png) [@Chu\_Jun](https://discuss.elastic.co/u/Chu_Jun)\
**Post date:** [September 21, 2017, 2:22am UTC](https://discuss.elastic.co/t/how-to-increase-thread-pool/101142/4 "2017-09-21T02:22:45Z")

</div>

thank you!

---

<div class="post-metadata">

**Author:** ![Chu\_Jun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chu_jun/32/22102_2.png) [@Chu\_Jun](https://discuss.elastic.co/u/Chu_Jun)\
**Post date:** [September 21, 2017, 2:28am UTC](https://discuss.elastic.co/t/how-to-increase-thread-pool/101142/5 "2017-09-21T02:28:52Z")

</div>

I am doing same POC on the elasticsearch (single node), the elasticsearch I installed on the VM (10GB RAM, 4 processor).

4 incides are indexing at the same time,  
index1, 20-40k data per 10s  
index2, 40-60k data per 5mins  
index3, 200 per 10s  
index4, 1 per 10s

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 21, 2017, 5:16am UTC](https://discuss.elastic.co/t/how-to-increase-thread-pool/101142/6 "2017-09-21T05:16:11Z")

</div>

Exactly how are you loading this data? How large are your bulk requests? How large are your documents? How many connections are you indexing across?

---

<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:** [October 19, 2017, 5:22am UTC](https://discuss.elastic.co/t/how-to-increase-thread-pool/101142/7 "2017-10-19T05:22:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
