Not all search threads are being used

Hi
I am experiencing EsRejectedExecutionException looking like this:

Caused by: org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution of 
org.elasticsearch.common.util.concurrent.TimedRunnable@6115ff55 on 
QueueResizingEsThreadPoolExecutor[name = thu-match-es1/search, queue capacity = 1000, min queue 
capacity = 1000, max queue capacity = 1000, frame size = 2000, targeted response rate = 1s, task execution 
EWMA = 10.6ms, adjustment amount = 50, 
org.elasticsearch.common.util.concurrent.QueueResizingEsThreadPoolExecutor@4401085f[Running, pool 
size = 35, active threads = 12, queued tasks = 1000, completed tasks = 31173285]]

My question is: Why do I get a rejected exception when not all available threads (35) are being utilized? According to the stack trace only 12 threads are active. Or have I misread the stack trace?

Regards
Johan

1 Like

Without seeing it, it's impossible to say. Can you share more information?

Oh hang on, I see :slight_smile:

pool size = 35, active threads = 12, queued tasks = 1000

The rejection is because the queue is full, not because there are no more threads. I am looking further into what these numbers mean.

It seems that the active threads number is only approximate, and the way that threads add and remove tasks to/from the pool means that there can be tasks on the queue without all the threads in the pool being active. Here is a post that looks related:

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