chapter fifteen

15 Performance and troubleshooting

 

This chapter covers

  • Understanding the reasons for slow searches and indexing queries
  • Tuning and improving the performance of slow queries and indexing
  • Troubleshooting unstable clusters

Once the Elasticsearch cluster is ready for production, there are umpteen number of things that could go wrong: from users complaining about slow searches to unstable nodes, network issues, over-sharding troubles, memory problems, and more. Keeping the cluster’s health in a GREEN (healthy) state is a paramount task. Constantly keeping an eye on the cluster’s health and performance is one of the primary jobs of an administrator.

Troubleshooting an unstable cluster needs a good understanding of the inner workings of Elasticsearch, networking concerts, node communication, memory settings, as well as a bunch of APIs for nodes, clusters, cluster allocation, and other uses. Similarly, tweaking the configurations to understand the document models, appropriate refresh times, and so forth helps to tune the cluster for higher performance capabilities.

In this chapter, we will go over some common problems such as slow query and ingestion speeds so that you can understand the reasons behind them.. Because Elasticsearch is a complex and complicated distributed architecture, there are a handful of places one needs to look for fixes. We will discuss the most obvious and commonly applied solutions in this chapter.

15.1 Search and speed issues

15.1.1 Modern hardware

15.1.2 Document modeling

15.1.3 Choose keyword types over text types

15.2 Index speed issues

15.2.1 System-generated identifiers

15.2.2 Bulk requests

15.2.3 Refresh rate

15.3 Unstable cluster

15.3.1 Cluster is not green

15.3.2 Unassigned shards

15.3.3 Disk usage thresholds

15.4 Circuit breakers

15.5 Final words

15.6 Summary