1

Action: I run the following code:

#Code to fetch a key from Couachbase serially again and again
from couchbase.client import Couchbase
couchbase = Couchbase("ubuntumartini03", "default", "")
bucket = couchbase["martini-tag-manager"]
while True:
    print bucket.get("somekey")

Result: Running this code I was able to make 500 ops per sec.

Action: I ran four instances of this code.

Result: I was able to make 2000 ops per sec.

Conclusion: Bottleneck is something else than max possible ops couchbase can entertain per sec OR max possible ops the given machine can make, for the above given code.

Question:

How to make max possible ops per sec by single instance itself?
Community
  • 1
  • 1
codersofthedark
  • 9,183
  • 8
  • 45
  • 70

1 Answers1

1

Couchbase Pytnon client is basically synchronous and doesn't leverage multiple cores that you probably have. It's trying to implement multi-threaded behavior but with CPython interpreter it's absolutely pointless. Only complete re-implementation using something like Gevent would help.

Also take a look at this bug.

Pavel Paulau
  • 786
  • 2
  • 7
  • 19