> After a recent hardware catastrophe, my company has wisely 
> elected to go from a single server environment to a 
> load-balanced, mutli-server environment for the sake of 
> redundancy and smooth performance. (Funny how disaster 
> prevention seems to become a high priority only after 
> disaster occurs...:> ) However, this will be the first time 
> I've worked with CF in a multi-server environment, and I'm 
> not sure what sort of issues have to be taken into 
> consideration for such a change. Our main site is large, 
> complex, and uses a lot of session variables. I'm not looking 
> for anyone to do the research for me, but the resources I've 
> searched (O'Reilly CF book, online documentation, various 
> forums) seem mostly silent on the subject so far. Could 
> anyone be kind enough to point me in the right direction?
> 
> For example, I'm concerned about such things as if you have a 
> CF Application Server running on box A and another on box B, 
> isn't there a danger of session variables getting lost if the 
> load balancer suddenly decides to switch a visitor from box A 
> to box B in mid-session? And for scheduled tasks, you really 
> can only have them set up on one box or the other, otherwise 
> they'd always shoot off twice, correct?

I don't know of any resources that specifically cover application issues
within a clustered environment. Most of the issues are pretty
straightforward, actually, like the ones you mentioned as examples. Most of
the major issues are mentioned within clustering documentation and articles
on the MM Devnet site.

If you use Session variables, you will need to either use "sticky sessions"
on your load balancer, or use J2EE session replication. When you use sticky
sessions, the load balancer will send a new user to the least-busy server,
but all subsequent requests from that user will be returned to the same
server. In this environment, you lose the failover functionality that
load-balancing provides, since if that user's server goes down their session
is lost. J2EE session replication is a new feature in CFMX, which allows you
to have each server within a cluster copy its session data to all the other
servers. This requires you use the full J2EE server installation, and it
requires you to enable J2EE session management within the CF Administrator.
I'm a little leery of this approach, myself, but I don't have that much
experience with it.

Client variables are often used as an alternative in this situation. They
can be shared among servers and stored within a central database. Of course,
they'll be slower than Session variables and they can't store anything but
strings.

Typically, within a cluster, you may only have one machine responsible for
scheduled tasks. Personally, I prefer not to use CF for scheduled tasks at
all - I'd much rather use other functionality within the database or the
application server's operating system for that.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:10:5076
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/10
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:10
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.10
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to