why elasticsearch reject almost all queries when thread pool and queue is full instead of answering as much as possible and rejecting the remaining?

Viewed 1961

We have a single node elasticsearch for an ecommerce website with ~500 query per second. This image shows our elasticsearch node metrics for a period of 3 hours:

enter image description here

In the image, when queue count reaches 1000 (queue size), query rate decreased significantly. It seems elasticsearch panics when both thread pool and queue is full and starts to rejecting most of queries. The intended behavior should be like responding queries as much as possible and only rejecting those that are more than real capacity. My question is that is this behavior natural or should we change our configs?

thread pool and queues in elasticsearch:

a node holds several thread pools in order to improve how threads memory consumption are managed within a node. Many of these pools also have queues associated with them, which allow pending requests to be held instead of discarded.

1 Answers

I think this is a normal behavior. it seems in some time you have resource killer queries and your thread_pool become full and after that the queue would be full. when thread_pool is full it mean that system is processing existing queries and there is no room for new queries.

I recommend to check the tasks and queries:

curl -s [master-ip]:9200/_cat/tasks?v

get delayed search task_ID from above command an use in below command

curl -s [master-ip]:9200/_tasks/[task_ID]?pretty
Related