Use of memcached with Catalyst

View: New views
7 Messages — Rating Filter:   Alert me  

Use of memcached with Catalyst

by Natal Ngétal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: Use of memcached with Catalyst

by Bill Moseley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



2009/10/30 Natal Ngétal <hobbestigrou@...>
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@...

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

Re: Use of memcached with Catalyst

by Natal Ngétal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: Use of memcached with Catalyst

by jspath :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: Use of memcached with Catalyst

by Natal Ngétal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: Use of memcached with Catalyst

by Bill Moseley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



2009/10/30 Natal Ngétal <hobbestigrou@...>
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@...

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

Re: [Resolved] Use of memcached with Catalyst

by Natal Ngétal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Le vendredi 30 octobre 2009 à 10:22:22, Bill Moseley a écrit :
> 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?
ops! Thanks a lot: each server has its own sub-domain on dev. So I
believe it will be ok in prod, with only one domain.


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

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