[Mongrel] memcache and mongrel_cluster configuration question

Erik Hetzner erik.hetzner at ucop.edu
Mon Aug 20 20:47:35 EDT 2007

At Mon, 20 Aug 2007 17:05:04 -0700,
"Reese, Terry" <terry.reese at oregonstate.edu> wrote:
> I'm assuming that what I'm trying to do is a fairly common on this list,
> so I'm hoping someone can help me out.  We are deploying a rails app.
> using multiple mongrels, managed by mongrel_cluster and apache's
> mod_balancer.  All config information is below.  As part of our setup,
> we use memcache for sessioning -- which is my current problem.  Sessions
> are being set, however, it seems that each mongrel instance is
> maintaining its own copy of the session data (does that make sense?).
> What I'm seeing is that as data is being placed into session variables,
> occasionally, an older instance of a session variable will be
> resurrected.  So if I'd placed "water" in a session variable to be used
> for some action and then placed "fish" in the session variable to use
> for some actions -- when I do those actions, sometimes I'm getting
> "water" back when I query the session variable.  It's almost like each
> mongrel instance is using it's own "memcache" -- which doesn't make
> sense because we only have a single memcache server running.

> […]

Your key to debugging this is going to be using the -vv option to
memcached to monitor the getting & setting of key/value pairs. I
suspect it has to do with the memcache namespace.

Additionally, you’d do best to serialize only the most basic of
variables to sessions; I’d stick with Fixnums & Strings. Anything else
is trouble, and trouble that doesn’t always give you a nice error

Erik Hetzner

;; Erik Hetzner, California Digital Library
;; gnupg key id: 1024D/01DB07E3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20070820/bf1ddb61/attachment-0001.bin 

More information about the Mongrel-users mailing list