On Jun 22, 2007, at 8:07 PM, Ram Ravichandran wrote:

>
> Hey,
>
> Can someone give me some advice in setting up load balancing (and
> suggestions on some good cheap software load balancers.) I need a load
> balancer which can look at the incoming http request, query a session
> variable in the request, and based on the value, it should route the
> request to 1 of 10 servers. My questions are:
>
> a) Is it even possible to inspect session variables, or do the Load
> balancers (LB) work at a higher level? Will it be a considerable
> performance hit to do this level of lookup?

Are you talking about variables stored in your rails session? If so  
then no there is no way to query the session variables and make  
decisions based on that in the load balancer. Most load balancers can  
do balancing based on some cookie or special header in the request.  
But getting at the data in the rails session is only possible from  
within a rails app and the load balancer works in front of rails ands  
has no way to query the session values.


>
> b) I have a hash which maps a value in the session variable to the
> server to which we need to route the request. What's the best way to
> maintain this hash? Keep it in memory in the LB? or have a database  
> that
> stores these values? Which is better given that I have about 10  
> million
> values to choose from?

It is going to be a huge performance hit if your load balancer has to  
check a database for each request it routes. Can you expound on what  
problem you are trying to solve with this? Maybe there is a different  
way to accomplish what you want that will still perform acceptably.

>
> c) Any suggestions on a good software load balancer that can do this.

        Second vote for HAProxy, it's probably the most flexible fast  
software load balancer around. Although I know it will not be able to  
inspect your rails sessions, thats not an option at the load  
balancing point.

Cheers-
-- Ezra Zygmuntowicz 
-- Lead Rails Evangelist
-- [EMAIL PROTECTED]
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)



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

Reply via email to