LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > external application "name" for rails easy context

Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2006, 12:29 PM
fantasydreaming fantasydreaming is offline
Senior Member
 
Join Date: Sep 2006
Posts: 76
Default external application "name" for rails easy context

Hi,

I'm struggling with defining a "manual" external lsapi definition so that I can load balance between my local lsapi and a lsws installation on my other server.

1) Basically, the only reason I need to make a manual one is to give it a "name" so I can included it in the load balance list. Is there any name given to the rails context definition that I could just use? It seems like internally it should just emulate the standard configuration - I checked to see if it showed the expanded config in the .xml file, but no luck.

2) Otherwise, what command do I put? The config walkthrough (which is otherwise great) still references myapp/public/dispatch.lsapi, when this has been moved into the lsws directory instead now. http://www.litespeedtech.com/support...iki:ruby_rails

3) How can I configure how much traffic goes to each of the load balanced servers? I'd like to have 60% on the local server, and 40% on the second one - is that possible? I don't think it's smart enough to find out how bad the load is on each machine and proxy accordingly...

I know I could just run two lsws on my main host and load balance to the rails context that way, but I'm worried I'll need the speed and hate the idea of that much indirection.

Thanks for a great service!

-Kevin
Reply With Quote
  #2  
Old 11-07-2006, 01:19 PM
fantasydreaming fantasydreaming is offline
Senior Member
 
Join Date: Sep 2006
Posts: 76
any ideas?
Reply With Quote
  #3  
Old 11-07-2006, 08:30 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Answers to you questions:

1) If you want to load balancing, you cannot use the rails easy configuration, have to follow the step by step configuration.

2) for the local rails install, you can use the "lsws/fcgi-bin/RailsRunner.rb", just add a environment variable "RAILS_ROOT" pointing to your Rails root context.

3) Yes, it can be done. It is controled by "Max Conn" configuration of the two external application, for example, set "Max Conn" on local server to 60, set "Max Conn" to the secondary server to "40", web server will allocate load as you wished. You can change that value as you need, just keep it at 6:4 ratio.

Thank you for your praise.
Reply With Quote
  #4  
Old 11-08-2006, 08:30 AM
fantasydreaming fantasydreaming is offline
Senior Member
 
Join Date: Sep 2006
Posts: 76
Thanks.

There doesn't seem to be any way to use the $VH_ROOT variable in defining the environment variables in the LSAPI external app definition? I've tried {VH_ROOT} and things, but no luck.

I was going to try putting my configuration in a VH template, but it wouldn't work with ENV having RAILS_ROOT hard coded. I guess I could always copy RailsRunner.rb into each project's /public directory and it would figure it out, if variables aren't allowed in ENV definitions.

I'm starting to realize that bouncing it through an an extra virtual host before load balancing so I can use the easy rails context would have been easier and nearly as fast. But now I'm curious about this road
Reply With Quote
  #5  
Old 11-08-2006, 08:49 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
You can copy RailsRunner.rb or dispatch.lsapi in our ruby-lsapi source code package, RailsRunner.rb needs the RAILS_ROOT env, dispatch.lsapi does not.

It is a lot easier to use the easy rails context, load balancer via proxy via LSAPI, there are extra overheads, but should be minimum, if the main server have enough head room, it is not a bad choice.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:53 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.