# Query timing: 'took' value and what I'm measuring

**URL:** <https://discuss.elastic.co/t/query-timing-took-value-and-what-im-measuring/9870>\
**Category:** Elasticsearch\
**Created:** [November 28, 2012, 8:06pm UTC](https://discuss.elastic.co/t/query-timing-took-value-and-what-im-measuring/9870 "2012-11-28T20:06:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 29, 2012, 11:27am UTC](https://discuss.elastic.co/t/query-timing-took-value-and-what-im-measuring/9870/2 "2012-11-29T11:27:22Z")

</div>

The time reported by elasticsearch in the "took" field is the time that it  
took elasticsearch to process the query on its side. It doesn't include

- serializing the request into JSON on the client

- sending the request over the network

- deserializing the request from JSON on the server

- serializing the response into JSON on the server

- sending the response over the network

- deserializing the response from JSON on the client

On Wednesday, November 28, 2012 3:06:08 PM UTC-5, Daniel Weitzenfeld wrote:

> I'm running some tests on Elastic Search to see if it's performant in our  
> particular situation.  
> My queries average ~130ms, according to the 'took' field returned by  
> Elastic Search. But when I time the query round trip, I'm getting ~820ms.  
> What might be causing this discrepancy? Am I misunderstanding the 'took'  
> field?
> 
> My setup:  
> Elasticsearch 0.19.0  
> amazon ec2 m2.xlarge box running Centos  
> talking to Elasticsearch via python pyes package, e.g.:
> 
> from pyes import \*  
> import time
> 
> conn = ES('127.0.0.1:9200')
> 
> now=time.time()  
> response=conn.search\_raw(my\_query\_dictionary)  
> now2=time.time()
> 
> now2-now  
> .82
> 
> response.took  
> 130

--

---

_[View the full topic](https://discuss.elastic.co/t/query-timing-took-value-and-what-im-measuring/9870)._
