Re: Sessions with a multi-server hosting environment

2007-02-07 Thread Chris Hartjes

On 2/7/07, PaulV <[EMAIL PROTECTED]> wrote:
> So what are the pros and cons for each of the choices for sessions

Speaking from my own experience, if you have multiple application
servers running, you really have no choice but to go with some sort of
centralized database-based session system (although I did experiment
with using memcached as the server and there are some excellent
examples of using memcached for sessions in Ruby on Rails).

DB-based solutions are probably slower than PHP-based ones.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

rallyhat.com - digitial photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sessions with a multi-server hosting environment

2007-02-07 Thread PaulV



On Feb 7, 6:09 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:

> Database sessions are what we used on our project as well.
>
So what are the pros and cons for each of the choices for sessions

Database Sessions - More easily scalable since database server is
accessible from all machines in cluster. Slower?
PHP Sessions - ?
Cake Sessions - ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sessions with a multi-server hosting environment

2007-02-07 Thread Chris Hartjes

On 2/7/07, John David Anderson (_psychic_) <[EMAIL PROTECTED]> wrote:
> Cake's database sessions is a custom handler.

I figured as much, but I wanted to hear from someone else about it
before I proclaimed it so.
Database sessions are what we used on our project as well.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

rallyhat.com - digitial photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: Sessions with a multi-server hosting environment

2007-02-07 Thread Mariano Iglesias

Hahaha... So basically the statement is: "Don't mental masturbate, do what
the cool kids are doing: use DB sessions."

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de nate
Enviado el: MiƩrcoles, 07 de Febrero de 2007 02:44 p.m.
Para: Cake PHP
Asunto: Re: Sessions with a multi-server hosting environment

Also, the over-arching thing to consider here is that you just
launched.  There's nothing wrong with thinking ahead, but unless your
app is The Second Coming of Google, thinking about scaling on that
level right now is, for lack of a better term, mental masturbation.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sessions with a multi-server hosting environment

2007-02-07 Thread nate

Also, the over-arching thing to consider here is that you just
launched.  There's nothing wrong with thinking ahead, but unless your
app is The Second Coming of Google, thinking about scaling on that
level right now is, for lack of a better term, mental masturbation.

On Feb 7, 12:41 pm, "nate" <[EMAIL PROTECTED]> wrote:
> Use database sessions, that's what all the cool kids are doing.
>
> // app/config/core.php:
> define('CAKE_SESSION_SAVE', 'database');
>
> On Feb 7, 12:35 pm, "John David Anderson (_psychic_)"
>
> <[EMAIL PROTECTED]> wrote:
> > On Feb 7, 2007, at 10:30 AM, Chris Hartjes wrote:
>
> > > On 2/7/07, codecowboy <[EMAIL PROTECTED]> wrote:
>
> > >> My company Lifeagora has launched...  Finally!!!  (applause)  We are
> > >> in the process of setting up a scalable architecture which would of
> > >> course allow us to use a load balancer to divi up requests between
> > >> several apache servers.  This not my cup of tea, so this may come off
> > >> as a newbie question.  Will I need to change Cake's Session Component
> > >> so that is works when multiple servers are creating sessions at the
> > >> same time?  Or, is this something that I will fix inside of apache?
>
> > > Having been through this on a non-CakePHP app, I offer the  
> > > following advice:
>
> > > 1) you will need a custom session handler so that requests on multiple
> > > servers will have unique ID's if your load balancer moves someone from
> > > one server to another
>
> > Cake's database sessions is a custom handler.
>
> > By pointing all your applications to look at a single database table  
> > for session info, you remove the problems created by clustering.
>
> > > 2) you will likely have to change Cake's session component in some way
> > > to get it to use a custom session handler instead of the stock one.
>
> > Not if you use database sessions, or configure your PHP session files  
> > to reside on a share that can be accessed by all the nodes in the  
> > cluster.
>
> > -- John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sessions with a multi-server hosting environment

2007-02-07 Thread nate

Use database sessions, that's what all the cool kids are doing.

// app/config/core.php:
define('CAKE_SESSION_SAVE', 'database');

On Feb 7, 12:35 pm, "John David Anderson (_psychic_)"
<[EMAIL PROTECTED]> wrote:
> On Feb 7, 2007, at 10:30 AM, Chris Hartjes wrote:
>
>
>
>
>
> > On 2/7/07, codecowboy <[EMAIL PROTECTED]> wrote:
>
> >> My company Lifeagora has launched...  Finally!!!  (applause)  We are
> >> in the process of setting up a scalable architecture which would of
> >> course allow us to use a load balancer to divi up requests between
> >> several apache servers.  This not my cup of tea, so this may come off
> >> as a newbie question.  Will I need to change Cake's Session Component
> >> so that is works when multiple servers are creating sessions at the
> >> same time?  Or, is this something that I will fix inside of apache?
>
> > Having been through this on a non-CakePHP app, I offer the  
> > following advice:
>
> > 1) you will need a custom session handler so that requests on multiple
> > servers will have unique ID's if your load balancer moves someone from
> > one server to another
>
> Cake's database sessions is a custom handler.
>
> By pointing all your applications to look at a single database table  
> for session info, you remove the problems created by clustering.
>
> > 2) you will likely have to change Cake's session component in some way
> > to get it to use a custom session handler instead of the stock one.
>
> Not if you use database sessions, or configure your PHP session files  
> to reside on a share that can be accessed by all the nodes in the  
> cluster.
>
> -- John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sessions with a multi-server hosting environment

2007-02-07 Thread John David Anderson (_psychic_)


On Feb 7, 2007, at 10:30 AM, Chris Hartjes wrote:

>
> On 2/7/07, codecowboy <[EMAIL PROTECTED]> wrote:
>>
>> My company Lifeagora has launched...  Finally!!!  (applause)  We are
>> in the process of setting up a scalable architecture which would of
>> course allow us to use a load balancer to divi up requests between
>> several apache servers.  This not my cup of tea, so this may come off
>> as a newbie question.  Will I need to change Cake's Session Component
>> so that is works when multiple servers are creating sessions at the
>> same time?  Or, is this something that I will fix inside of apache?
>>
>
> Having been through this on a non-CakePHP app, I offer the  
> following advice:
>
> 1) you will need a custom session handler so that requests on multiple
> servers will have unique ID's if your load balancer moves someone from
> one server to another

Cake's database sessions is a custom handler.

By pointing all your applications to look at a single database table  
for session info, you remove the problems created by clustering.

> 2) you will likely have to change Cake's session component in some way
> to get it to use a custom session handler instead of the stock one.

Not if you use database sessions, or configure your PHP session files  
to reside on a share that can be accessed by all the nodes in the  
cluster.

-- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sessions with a multi-server hosting environment

2007-02-07 Thread Chris Hartjes

On 2/7/07, codecowboy <[EMAIL PROTECTED]> wrote:
>
> My company Lifeagora has launched...  Finally!!!  (applause)  We are
> in the process of setting up a scalable architecture which would of
> course allow us to use a load balancer to divi up requests between
> several apache servers.  This not my cup of tea, so this may come off
> as a newbie question.  Will I need to change Cake's Session Component
> so that is works when multiple servers are creating sessions at the
> same time?  Or, is this something that I will fix inside of apache?
>

Having been through this on a non-CakePHP app, I offer the following advice:

1) you will need a custom session handler so that requests on multiple
servers will have unique ID's if your load balancer moves someone from
one server to another
2) you will likely have to change Cake's session component in some way
to get it to use a custom session handler instead of the stock one.

Hope that helps.


-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

rallyhat.com - digitial photo scavenger hunt
@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sessions with a multi-server hosting environment

2007-02-07 Thread John David Anderson (_psychic_)


On Feb 7, 2007, at 10:26 AM, codecowboy wrote:

>
> My company Lifeagora has launched...  Finally!!!  (applause)  We are
> in the process of setting up a scalable architecture which would of
> course allow us to use a load balancer to divi up requests between
> several apache servers.  This not my cup of tea, so this may come off
> as a newbie question.  Will I need to change Cake's Session Component
> so that is works when multiple servers are creating sessions at the
> same time?  Or, is this something that I will fix inside of apache?

Depends what type of sessions you're using.

If you using php sessions, you'll need to make sure those session  
files are stored in a share that is accessible to all cluster nodes.

You might consider using database sessions - this allows all nodes on  
the cluster to use the same database they are already connected to in  
order to get session data as well.

Congrats on the launch. :)

-- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---