[Mongrel] MongrelCluster - How can I make a request to a specific mongrel instance?

John Butler imtall at gmail.com
Thu Aug 24 12:35:57 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.
>
> Brittain

Although Drb will probably work, for performance check out memcache:

"memcached is a high-performance, distributed memory object caching  
system, generic in nature, but intended for use in speeding up  
dynamic web applications by alleviating database load."

	http://www.danga.com/memcached/

Ruby library:

	http://www.deveiate.org/projects/RMemCache/

More info:

	http://wiki.rubyonrails.org/rails/pages/MemCached

-John





More information about the Mongrel-users mailing list