Hello, Has anyone gotten memcached to work with a mongrel cluster before? I see numerous posts on the internet of people who can''t get this to work, and no one saying it does. Do these two technologies work together? (Note: I say mongrel cluster. I know memcached works with a single mongrel instance). -Iain -- View this message in context: http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12232426 Sent from the RubyOnRails Users mailing list archive at Nabble.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 -~----------~----~----~----~------~----~------~--~---
Hi Iain, I have a mongrel_cluster working with memcached, to be honest I didn''t even know there was an issue around this. I assumed that memcached was more of a rails issue than a mongrel one. I haven''t done anything magical in my config files, just created my mongrel cluster and enabled memcached sessions in my environment.rb. Keith On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote:> > > Hello, > > Has anyone gotten memcached to work with a mongrel cluster before? I see > numerous posts on the internet of people who can''t get this to work, and no > one saying it does. > > Do these two technologies work together? > > (Note: I say mongrel cluster. I know memcached works with a single mongrel > instance). > > -Iain > -- > View this message in context: http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12232426 > Sent from the RubyOnRails Users mailing list archive at Nabble.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 -~----------~----~----~----~------~----~------~--~---
Interesting... are you using memcache-client or Ruby-MemCache to make your bridge? -Iain Keith Davey-3 wrote:> > > Hi Iain, > > I have a mongrel_cluster working with memcached, to be honest I didn''t > even know there was an issue around this. I assumed that memcached was > more of a rails > issue than a mongrel one. > > I haven''t done anything magical in my config files, just created my > mongrel cluster and enabled memcached sessions in my environment.rb. > > Keith > > On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote: >> >> >> Hello, >> >> Has anyone gotten memcached to work with a mongrel cluster before? I >> see >> numerous posts on the internet of people who can''t get this to work, and >> no >> one saying it does. >> >> Do these two technologies work together? >> >> (Note: I say mongrel cluster. I know memcached works with a single >> mongrel >> instance). >> >> -Iain >> -- >> View this message in context: >> http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12232426 >> Sent from the RubyOnRails Users mailing list archive at Nabble.com. >> >> >> > >> > > > > >-- View this message in context: http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12233843 Sent from the RubyOnRails Users mailing list archive at Nabble.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 am using memcache-client. Also, I am running the production boxes on linux but developing on a mac, works on both. Keith On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote:> > > > Interesting... are you using memcache-client or Ruby-MemCache to make your > bridge? > > -Iain > > > Keith Davey-3 wrote: > > > > > > Hi Iain, > > > > I have a mongrel_cluster working with memcached, to be honest I didn''t > > even know there was an issue around this. I assumed that memcached was > > more of a rails > > issue than a mongrel one. > > > > I haven''t done anything magical in my config files, just created my > > mongrel cluster and enabled memcached sessions in my environment.rb. > > > > Keith > > > > On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote: > >> > >> > >> Hello, > >> > >> Has anyone gotten memcached to work with a mongrel cluster before? I > >> see > >> numerous posts on the internet of people who can''t get this to work, and > >> no > >> one saying it does. > >> > >> Do these two technologies work together? > >> > >> (Note: I say mongrel cluster. I know memcached works with a single > >> mongrel > >> instance). > >> > >> -Iain > >> -- > >> View this message in context: > >> http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12232426 > >> Sent from the RubyOnRails Users mailing list archive at Nabble.com. > >> > >> > >> > > >> > > > > > > > > > > > -- > View this message in context: http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12233843 > Sent from the RubyOnRails Users mailing list archive at Nabble.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 -~----------~----~----~----~------~----~------~--~---
Hurm, that suggests its a configuration issue. Could I take a look at the memcache lines you added for environment.rb please? I''m using the "vanilla" ones posted on many blogs. Tried with both clients to no avail. I''m currently reading through the verbose debug from Ruby-MemCache in the hope of spotting something... -Iain Keith Davey-3 wrote:> > > I am using memcache-client. > > Also, I am running the production boxes on linux but developing on a > mac, works on > both. > > Keith > > On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote: >> >> >> >> Interesting... are you using memcache-client or Ruby-MemCache to make >> your >> bridge? >> >> -Iain >> >> >> Keith Davey-3 wrote: >> > >> > >> > Hi Iain, >> > >> > I have a mongrel_cluster working with memcached, to be honest I didn''t >> > even know there was an issue around this. I assumed that memcached was >> > more of a rails >> > issue than a mongrel one. >> > >> > I haven''t done anything magical in my config files, just created my >> > mongrel cluster and enabled memcached sessions in my environment.rb. >> > >> > Keith >> > >> > On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote: >> >> >> >> >> >> Hello, >> >> >> >> Has anyone gotten memcached to work with a mongrel cluster before? I >> >> see >> >> numerous posts on the internet of people who can''t get this to work, >> and >> >> no >> >> one saying it does. >> >> >> >> Do these two technologies work together? >> >> >> >> (Note: I say mongrel cluster. I know memcached works with a single >> >> mongrel >> >> instance). >> >> >> >> -Iain >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12232426 >> >> Sent from the RubyOnRails Users mailing list archive at Nabble.com. >> >> >> >> >> >> > >> >> >> > >> > > >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12233843 >> Sent from the RubyOnRails Users mailing list archive at Nabble.com. >> >> >> > >> > > > > >-- View this message in context: http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12234130 Sent from the RubyOnRails Users mailing list archive at Nabble.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 -~----------~----~----~----~------~----~------~--~---
The only line I''ve added is to the Rails::Initializer.run block and it looks like this: config.action_controller.session_store = :mem_cache_store Keith On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote:> > > > Hurm, that suggests its a configuration issue. Could I take a look at the > memcache lines you added for environment.rb please? > > I''m using the "vanilla" ones posted on many blogs. Tried with both clients > to no avail. I''m currently reading through the verbose debug from > Ruby-MemCache in the hope of spotting something... > > -Iain > > > Keith Davey-3 wrote: > > > > > > I am using memcache-client. > > > > Also, I am running the production boxes on linux but developing on a > > mac, works on > > both. > > > > Keith > > > > On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote: > >> > >> > >> > >> Interesting... are you using memcache-client or Ruby-MemCache to make > >> your > >> bridge? > >> > >> -Iain > >> > >> > >> Keith Davey-3 wrote: > >> > > >> > > >> > Hi Iain, > >> > > >> > I have a mongrel_cluster working with memcached, to be honest I didn''t > >> > even know there was an issue around this. I assumed that memcached was > >> > more of a rails > >> > issue than a mongrel one. > >> > > >> > I haven''t done anything magical in my config files, just created my > >> > mongrel cluster and enabled memcached sessions in my environment.rb. > >> > > >> > Keith > >> > > >> > On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote: > >> >> > >> >> > >> >> Hello, > >> >> > >> >> Has anyone gotten memcached to work with a mongrel cluster before? I > >> >> see > >> >> numerous posts on the internet of people who can''t get this to work, > >> and > >> >> no > >> >> one saying it does. > >> >> > >> >> Do these two technologies work together? > >> >> > >> >> (Note: I say mongrel cluster. I know memcached works with a single > >> >> mongrel > >> >> instance). > >> >> > >> >> -Iain > >> >> -- > >> >> View this message in context: > >> >> > >> http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12232426 > >> >> Sent from the RubyOnRails Users mailing list archive at Nabble.com. > >> >> > >> >> > >> >> > > >> >> > >> > > >> > > > >> > > >> > > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12233843 > >> Sent from the RubyOnRails Users mailing list archive at Nabble.com. > >> > >> > >> > > >> > > > > > > > > > > > -- > View this message in context: http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12234130 > Sent from the RubyOnRails Users mailing list archive at Nabble.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 -~----------~----~----~----~------~----~------~--~---
OK, I did some debugging of Rails, and I think the answer is to do with the way Rails uses sessions. The mem_cache session store is actually serialised outside of the Rails framework, which means that it cannot instantiate ActiveRecord objects upon load. This is different to the file_session storage which is part of Rails. This means that if you store ActiveRecord objects in your session, there is a good chance your application will not work with memcached. I''m guessing you opt for the more traditional route and only store IDs in the session. Different options at this point are to add additional extensions to the CGI:Session object (serialising everything as a string upon save and load) so that mem_cache_session will work, changing the application to use object IDs rather than objects in the session, or going back to file based sessions and adding some kind of mutex so they will work with mongrel clusters. Thanks for all your help, -Iain Keith Davey-3 wrote:> > > The only line I''ve added is to the Rails::Initializer.run block and it > looks like > this: > > config.action_controller.session_store = :mem_cache_store > > Keith > > On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote: >> >> >> >> Hurm, that suggests its a configuration issue. Could I take a look at >> the >> memcache lines you added for environment.rb please? >> >> I''m using the "vanilla" ones posted on many blogs. Tried with both >> clients >> to no avail. I''m currently reading through the verbose debug from >> Ruby-MemCache in the hope of spotting something... >> >> -Iain >> >> >> Keith Davey-3 wrote: >> > >> > >> > I am using memcache-client. >> > >> > Also, I am running the production boxes on linux but developing on a >> > mac, works on >> > both. >> > >> > Keith >> > >> > On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote: >> >> >> >> >> >> >> >> Interesting... are you using memcache-client or Ruby-MemCache to make >> >> your >> >> bridge? >> >> >> >> -Iain >> >> >> >> >> >> Keith Davey-3 wrote: >> >> > >> >> > >> >> > Hi Iain, >> >> > >> >> > I have a mongrel_cluster working with memcached, to be honest I >> didn''t >> >> > even know there was an issue around this. I assumed that memcached >> was >> >> > more of a rails >> >> > issue than a mongrel one. >> >> > >> >> > I haven''t done anything magical in my config files, just created my >> >> > mongrel cluster and enabled memcached sessions in my environment.rb. >> >> > >> >> > Keith >> >> > >> >> > On 8/20/07, innr <iain.reid-3etTQGT7qQvQT0dZR+AlfA@public.gmane.org> wrote: >> >> >> >> >> >> >> >> >> Hello, >> >> >> >> >> >> Has anyone gotten memcached to work with a mongrel cluster before? >> I >> >> >> see >> >> >> numerous posts on the internet of people who can''t get this to >> work, >> >> and >> >> >> no >> >> >> one saying it does. >> >> >> >> >> >> Do these two technologies work together? >> >> >> >> >> >> (Note: I say mongrel cluster. I know memcached works with a >> single >> >> >> mongrel >> >> >> instance). >> >> >> >> >> >> -Iain >> >> >> -- >> >> >> View this message in context: >> >> >> >> >> >> http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12232426 >> >> >> Sent from the RubyOnRails Users mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> >> > >> >> >> >> >> > >> >> > > >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12233843 >> >> Sent from the RubyOnRails Users mailing list archive at Nabble.com. >> >> >> >> >> >> > >> >> >> > >> > > >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12234130 >> Sent from the RubyOnRails Users mailing list archive at Nabble.com. >> >> >> > >> > > > > >-- View this message in context: http://www.nabble.com/does-mongrel-work-with-memcached--tf4297581.html#a12250769 Sent from the RubyOnRails Users mailing list archive at Nabble.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 -~----------~----~----~----~------~----~------~--~---