Riak 2i http query much faster than python api?

Jeff Peck jeffp at tnrglobal.com
Wed Apr 10 15:53:19 EDT 2013


I can grab over 900,000 keys from an indexs, using an http query in about 15 seconds, whereas the same operation in python times out after 5 minutes. Does this indicate that I am using the python API incorrectly? Should I be relying on an http request initially when I need to grab this many keys?

(Note: This is tied to the question that I asked earlier, but is also a general question to help understand the proper usage of the python API.)

Thanks! Examples are below.

- Jeff

---

HTTP:

$ time curl -s http://localhost:8098/buckets/mybucket/index/status_bin/PERSISTED | grep -o , | wc -l
926047

real    0m14.583s
user    0m2.500s
sys     0m0.270s

---

Python:

import riak

bucket = "my bucket"
client = riak.RiakClient(port=8098)
results = client.index(bucket, 'status_bin', 'PERSISTED').run(timeout=5*60*1000) # 5 minute timeout
print len(results)

(times out after 5 minutes)



More information about the riak-users mailing list