Cherry
Cherry

Reputation: 33534

Why total time during elasticsearch profile is not equals to time sum?

I have added profile: true to es query and got request time 54518:

{ "took" : 54518, "timed_out" : false, "_shards" : { "total" : 170, "successful" : 170, "failed" : 0 }

But when I summed up all time field from profile section in responce I got only 864ms e.g. this is not even a second!

Why? Where to see the gap between shard timing and total response time?

Upvotes: 0

Views: 178

Answers (1)

charisMao
charisMao

Reputation: 99

It should be the reason for parallelism.

  1. The profile returns the time of each fragment request, and each fragment has a unique id. For example: "id": "[2aE02wS1R8q_QFnYu6vDVQ][twitter][0]
  2. The retrieval is performed for multiple or N fragments of one or more indexes.

Since multiple shards are operated in parallel, the sum of the individual shards is not equal to the total retrieval time.

Upvotes: 0

Related Questions