Has anyone here successfully setup a system to take advantage of rails page/action caching when using a mongrel cluster that spans multiple servers? If so, could you shed some light on how you handled expiring cache across multiple mongrel servers (physically different machines)?
on 2007-03-21 22:05
on 2007-03-21 22:52
I'm working on this now. I have two approaches: 1. (Implemented) - If you control the URLs, put the timestamp of the resource in the URL linking to it. eg url_for(:product => product, :timestamp => product.modified_at.to_i) 2. Instead of using page caching, have Apache cache, use mod_cache. Then, set the expires header very short - Apache will ask Rails for the resource. But don't return it if it's still okay - see http://www.igvita.com/blog/2007/03/07/client-http-... (I have the headers in #2 working but have not turned on mod_cache yet) Let me know how your experience goes.
on 2007-03-22 04:26
Action caching can be configured to use a shared fragment store - DRb or Memcache fragment stores are supplied. Expiry from any server will expiry the action for all servers, and, with Memcache, the store can be distributed over a set of servers for redundancy. Page caching will need some form of sharing of the cache directory across machines - NFS would be the obvious choice, but I don't know how reliable this is, or how Rails or Apache behave when there are network problems.
on 2007-03-28 00:55
On 3/21/07, S. Robert James <firstname.lastname@example.org> wrote: > 1. (Implemented) - If you control the URLs, put the timestamp of the > resource in the URL linking to it. eg url_for(:product => > product, :timestamp => product.modified_at.to_i) > 2. Instead of using page caching, have Apache cache, use mod_cache. > Then, set the expires header very short - Apache will ask Rails for > the resource. But don't return it if it's still okay - see > http://www.igvita.com/blog/2007/03/07/client-http-... 3. Use a SAN. J.
on 2007-03-28 03:32
I have it implemented and working for a long time using NFS mounts for the public directory. But you don't really need NFS specifically. Anything you can mount and share across servers will work. Bye, Guy. On 3/21/07, Justin <email@example.com> wrote: > -- Family management on rails: http://www.famundo.com My development related blog: http://devblog.famundo.com