Code Monkey home page Code Monkey logo

Comments (2)

jogo avatar jogo commented on July 22, 2024

Great find @matejsp, I suspect the way to optimize this is to refactor the hashing client to use a similar pattern to python-memcached's model.

We haven't hit this issue ourselves as use mcrouter.

from pymemcache.

matejsp avatar matejsp commented on July 22, 2024

Since I referenced this issue in Django, I would like to share some additional benchmarks that I made using pymemcache and python-memcached inside Django.

We are using memcached (ElastiCache) that has a round trip from each server on average 1 ms.

In our case we use 4 memcached server and when we call get_many based on hash algorithm it splits the load between all 4 servers and calls on each server get_many. Each call takes 1 ms so in total we observed total time of 4 ms (can also be 1ms, 2ms, 3ms, 4ms depending on hash key distribution and how many servers you hit with get_many).

In python-memcached when calling 4 servers in a loop the logic is optimized in a way that it first it sends to all 4 server and only then in receives the response from each of them taking 1 ms (basically waits for the slowest server) in total to complete get_many call.

I checked the code and from what I see _fetch_cmd/_store_cmd should be splited into sending and receiving logic and somehow brought up to hash client taking connection pooling into account. You would need to get 4 servers from pool, call send on each and then wait for receive for all servers.

from pymemcache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.