# ESRejectedExecutionException

**URL:** <https://discuss.elastic.co/t/esrejectedexecutionexception/16631>\
**Category:** Elasticsearch\
**Created:** [March 27, 2014, 5:53am UTC](https://discuss.elastic.co/t/esrejectedexecutionexception/16631 "2014-03-27T05:53:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pandiyan](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@Pandiyan](https://discuss.elastic.co/u/Pandiyan)\
**Post date:** [March 27, 2014, 5:53am UTC](https://discuss.elastic.co/t/esrejectedexecutionexception/16631/1 "2014-03-27T05:53:52Z")

</div>

Hi,

```
  I have 5 million records in database i create the index through 

```

BulkRequestBuilder every 10,000 records pushing to elasticsearch But while  
sometimes getting _ESRejectedExecutionException_

ES\_MIN=2gb  
ES\_MAX=2gb

cluster.name: pandy  
node.name: "pandy\_server"  
index.number\_of\_shards: 5  
index.number\_of\_replicas: 1  
bootstrap.mlockall: true  
index.store.compress.stored: true  
index.refresh\_interval: 1m  
indices.memory.index\_buffer\_size: 90%  
threadpool.search.type: fixed  
threadpool.search.size: 15  
index.cache.filter.expire: 1m  
indices.cache.filter.size: 256mb  
threadpool.index.type: fixed  
threadpool.index.size: 25  
threadpool.bulk.type: fixed  
threadpool.bulk.size: 60

```
 I have *only 6GB* RAM 

```

--  
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/47b41f84-6dcc-407b-aca1-6fdf4ba4ce1a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/47b41f84-6dcc-407b-aca1-6fdf4ba4ce1a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [March 27, 2014, 12:30pm UTC](https://discuss.elastic.co/t/esrejectedexecutionexception/16631/2 "2014-03-27T12:30:42Z")

</div>

The bulk thread pool has a cap on the queue size which is 50  
(threadpool.bulk.queue\_size). Once you reach that cap, you will start  
getting the rejected exceptions. That is there for a reason so that the  
thread pool does not get out of control. You can try to increase the queue  
size slightly but if that still doesn't fix your problem, then you need to  
reduce your bulk concurrency/size since you may be reaching the limits of  
what your node hardware can handle.

--  
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/e23e9e51-4793-4eb8-91a7-8604a2f83b6b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e23e9e51-4793-4eb8-91a7-8604a2f83b6b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Pandiyan](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@Pandiyan](https://discuss.elastic.co/u/Pandiyan)\
**Post date:** [April 3, 2014, 12:23pm UTC](https://discuss.elastic.co/t/esrejectedexecutionexception/16631/3 "2014-04-03T12:23:49Z")

</div>

Hi Binh,

```
    Thanks for your reply.I am setting for *threadpool.bulk.queue_size: 

```

300\* in elasticsearch.yml it's okay.

On Thursday, March 27, 2014 6:00:42 PM UTC+5:30, Binh Ly wrote:

> The bulk thread pool has a cap on the queue size which is 50  
> (threadpool.bulk.queue\_size). Once you reach that cap, you will start  
> getting the rejected exceptions. That is there for a reason so that the  
> thread pool does not get out of control. You can try to increase the queue  
> size slightly but if that still doesn't fix your problem, then you need to  
> reduce your bulk concurrency/size since you may be reaching the limits of  
> what your node hardware can handle.

--  
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/af661c4b-8750-4733-9f53-eaf86f866bd5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/af661c4b-8750-4733-9f53-eaf86f866bd5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Pandiyan](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@Pandiyan](https://discuss.elastic.co/u/Pandiyan)\
**Post date:** [April 3, 2014, 12:24pm UTC](https://discuss.elastic.co/t/esrejectedexecutionexception/16631/4 "2014-04-03T12:24:39Z")

</div>

On Thursday, March 27, 2014 11:23:52 AM UTC+5:30, Pandiyan Arumugam wrote:

> Hi,
> 
> ```
> I have 5 million records in database i create the index through 
> 
> ```
> 
> BulkRequestBuilder every 10,000 records pushing to elasticsearch But while  
> sometimes getting _ESRejectedExecutionException_
> 
> ES\_MIN=2gb  
> ES\_MAX=2gb
> 
> cluster.name: pandy  
> node.name: "pandy\_server"  
> index.number\_of\_shards: 5  
> index.number\_of\_replicas: 1  
> bootstrap.mlockall: true  
> index.store.compress.stored: true  
> index.refresh\_interval: 1m  
> indices.memory.index\_buffer\_size: 90%  
> threadpool.search.type: fixed  
> threadpool.search.size: 15  
> index.cache.filter.expire: 1m  
> indices.cache.filter.size: 256mb  
> threadpool.index.type: fixed  
> threadpool.index.size: 25  
> threadpool.bulk.type: fixed  
> threadpool.bulk.size: 60
> 
> ```
> I have *only 6GB* RAM 
> 
> ```

--  
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/86d8b037-07d2-4986-b0ac-b3c607457716%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/86d8b037-07d2-4986-b0ac-b3c607457716%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:38am UTC](https://discuss.elastic.co/t/esrejectedexecutionexception/16631/5 "2017-07-06T01:38:33Z")

</div>


