Increasing the size of the queue in Elasticsearch?

To change the queue size one could add it in the config file for each of the nodes as follows:

threadpool.search.queue_size: <new queue size> .

However this would also require a cluster restart.

Up to Elasticsearch 2.x, you can update via the cluster-setting api and this would not require a cluster restart, however this option is gone with Elasticsearch 5.x and newer.

curl -XPUT  _cluster/settings -d '{
    "persistent" : {
        "threadpool.search.queue_size" : <new_size>
    }
}'

You can query the queue size as follows:

curl <server>/_cat/thread_pool?v&h=search.queueSize


From Elasticsearch 5 onward you cannot use the API to update the threadpool search queue size. It is now a node-level settings. See this.

Thread pool settings are now node-level settings. As such, it is not possible to update thread pool settings via the cluster settings API.

To update the threadpool you have to add thread_pool.search.queue_size : <New size> in elasticsearch.yml file of each node and then restart elasticsearch.