Skip to content

took time value is much larger than that calculated by Profile API #29275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
owenericsson opened this issue Mar 28, 2018 · 7 comments
Closed
Labels
>docs General docs changes :Search/Search Search-related issues that do not fall into other categories

Comments

@owenericsson
Copy link

Describe the feature: whole time calculation is wrong with took time value

Elasticsearch version (bin/elasticsearch --version): 5.3.2

Plugins installed: []

JVM version (java -version): JDK 1.8 update 132

OS version (uname -a if on a Unix-like system): CentOS 5.5

Description of the problem including expected versus actual behavior:
i would like to diagnostic for a query with a term aggregation, and then i added a profile:true to the query. however i see the time took 500+ms while i found out that the maximum time of a shard is just ~10ms.
would you some one please give me some hint that where the 400+ms take place

Provide logs (if relevant):
see attachment, for security reason i skipped the true result and renamed the index name and field name.

result.txt

@bleskes
Copy link
Contributor

bleskes commented Mar 28, 2018

The profile api currently only profiles that query and aggregation parts. It doesn't measure the fetch phase nor the network overhead. I suggest you look at those.

IMO I think there are two things to do here:

  1. Potentially add a profiler for the fetch phase.
  2. Document the above to avoid confusion.

@owenericsson if you have any more questions please open up a thread on discuss.elastic.co and we can dive deeper. We keep github for bugs and features requests.

@bleskes bleskes added the :Search/Search Search-related issues that do not fall into other categories label Mar 28, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@bleskes bleskes added the >docs General docs changes label Mar 28, 2018
@owenericsson
Copy link
Author

hi @bleskes ,
thanks for the reply, and also apologize for posting in the wrong place.

back to this problem

  1. i have set the size to 0, so there shouldn't be the fetch overhead.
  2. when i remove the "aggs" part, the time cost back to a normal level (< 100ms). So i am sure that the overhead must be from the aggs

BTW. the field type of the term aggregation i used is 'keyword', and do you think this overhead is from the GlobalOrdinals ? anyway i think it is very unlikely this overhead is from the network.

@bleskes
Copy link
Contributor

bleskes commented Mar 28, 2018

OK, that changes things (although my comments are still valid in general). I will defer for someone from the search area to pick this up.

@jpountz
Copy link
Contributor

jpountz commented Mar 28, 2018

Most likely most execution time is taken by something which is not measured by the profile, like the time it took to build global ordinals, time spent in the queue, time spent merging shard responses on the coordinating node, etc. I agree we shoud at least document this.

@owenericsson
Copy link
Author

one more thing need attention
I created my index with 11 shards, by using a routing key which means for the Search above, only one shard owns all the result data.

cbuescher pushed a commit to cbuescher/elasticsearch that referenced this issue Dec 5, 2018
Adding some of the limitations mentioned as part of elastic#29275.

Closes elastic#29275
cbuescher pushed a commit that referenced this issue Dec 5, 2018
Adding some of the limitations mentioned in #29275.

Closes #29275
cbuescher pushed a commit that referenced this issue Dec 5, 2018
Adding some of the limitations mentioned in #29275.

Closes #29275
cbuescher pushed a commit that referenced this issue Dec 5, 2018
Adding some of the limitations mentioned in #29275.

Closes #29275
@cbuescher
Copy link
Member

Closing this with adding documentation in #36252, some other improvements to the way the Profile API works are tracked in #21073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

No branches or pull requests

5 participants