If elasticsearch rejects some queries and you see in log error (with a lot of java stuff around it) like:
“All shards failed for phase: [query] …. rejected execution of org.elasticsearch.transport.TransportService …”

Check your error message throughly because it will show you which parameter have been exceeded. You can see:

    • rejected execution of org.elasticsearch.transport.TransportService$4@c8998f4 on EsThreadPoolExecutor[bulk, queue capacity = 50, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor
      • meaning “bulk” queue capacity was exceeded
    • rejected execution of org.elasticsearch.transport.TransportService$4@7a4c6 4d7 on EsThreadPoolExecutor[search, queue capacity = 1000, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor
      • meaning “search” queue was exceeded

To be sure check your setting for specified queue:

  • curl -XGET localhost:9200/_nodes/thread_pool?pretty|less
    • look for “bulk” – “queue_size” or what so ever you have seen in error message

Increase your setting using (example for bulk queue_size):

  • on running node:
    curl -XPUT localhost:9200/_cluster/settings -d '{ "transient": { "threadpool.bulk.queue_size" : 250 } }'
  • add into config file for permanent change: threadpool.bulk.queue_size: 250

Links: