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)? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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-caching-in-rails/ (I have the headers in #2 working but have not turned on mod_cache yet) Let me know how your experience goes. On Mar 21, 5:05 pm, Justin <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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)? > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Mar 21, 2:05 pm, Justin <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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)? > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 3/21/07, S. Robert James <srobertjames-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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-caching-in-rails/3. Use a SAN. J. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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)? > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Family management on rails: http://www.famundo.com My development related blog: http://devblog.famundo.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---