Production environment for Rails on Win32, anyone interested


#1

Hi all, as part of adopting Rails in my company I had to go through
the hassle of setting up a Rails production environment on Win32
system since we mostly use MS SQL as our database back end and also
because we mostly dealing with customers who become green-blue-purple
as soon as you mention Unix/Linux and run for the door.
I also need to mention that most of our web applications are internal
and do not need to handle a heavy load (50 concurrent users at most)
and dont risk to get /.ed

I’ve naturally started with the instant Rails package but founded too
bloated on some aspect and not complete on some other, and since I
wanted a PROD environment setup and not just a DEV machine I wanted to
control the whole chain of tools from A to Z and just install what we
needed to get the job done, and also wanted to make sure I was in
control of the updating process.

Rather than downloading bits and pieces from all over the web in
binary forms to get a complete setup, I’ve tackled the task to build
everything from scratch on Windows.

This is what I’ve build from the latest sources:

Apache (2.2) with mod_ssl (0.9.8a), mod_zlib (1.2.3), mod_fcgi
(2.4.3snap-0404142202) and mod_scgi (1.10)
Ruby (1.8.4) with mysql.so (2.7), ADO.rb, fcgi.so (0.8.6), scgi
(0.4.3), zlib.so, iconv.so and openssl.so

I was able with all this to get Rails 1.0 (installed using RubyGems)
running with Apache and FastCGI, the whole lot seemed very stable and
I was able to hammer it using JMeter with up to 250 concurrent users
without reaching a bottleneck (i.e. response time grows linearly with
the number of users, 255 is the maximum of concurrent connections for
Apache)

Here’s some test data on a Windows 2003 server (3.2Ghz single Xeon
CPU, 1GB of Ram), average of 5000 requests per test. Test request is a
default scaffolding of a table with 100 values in it, paging set to 10
entries per page.

Users=Throughput (Request/Sec)
5=32
10=31
20=28
50=27
100=26
150=25
200=25
250=25

Naturally the more users, the longer it takes to get the request (0.16
seconds with 5 users up to 10 seconds with 250 users). The values
above are calculated as follow:
( 1 second / avg_request_time ) * nb_users

FYI: I’ve tried all different setup with FCGI, SCGI, Mongrel and
WebRick and FCGI turned out to the better but very close to SCGI and
Mongrel. I also found it easier to manage since it starts with Apache,
no need to add services.

Since this took me quite a while to get there, especially with some
extension like FCGI and MySQL which weren’t meant to be build on
Windows that easily, I was wondering if some people out there would be
interested in a binary release of all this so they can setup a
production environment on Win32 using all the latest tools available.

I’ve just tested this with Rails 1.1 and it seems to works fine too, I
need to do some more test but so far so good.

If I get enough people attention, I will put all this in sourceforge
so that others can benefits from my time…

PS: This isn’t a replacement for Instant Rails, it was just a way for
me to control the whole build process from sratch and only build what
I needed to do for the job. The idea was to be able to setup a Windows
Production machine in a minimal effort by just unzipping a couple of
files and configuring one or two config files.

Gael


#2

On 3/29/06, Gael P. removed_email_address@domain.invalid wrote:

I’ve naturally started with the instant Rails package but founded too
bloated on some aspect and not complete on some other, and since I
wanted a PROD environment setup and not just a DEV machine I wanted to
control the whole chain of tools from A to Z and just install what we
needed to get the job done, and also wanted to make sure I was in
control of the updating process.

I’d be interested in hearing what you found bloated, or missing from
InstantRails. The team (including myself) is currently working on a
major
rewrite for the 2.0 release, and we are definitely looking for comments
from
users. Your situation is something that definitely fits an intended use
of
InstantRails, so I look forward to hearing what problems you found. You
can
contact me off-list if you prefer.


#3

Hi Tanner, my post wasn’t meant to tell anything bad about Instant
Rails, just to say that it didn’t fit my need.

When I meant “too bloated”, it’s because it ships with loads of stuff
which I dont need when I want to setup a Rails prod machine, MySQL,
PHP, PHPMyAdmin, Typo, TclTk Extension, Fx Ruby etc…

I aslo found it incomplete because I wanted to use Apache 2.2 with
FastCGI and Instant Rails ships with Apache 1.3 and SCGI, I also
needed the MySQL extension in binary form, other than that it’s pretty
complete.

I think Instant Rails is a great package for someone who wants to give
Rails a try and setup a quick environment and you’ve done a great job
to do so, but when you’re moving in the production environment you
want to start with the minimum and add on top of it to match your
requirements rather than install everything and then delete (or leave)
what you dont need. That’s how I see it anyway…

Maybe you should split your packages into several smaller packages so
that everyone can choose what they need, and keep the full packages
for people who dont really know what they need, I’d suggest the
following breakdown:

-Apache + Ruby + RubyGems
-Rails + Rails Apps + SCGI/FCGI
-Mysql + Ruby SQL Drivers

I would definitly remove from Instant Rails stuff like PHP and
PHPMyAdmin and possibly the Tcl/TK extensions…

You can ship the very nice MySQL front end developed by MySQL AB
instead, this will replace PhpMyAdmin.

Gael


#4

Hi Gael,

I was wondering if some people out there would
be
interested in a binary release of all this so they can setup a
production environment on Win32 using all the latest tools available.

If I get enough people attention, I will put all this in sourceforge
so that others can benefits from my time…

That’s a GRAND welcome idea for me Gael. Thanks for this big building
job.

I also got “green-blue-purple” people but at the Apache evocation.

I’ve put some of working stuff under IIS (w2003). Performance is not
so bad, but I got so strange Ror behavior compared with Webrick or
Apache, I will become “red” and urge “green-blue-purple” to fall back
to Apache.

Also a good way to have a recent Apache+SSL.

Easy to install stuff is welcome as is, and also for writing install
guide for such sysadmins.

Gretz,


#5

On 30/03/06, Mathieu C. removed_email_address@domain.invalid wrote:

That’s a GRAND welcome idea for me Gael. Thanks for this big building job.

I’ve requested a project in Sourceforge so once this is active I’ll
dump my binary on it.

I also got “green-blue-purple” people but at the Apache evocation.
I’ve put some of working stuff under IIS (w2003). Performance is not
so bad, but I got so strange Ror behavior compared with Webrick or
Apache, I will become “red” and urge “green-blue-purple” to fall back
to Apache.

I’m not a big fan on IIS so I wont be heading into that direction,
Apache 2.2 is really stable on Windows now so I dont see why I should
throw myself into IIS, I dont get blue-green faces when I mention
Apache so long as it run on Windows, it’s having a Unix server lying
around in their network that scare them away…

Next step for me is to get Capistrano and SVN running on Windows and
try to integrate them the same way.

Gael


#6

Hi Gael,

I tried to compile some stuff one Windows myself without much luck. I’m
interested in hearing which tools you had to download and install to be
able to compile all this. You probably also compiled Ruby yourself,
where did you find the source of the Ruby version you compiled?

Kind regards,

Nick


#7

Hi Nick, I’ll be posting this on the project page as soon as I get the
approval from the SF team.

Gael


#8

I’d like to see more… [one vote anyway]


#9

Are you talking about something similar to Instant Rails. I wouldn’t
mind
helping out.

Regards


#10

On 30/03/06, Lin J. removed_email_address@domain.invalid wrote:

Are you talking about something similar to Instant Rails. I wouldn’t mind
helping out.

Yes and No, read my previous posts to see the difference…
As soon as I have the SF approval I will inform you if you want to help.

Gael


#11

Hi Nick,

I’m not Gael, but I thought this might help you both. Here’s a link to
a
recent thread on comp.lang.ruby titled “How to compile Ruby on Windows”.

http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/4290dc5d4
6bba9d1

HTH,
Bill

----- Original Message -----
From: “Nick S.” removed_email_address@domain.invalid
To: removed_email_address@domain.invalid
Sent: 2006-03-30 3:40 AM
Subject: [Rails] Re: Production environment for Rails on Win32, anyone
intere


#12

Hi Gael,

Wow. Totally excellent!! And yes, I think your proposal is not only
welcome but important. Any idea when? I’ve personally got a need
coming up
in about a month where I would absolutely use your tool if it was
available.
Please keep us informed.

Best regards,
Bill

Gael P. wrote:

Since this took me quite a while to get there, especially with some
extension like FCGI and MySQL which weren’t meant to be build on
Windows that easily, I was wondering if some people out there would be
interested in a binary release of all this so they can setup a
production environment on Win32 using all the latest tools available.


#13

Gael P. wrote:

On 30/03/06, Mathieu C. removed_email_address@domain.invalid wrote:

That’s a GRAND welcome idea for me Gael. Thanks for this big building job.

I’ve requested a project in Sourceforge so once this is active I’ll
dump my binary on it.

You definitely have my vote too.

Marius


#14

IF it would run with reasonable speed on 2003 server. You’ve got my
vote.
-Larry

On 3/30/06, Marius P. removed_email_address@domain.invalid wrote:


Best Regards,
-Larry
“Work, work, work…there is no satisfactory alternative.”
— E.Taft Benson


#15

Any particular reason not to put this on Rubyforge instead?

_Kevin


#16

Justin F. wrote:

I was able with all this to get Rails 1.0 (installed using RubyGems)

Naturally the more users, the longer it takes to get the request (0.16
it for use with Apache2, and one poster (Rich A.) suggests that the
regards

Justin


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

Justin,

This is good news! Can you please provide us with a download link of

your compiled installer. I’ve been waiting for this for a long time
now… appreciate your work.

thanks!

Erwin Q.


#17

On 31/03/06, Justin F. removed_email_address@domain.invalid wrote:

Have you tried mod_fcgid? Various posts on this list have recommended it
for use with Apache2, and one poster (Rich A.) suggests that the
combination outperforms Lighttpd:

Hi Justin, Yes I initially went down that road and got mod_fcgid
compiled for Apache 2.2 too, however I never succed in getting it to
work with Rails on windows, not sure why.

The thing I didn’t quite understand is that we suppose to use the
mod_fcgid on the apache side but with the fcgi module on the ruby side
(which is compiled against the fastCGI library), am I right in
thinking this too? If anyone got it running under linux I would
appreciate to get told which source/software do you need to get it
working so I can have another go on windows.

Gael


#18

Gael P. wrote:

[…]

without reaching a bottleneck (i.e. response time grows linearly with
10=31
( 1 second / avg_request_time ) * nb_users

FYI: I’ve tried all different setup with FCGI, SCGI, Mongrel and
WebRick and FCGI turned out to the better but very close to SCGI and
Mongrel. I also found it easier to manage since it starts with Apache,
no need to add services.

Have you tried mod_fcgid? Various posts on this list have recommended it
for use with Apache2, and one poster (Rich A.) suggests that the
combination outperforms Lighttpd:

“Also, if the only reason you’re using Lighttpd is because you were led
to believe it is much faster than Apache 2.x, then do your own benchmark
using Apache 2.0.55 MPM-Worker (not MPM-Prefork)–be sure to be sitting
down before reading the results because you’ll be surprised at which is
faster.”

(from the thread “FastCGI vs. Simple CGI”, 3rd March 2006)

regards

Justin


#19

Erwin Q. wrote:

entries per page.

Have you tried mod_fcgid? Various posts on this list have recommended

Justin,

This is good news! Can you please provide us with a download link of
your compiled installer. I’ve been waiting for this for a long time
now… appreciate your work.

Erwin,

the post with the details of the build for Windows was from Gael
Pourriel, who will be putting everything up on Sourceforge in due
course.

regards

Justin


#20

On 31/03/06, Erwin Q. removed_email_address@domain.invalid wrote:

Justin,

This is good news! Can you please provide us with a download link of

your compiled installer. I’ve been waiting for this for a long time
now… appreciate your work.

thanks!

I’m working on it, I’ve just got the approval from sourceforge so I
will upload the installer sometimes this weekend…

Got to do some proper work today…

Gael