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