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

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

--

1 Like