# Elasticsearch unknown perfomance issue

**URL:** <https://discuss.elastic.co/t/elasticsearch-unknown-perfomance-issue/18881>\
**Category:** Elasticsearch\
**Created:** [July 24, 2014, 9:32pm UTC](https://discuss.elastic.co/t/elasticsearch-unknown-perfomance-issue/18881 "2014-07-24T21:32:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathaniel\_roth](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@nathaniel\_roth](https://discuss.elastic.co/u/nathaniel_roth)\
**Post date:** [July 24, 2014, 9:32pm UTC](https://discuss.elastic.co/t/elasticsearch-unknown-perfomance-issue/18881/1 "2014-07-24T21:32:20Z")

</div>

Hello,

I am running a pretty simply filter query in elasticsearch; the took field  
in elasticsearch's response indicates that the query is quite fast, and  
takes only a couple miliseconds. If I run the request via a CURL call from  
the command line and time that, it takes slightly longer around 20-40  
milliseconds, which I assume is due to network issues and serialization in  
ES.

However, I have a script which uses the elasticsearch ruby client that  
runs this same request and when I time it, it takes roughly 450  
milliseconds, which seems way too long. I am wondering if anyone has seen a  
similar issue, either with the ruby client or another client? I have copied  
the code for the request below, omitting the exact filters and sort  
clauses.

Thanks a lot for the help and any insight or places to look would be really  
appreciated!

query = Jbuilder.encode do |json|  
json.sort sort\_clause  
json.from 0  
json.size 100  
json.query do  
json.constant\_score do  
json.filter do  
json.bool do  
json.must must\_queries  
end  
end  
end  
end  
end

raw\_response = self.client.search(:index =\> my\_index, :type =\> my\_type,  
:body =\> query)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/db719985-4977-49d8-be5d-d9a6caa0dffe%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/db719985-4977-49d8-be5d-d9a6caa0dffe%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nathaniel\_roth](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@nathaniel\_roth](https://discuss.elastic.co/u/nathaniel_roth)\
**Post date:** [July 24, 2014, 9:57pm UTC](https://discuss.elastic.co/t/elasticsearch-unknown-perfomance-issue/18881/2 "2014-07-24T21:57:27Z")

</div>

Sorry, one more quick note: the time goes down several hundred milliseconds  
if I only fetch the first 3 results, instead of 100, which leads me to  
believe the issue has something to do with serializing or the client's  
handling of the ES response; however, I am not sure what could be the  
bottleneck. Thanks again!

On Thursday, July 24, 2014 2:32:20 PM UTC-7, [nathani...@healthtap.com](mailto:nathani...@healthtap.com) wrote:

> Hello,
> 
> I am running a pretty simply filter query in elasticsearch; the took field  
> in elasticsearch's response indicates that the query is quite fast, and  
> takes only a couple miliseconds. If I run the request via a CURL call from  
> the command line and time that, it takes slightly longer around 20-40  
> milliseconds, which I assume is due to network issues and serialization in  
> ES.
> 
> However, I have a script which uses the elasticsearch ruby client that  
> runs this same request and when I time it, it takes roughly 450  
> milliseconds, which seems way too long. I am wondering if anyone has seen a  
> similar issue, either with the ruby client or another client? I have copied  
> the code for the request below, omitting the exact filters and sort  
> clauses.
> 
> Thanks a lot for the help and any insight or places to look would be  
> really appreciated!
> 
> query = Jbuilder.encode do |json|  
> json.sort sort\_clause  
> json.from 0  
> json.size 100  
> json.query do  
> json.constant\_score do  
> json.filter do  
> json.bool do  
> json.must must\_queries  
> end  
> end  
> end  
> end  
> end
> 
> raw\_response = self.client.search(:index =\> my\_index, :type =\> my\_type,  
> :body =\> query)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bc21edf7-3b5b-41e8-967b-51c2ba22cc58%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bc21edf7-3b5b-41e8-967b-51c2ba22cc58%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:13am UTC](https://discuss.elastic.co/t/elasticsearch-unknown-perfomance-issue/18881/3 "2017-07-06T01:13:18Z")

</div>


