1. Mike Bayer
  2. dogpile.cache
Issue #16 resolved

Question: How does dogpile behave in multi-process environments?

Ralph Bean
created an issue

I'm trying out dogpile for an app and it's working wonderfully so far; thanks for this!

I'm curious how it will behave in a multi-process WSGI environment. We have two app servers for this app, each running mod_wsgi with 8 processes for each. If we use a memcached backend shared by the two nodes, do you expect that requests will block appropriately between the two different instances?

Comments (3)

  1. Mike Bayer repo owner

    hi ralph, been having email probs so missed this somehow.

    when you have multiple processes which you want to coordinate on value generation, you need to have the system lock on some resource that's external to the process. In the case of memcached, we offer a memcached "lock" that does the atomic add thing (see http://amix.dk/blog/post/19386). Other options include locking on a lockfile, or some other service like a redis server or such.

    the "distributed client" lock isn't turned on by default, the memcached backends will use the memcached lock if you set distrbuted_lock to true:

    http://dogpilecache.readthedocs.org/en/latest/api.html#memcached-backends

  2. Log in to comment