This chapter addressed some common performance and reliability issues that come up when using Elasticsearch. To reiterate some of the major points in this chapter:
Always double-check your Elasticsearch cluster's configuration for errors
Set the fielddata cache size, especially if you see
OutOfMemoryError
exceptionsUse the slow log to find what queries run slow on your cluster
Avoid aggregations on high-cardinality fields (such as millisecond timestamps)
Be cognizant of your data indexing strategy so that no one index grows too large
Use index warmers or enable
eager_global_ordinals
to ensure queries that use the fielddata cache are fast the first time we run themIf possible, use SSDs on nodes that index data, and avoid storing Elasticsearch indices on network storage
Most importantly, when diagnosing Elasticsearch issues, be meticulous about testing at each stage. For example, don't try to optimize a query by making changes to elasticsearch.yml
, modifying the query criteria, and enabling...