I'm not very familiar with the win32 platform, but I hear that Mongrel
runs on it. Have you considered running your application on mongrel and
using IIS (does it do load balancing/proxying?) in front of it rather
than have IIS directly run the application?
Robby
--
Robby Russell
http://www.robbyonrails.com/
http://www.planetargon.com/
IIS does not have a builtin reverse proxy. There are various ways that
this can be done. There are commerical products (aka: MS ISA Server ~
$1500/processor
(http://www.microsoft.com/isaserver/howtobuy/default.mspx)). There is
also an open source (MIT licenced) ASP.NET application that will do
this for you, but I'm not certain what the performance hit will be
(http://www.saltypickle.com/Home/16)
I'm guessing that you want your rails apps to work through IIS so that
you can run rails apps along side ASP/ASP.NET apps on the same server,
otherwise you'd just use win32 Apache. If that's the case then you're
best option for performance might be to run win32 apache and proxy
your IIS apps through it.
-- Wes
Apache (2.2) has a proxy balancer, so you could proxy several mongrel
instances.
Here is a blog post that I just found from a quick google search.
You'll want to look at these sections.
<Proxy balancer://mongrel_cluster>
BalancerMember http://127.0.0.1:8000
BalancerMember http://127.0.0.1:8001
BalancerMember http://127.0.0.1:8002
</Proxy>
and where it's using rewrite to talk to the balancer.
Putting Apache on port 80 and hiding IIS behind it might be a good
solution for many of your hosting needs in your all-windows environment.
Good luck!
Yeah, I've done it so I could run Subversion through Apache, and still
run IIS apps. It means that you have to run your IIS apps on another
port, and proxy through apache.
The downside is that you have to maintain two server configurations
for your IIS apps.
BTW, I looked at the dotNet reverse proxy, but it doesn't seem to
handle relative URLs properly. Otherwise, it might not be a bad choice
for an MS only shop. If you can get it to work it will save you from
having to maintain two web server configurations.
> As for the reverse proxy, that would only hit 1 mongrel process right?
You'll want to have at least two mongrel processes, maybe more
depending on the amount of traffic that your app will receive.
-- Wes
--
Aníbal Rojas
http://www.rubycorner.com
http://www.hasmanydevelopers.com
On Feb 6, 10:00 am, Robby Russell <robby.li...@planetargon.com> wrote:
> Marlon Moyer wrote:
> > yes. Aside from ColdFusion and the new RoR apps that I'm creating,
> > we're a 100% microsoft shop. Is it possible to run both IIS and Apache
> > on the same win32 server? I've never tried that, but as long as it
> > wouldn't interfere with the normal IIS operation, I think I could get
> > that done.
>
> > As for the reverse proxy, that would only hit 1 mongrel process right?
>
> Apache (2.2) has a proxy balancer, so you could proxy several mongrel
> instances.
>
> Here is a blog post that I just found from a quick google search.
>
>
> You'll want to look at these sections.
>
> <Proxy balancer://mongrel_cluster>
> BalancerMemberhttp://127.0.0.1:8000
> BalancerMemberhttp://127.0.0.1:8001
> BalancerMemberhttp://127.0.0.1:8002
I have run Apache on W2K, it is really easy to install, and stable.
Its configuration is the same than linux so it should not be a
problem. Putting IIS behind is a very good idea.
--
Aníbal Rojas
http://www.rubycorner.com
http://www.hasmanydevelopers.com
On Feb 6, 10:00 am, Robby Russell <robby.li...@planetargon.com > wrote:
> Marlon Moyer wrote:
> > yes. Aside from ColdFusion and the new RoR apps that I'm creating,
> > we're a 100% microsoft shop. Is it possible to run both IIS and Apache
> > on the same win32 server? I've never tried that, but as long as it
> > wouldn't interfere with the normal IIS operation, I think I could get
> > that done.
>
> > As for the reverse proxy, that would only hit 1 mongrel process right?
>
> Apache (2.2) has a proxy balancer, so you could proxy several mongrel
> instances.
>
> Here is a blog post that I just found from a quick google search.
>
But looking at how people are usually deploying on *nix platforms with
mongrel_cluster using many mongrel instances on the same machine, I'm
wondering if just having one mongrel instance behind IIS is a bad
idea. Or rather, a non optimal solution.
I haven't really figured out what makes clustered mongrels better than
just having one mongrel though. It's not like I would put up a bunch
of IIS instances on the same machine to serve a .NET app, or a bunch
of Apaches on the same machine to serve a php app. But a bunch of
mongrels are apparently the way to go. How come?
In our case we can't replace IIS with Apache since it would probably
freak out the server administrator completely. And we do have som .NET
stuff on there as well ;)
Ideas of what the best deployment scenario with IIS in front would be
would be much appreciated.
"Ruby on Rails is not thread safe so there is a synchronized block
around the calls to Dispatcher.dispatch. This means that everything is
threaded right before and right after Rails runs. While Rails is
running there is only one controller in operation at a time. This is
why people typically have to run a small set of Mongrel processes (a
"Pack of Mongrels") to get good concurrency.
If you have long running actions then you'll most likely have
performance problems. You should look at BackgrounDRB as a very nice
way to offload work to another process so that your Rails app can keep
working."
So if you expect to have more than one concurrent user, then you'll
want multiple mongrels to keep the response time low. If you are
setting up a low usage app (say for internal use) then one mongrel may
be sufficient.
As for running IIS on the front end ... there are a couple of ways
that I can think of:
1) Use apache to reverse proxy the mongrels to a high numbered port.
Then use ISAPI Rewrite to forward requests to apache.
2) Use a proxy application built for IIS that supports multiple back
ends. I found one (http://www.saltypickle.com/Home/16) which is a .NET
app, but in the 15 minutes I played with it, I was not able to get it
working properly (URLs got mangled). You might have better luck than I
did.
There may be better reverse proxy options for IIS out there, and
they'll probably cost you some money. You'll have to do some research.
The official MS solution would be to buy MS ISA server, which costs
$1500/processor.
Good luck!
-- Wes
Going to attempt using Pen.
Right now having problems starting the mongrel cluster. Here's some
output...
C:\ruby\apps\STREAM~1>mongrel_rails cluster::start --verbose
Starting 10 Mongrel servers...
mongrel_rails start -d -e production -p 8000 -P log/mongrel.8000.pid
c:/ruby/lib/ruby/gems/1.8/gems/mongrel_cluster-0.2.1/lib/
mongrel_cluster/init.rb
:53:in ``': Exec format error - mongrel_rails start -d -e production -
p 8000 -P
log/mongrel.8000.pid (Errno::ENOEXEC)
Don't get what the problem is here. I can copy/paste the commandline
(mongrel_rails start -d -e production -p 8000 -P log/mongrel.8000.pid)
and run it just fine.
The problem is Win32 lacks forking (or daemonize) which is used by
mongrel with -d parameter, to detach from the console and stay
running.
No mongrel_cluster for win32 (yet).
> Don't get what the problem is here. I can copy/paste the commandline
> (mongrel_rails start -d -e production -p 8000 -P log/mongrel.8000.pid)
> and run it just fine.
The workaround is create multiple mongrel_services definitions and set
them to start automatic.
Please refer to Mongrel win32 specific docs at
http://mongrel.rubyforge.org/docs/win32.html
--
Luis Lavena
Multimedia systems
-
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi
A bunch of services it is then! :)
On 9 Feb, 16:31, "Luis Lavena" <luislav...@gmail.com> wrote:
> On 2/9/07, David Backeus <duztdr...@gmail.com> wrote:
>
>
>
>
>
> > Thanks for all your input.
>
> > Going to attempt using Pen.
>
> > Right now having problems starting the mongrel cluster. Here's some
> > output...
>
> > C:\ruby\apps\STREAM~1>mongrel_rails cluster::start --verbose
> > Starting 10 Mongrel servers...
> > mongrel_rails start -d -e production -p 8000 -P log/mongrel.8000.pid
> > c:/ruby/lib/ruby/gems/1.8/gems/mongrel_cluster-0.2.1/lib/
> > mongrel_cluster/init.rb
> > :53:in ``': Exec format error - mongrel_rails start -d -e production -
> > p 8000 -P
> > log/mongrel.8000.pid (Errno::ENOEXEC)
>
> The problem is Win32 lacks forking (or daemonize) which is used by
> mongrel with -d parameter, to detach from the console and stay
> running.
>
> No mongrel_cluster for win32 (yet).
>
> > Don't get what the problem is here. I can copy/paste the commandline
> > (mongrel_rails start -d -e production -p 8000 -P log/mongrel.8000.pid)
> > and run it just fine.
>
> The workaround is create multiple mongrel_services definitions and set
> them to start automatic.
>
> Please refer to Mongrel win32 specific docs athttp://mongrel.rubyforge.org/docs/win32.html
Yeah, still need to tweak cluster support built into mongrel_service.
But want ship the new version *batteries included*, ala, ship with a
lightweight TCP balancer just for your mongrels :-)
Until then... a bunch of services :-P
You say that multiple instances of mongrel servers as services will
work out but I am wondering how to make ISAPIRewrite use anything but
the first instance. If the mongrel1 is running at port 7000, then
mongrel2 is running at 7001 then who or what decides which instance
will handle an incoming request?
The proxy rule in the ISAPIRewrite module is
[ISAPI_Rewrite]
RewriteProxy (.*) http://localhost:7000$1 [I,U]
How will the mongrel instance at localhost:7001 get a request?
Thank you!
Andre
On Feb 9, 7:31 am, "Luis Lavena" <luislav...@gmail.com> wrote:
> On 2/9/07, David Backeus <duztdr...@gmail.com> wrote:
>
>
>
>
>
> > Thanks for all your input.
>
> > Going to attempt using Pen.
>
> > Right now having problems starting the mongrel cluster. Here's some
> > output...
>
> > C:\ruby\apps\STREAM~1>mongrel_rails cluster::start --verbose
> > Starting 10 Mongrel servers...
> > mongrel_rails start -d -e production -p 8000 -P log/mongrel.8000.pid
> > c:/ruby/lib/ruby/gems/1.8/gems/mongrel_cluster-0.2.1/lib/
> > mongrel_cluster/init.rb
> > :53:in ``': Exec format error - mongrel_rails start -d -e production -
> > p 8000 -P
> > log/mongrel.8000.pid (Errno::ENOEXEC)
>
> The problem is Win32 lacks forking (or daemonize) which is used by
> mongrel with -d parameter, to detach from the console and stay
> running.
>
> No mongrel_cluster for win32 (yet).
>
> > Don't get what the problem is here. I can copy/paste the commandline
> > (mongrel_rails start -d -e production -p 8000 -P log/mongrel.8000.pid)
> > and run it just fine.
>
> The workaround is create multiple mongrel_services definitions and set
> them to start automatic.
>
> Please refer to Mongrel win32 specific docs athttp://mongrel.rubyforge.org/docs/win32.html
ISAPIRewrite don't know anything about if you have one or a bunch of mongrels.
So, you ned to drop Pen [1] into the equation. Pen will handle the
balance between instances.
Any suggestions for a configuration running Pen between ISAPIRewrite
and a bunch of Mongrels? They'll be running on a win2k machine with
IIS serving a number of static IPs, the rails website being run at one
of the IPs.
-- Andre
On Mar 8, 12:35 pm, "Luis Lavena" <luislav...@gmail.com> wrote:
Could you please post a link?
I emailed you a week ago but I am not sure my message reached you.
Thank you.
On Mar 12, 11:46 am, "Brian Hogan" <bpho...@gmail.com> wrote:
> I've posted solutions to this on the list... if you can't find them feel
> free to email me directly.
>