# Elasticsearch Error "EsRejectedExecutionException"

**URL:** <https://discuss.elastic.co/t/elasticsearch-error-esrejectedexecutionexception/48022>\
**Category:** Elasticsearch\
**Created:** [April 21, 2016, 10:32am UTC](https://discuss.elastic.co/t/elasticsearch-error-esrejectedexecutionexception/48022 "2016-04-21T10:32:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [April 21, 2016, 10:32am UTC](https://discuss.elastic.co/t/elasticsearch-error-esrejectedexecutionexception/48022/1 "2016-04-21T10:32:58Z")

</div>

Hi Experts,

My ES1.7.1 logs are full with the following error , and due to this I am not able to open Kibana Page it is hang forever.

> ```
> [2016-04-21 03:51:55,334][DEBUG][action.search.type] [Tarantula] [cef-2016-04-03][2], node[t-mO7uX-Tla2DCjLcJgF0w], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@3c1bf284] lastShard [true]
> org.elasticsearch.transport.RemoteTransportException: [Ned Horrocks][inet[/172.24.11.70:10001]][indices:data/read/search[phase/query]]
> Caused by: org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution (queue capacity 1000) on org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler@694201c0
> at org.elasticsearch.common.util.concurrent.EsAbortPolicy.rejectedExecution(EsAbortPolicy.java:62)
> at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
> at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
> at org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor.execute(EsThreadPoolExecutor.java:79)
> at org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:224)
> at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:114)
> at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
> at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
> at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
> at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
> at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
> at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
> at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
> at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
> at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
> at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
> at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:74)
> at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
> at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
> at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
> at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
> at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
> at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
> at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
> at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
> at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
> at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
> at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> 
> ```

Please help me to understand how I can resolve this issue

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [April 21, 2016, 11:33am UTC](https://discuss.elastic.co/t/elasticsearch-error-esrejectedexecutionexception/48022/2 "2016-04-21T11:33:52Z")

</div>

When you see this sort of message

```
rejected execution (queue capacity 1000)

```

it is an indication that all threads are busy servicing requests, there is also a queue of pending requests waiting for a free thread which is full meaning the latest request cannot be added to the waitlist because it will exceed the threshold of 1000.

Short answer - you've exceeded the configured compute capacity of that server and need to back off with your requests.

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [April 21, 2016, 11:40am UTC](https://discuss.elastic.co/t/elasticsearch-error-esrejectedexecutionexception/48022/3 "2016-04-21T11:40:00Z")

</div>

Thanks Mark,

But how i can back Off with my requests , i stopped LS, restarted ES , increased no of nodes also Increased threadpool.search.queue\_size: 2000.

Even after doing above My kibana screen is hanged on the very first page where is says `> "KIBANA is loading. Give me a moment here. I'm loading a whole bunch of code. Don't worry, all this good stuff will be cached up for next time!"`

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [April 21, 2016, 11:49am UTC](https://discuss.elastic.co/t/elasticsearch-error-esrejectedexecutionexception/48022/4 "2016-04-21T11:49:36Z")

</div>

Think of queue sizes as ways of dealing with temporary spikes in request volumes. If your flow of traffic is constant and consistently exceeding the capacity of the thread pool expect queues to back up and overflow.

At this stage I'd get to the bottom of what the expensive queries are on your system if you've already been through a round of just adding more nodes. Check the slow query logs, consider trying the new Query Profiler to diagnose individual queries for the main culprits.

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [April 21, 2016, 11:56am UTC](https://discuss.elastic.co/t/elasticsearch-error-esrejectedexecutionexception/48022/5 "2016-04-21T11:56:11Z")

</div>

yes i can enable slow query log at the ES level , but the problem is Kibana is not opening any dashboard ,it is stuck on the first page . So how would i identify which dashboard query is slow . I am stuck !!!

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [April 21, 2016, 12:08pm UTC](https://discuss.elastic.co/t/elasticsearch-error-esrejectedexecutionexception/48022/6 "2016-04-21T12:08:08Z")

</div>

> So how would i identify which dashboard query is slow .

Browser dev tools can show a panel with pending network requests etc if you're trying to figure out the browser state.  
Kibana log files will help with the Kibana server but you're best off asking these questions in the Kibana forum.  
Elasticsearch has slow query logs, hot\_threads and various CAT apis to show the state of the elastic servers. Marvel/monitoring will show a lot of these stats and OS level ones too like CPU and IO.

So there's a number of places to look. Just how many elasticsearch users are hitting your cluster?

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [April 21, 2016, 12:09pm UTC](https://discuss.elastic.co/t/elasticsearch-error-esrejectedexecutionexception/48022/7 "2016-04-21T12:09:24Z")

</div>

Never Mind , I resolved the problem , issue was at the Kibana end so i take help from browser dev tool, Port was not responding which causes the issue . Well thanks again Mark, thing seems up now.

---

<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 5, 2017, 10:57pm UTC](https://discuss.elastic.co/t/elasticsearch-error-esrejectedexecutionexception/48022/8 "2017-07-05T22:57:19Z")

</div>


