[Mongrel] MongrelCluster - How can I make a request to a specific mongrel instance?
ezmobius at gmail.com
Thu Aug 24 11:53:46 EDT 2006
On Aug 24, 2006, at 8:13 AM, Scott R Brittain wrote:
> In our app we've a number of singleton ruby classes that cache
> static data in hashes, things like
> string values, system config params, etc). In a webbrick
> environment this works ok, but we find
> in production we have a problem because we have 4 caches, one for
> each mongrel instance.
> This also isn't a BIG problem, but our cache.reload() methods are
> kinda useless now, because
> we can't direct this call to a specific mongrel/rails instance.
> Any suggestions? In the long term, we'll be redesigning the cache
> to be shared, but we'd like to
> fix this now.
> Had considered writing a quicky "broadcaster" that would iterate
> over our known mongrel ports
> and hit them directly. But we're not sure if (a) that would work
> and (b) the best way to read the
> current running ports.
> Thanks in advance.
Well you can use pound to setup sticky sessions or session affinity
but I don't reccomend that as its fragile. I would say your best
option is to make a very simple drb server to run your singleton in
and then all mongrels can talk to the one instance over drb.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mongrel-users