Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Use of memcached with Catalyst

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


hobbestigrou at erakis

Oct 30, 2009, 8:03 AM

Post #1 of 6 (1223 views)
Permalink
Use of memcached with Catalyst

Hi,
I'm writing here beacause i want to know if anyone have used memacached
with Catalyst. I have tested using a plugin for Catalyst
(http://search.cpan.org/dist/Catalyst-Plugin-Session-Store-Memcached-Fast) 
but i have a little problem. If I restart my apache, it's ok, I'm still
connected when apache restarts. But if I'm connected and I try to go in
another front, I'm not connected: a new session is created. I searched
on google but I couldn't get examples of this. I'm using Catalsyt 5.7006
with Perl 5.8.8. I have a hash with the address of the memcached server,
the namespace and the hash_namespace activated. When I want to cache any
data, I use
$c->session->{user} = $user;
If you have some example or a documentation, that would be cool.

Thanks in advance.

--
\0/ Hobbestigrou
site web: http://erakis.im

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


moseley at hank

Oct 30, 2009, 8:41 AM

Post #2 of 6 (1148 views)
Permalink
Re: Use of memcached with Catalyst [In reply to]

2009/10/30 Natal Ngétal <hobbestigrou [at] erakis>

> Hi,
> I'm writing here beacause i want to know if anyone have used memacached
> with Catalyst. I have tested using a plugin for Catalyst
> (http://search.cpan.org/dist/Catalyst-Plugin-Session-Store-Memcached-Fast
> )
> but i have a little problem. If I restart my apache, it's ok, I'm still
> connected when apache restarts. But if I'm connected and I try to go in
> another front, I'm not connected: a new session is created.


What's another "front"?



--
Bill Moseley
moseley [at] hank


hobbestigrou at erakis

Oct 30, 2009, 9:12 AM

Post #3 of 6 (1141 views)
Permalink
Re: Use of memcached with Catalyst [In reply to]

Le vendredi 30 octobre 2009 à 08:41:55, Bill Moseley a écrit :
> What's another "front"?
There is a load balancer that chose which (front-end) server will
answer.
So I was hoping that with memcached on another server, if one front-end
server is stopped, the other front-end servers would remember the
session.


--
\0/ Hobbestigrou
site web: http://erakis.im

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


jspath at pangeamedia

Oct 30, 2009, 9:19 AM

Post #4 of 6 (1141 views)
Permalink
Re: Use of memcached with Catalyst [In reply to]

Natal Ngétal wrote:
> Le vendredi 30 octobre 2009 à 08:41:55, Bill Moseley a écrit :
>> What's another "front"?
> There is a load balancer that chose which (front-end) server will
> answer.
> So I was hoping that with memcached on another server, if one front-end
> server is stopped, the other front-end servers would remember the
> session.

Is your server IP list _exactly_ the same across all of the front-end
servers?

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


hobbestigrou at erakis

Oct 30, 2009, 9:54 AM

Post #5 of 6 (1145 views)
Permalink
Re: Use of memcached with Catalyst [In reply to]

Le vendredi 30 octobre 2009 à 12:19:05, Jim Spath a écrit :
> Is your server IP list _exactly_ the same across all of the
> front-end servers?
Yes. And since I've set hash_namespace to true, I keep my session when I
restart apache on a server. But it doesn't keep the session if I go on a
page from another apache server, although the configuration is
exactly the same on each server.

--
\0/ Hobbestigrou
site web: http://erakis.im

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


moseley at hank

Oct 30, 2009, 10:22 AM

Post #6 of 6 (1140 views)
Permalink
Re: Use of memcached with Catalyst [In reply to]

2009/10/30 Natal Ngétal <hobbestigrou [at] erakis>

> Le vendredi 30 octobre 2009 à 12:19:05, Jim Spath a écrit :
> > Is your server IP list _exactly_ the same across all of the
> > front-end servers?
> Yes. And since I've set hash_namespace to true, I keep my session when I
> restart apache on a server. But it doesn't keep the session if I go on a
> page from another apache server, although the configuration is
> exactly the same on each server.
>

Throw in some debugging on each web server. Make sure the same session id
is presented to each. Make sure the same memcached key is requested.

Write a small script to fetch the session. Then run it on all machines.

Obviously, your cookie's domain isn't changing, right?




--
Bill Moseley
moseley [at] hank

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.