Elasticsearch Trace Route

Is there a way to trace the route of search & indexing requests to nodes within the cluster? I have lots of dedicated nodes in the cluster and I want to confirm requests routing is optimized by checking the path the requests take to the targeted shards.


A request will usually take no more than 2 nodes to get to the data, no matter where you ask it. Either the node that receives the data has it, so it sends the response back directly, or it sends it to another node it knows has the data and waits for the response.

This would change if the node that requests the data has just left the cluster, and the cluster state hasn't updated, so it'll need to try another node, but that's not likely to be a common thing.

What sort of things are you looking to optimise though?

This is helpful.. thanks @warkolm! Does this routing method apply to indexing requests as well?

What sort of things are you looking to optimise though?

Sometimes, I see high search latency with some expensive queries and high indexing time and I just needed to confirm that the shortest path will always be taken such that search requests from client nodes don't get sent to warm or ML nodes when data resides on hot data nodes.

The major difference between a querying and indexing is the query can go to a primary or secondary shard. Indexing will always go to the primary.

Unless your query is being sent to these nodes as the first step in the process - that is, your client is selecting these nodes to talk to - then it's unlikely.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.