Analyzing queries

Analyzing slow queries and improving their performance can be very challenging. This section examines how to look for the root cause of poor query performance, and it offers some different approaches to finding a solution.

Slow log

If you notice poor query performance, start with the slow log. To enable the slow log, edit elasticsearch.yml and add these configuration options to all nodes on the cluster:

index.search.slowlog.threshold.query.warn: 8s index.search.slowlog.threshold.query.info: 4s index.search.slowlog.threshold.query.debug: 2s index.search.slowlog.threshold.query.trace: 500ms index.search.slowlog.threshold.fetch.warn: 1s index.search.slowlog.threshold.fetch.info: 750ms index.search.slowlog.threshold.fetch.debug: 500ms ...

Get Monitoring Elasticsearch now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.