IÂ¹ve been running a bunch of performance tests comparing JRails deployed
JBoss to Spring (a Java MVC framework), and the results IÂ¹ve gotten
good for JRuby. IÂ¹d really like to be able to start moving towards
but I there are a few deal-breakers IÂ¹d like to figure out. First, let
describe my environment:
Mac OS X Leopard
JBoss 3.2.7 / Jetty 4.2.24
- 3G RAM and 256M PermGen space
- -server -Djruby.compilation.mode=FORCE
- war configured to start 10 JRails runtimes
My webapp is very simple. ItÂ¹s a three page drilldown that uses a
Java DB class (shared between the JRails and Spring implementations) to
call stored procs in an Oracle DB.
IÂ¹m using Grinder to make repeated requests with increasing numbers of
threads, from 1 to 50 in increments of 5. At each thread count, IÂ¹m
about 150 requests (50 to each type of page).
What I see from the client side is many responses returning in a
amount of time (the average request time under heavy load is around
seconds, but many requests return in 100-200 milliseconds), but many
seemingly blocking for a long time (the standard deviation on request
is as high as 30 seconds).
On the server side, Rails reports some requests being processed for as
as a few seconds (as many as 5 or 6), but never for as many as 30. The
is also garbage collecting like crazy from the moment JRuby starts. I
suspect that the long delays are a result of threads being blocked
for garbage collecting, but IÂ¹m not positive. I eliminated the DB code
potential cause by running the same suite of tests on a simple Â³Hello
app, and got approximately the same performance results (Spring shows
a 5-fold increase in throughput).
My assumption is that the constant overhead of garbage collection is the
bottleneck, but IÂ¹m by no means convinced. IÂ¹ve read that IBM and
ThoughtWorks have deployed JRails apps in similar environments, so my
results are confusing and frustrating.
Here are my questions:
- Is there a way to tame the garbage collection? I suspect that
are being created and deleted with each request rather than being
- Can Rails be fully compiled to Java? Can a Rails app? It seems like
thatÂ¹s a goal of jrubyc, but is it possible with the current version?
- Am I missing some bit of configuration in the war deployment that
tell JRuby to be more conservative with object creation?
Sorry for the long email. Thanks for taking the time to read!