Best Practice JRuby on Rails Deployment
You??™ve now seen a multitude of available ways to deploy your JRuby on Rails application. Most
of these might fit a specific situation fairly well, but among all these I would recommend just
two options. In my mind, these are the best practices. Actually, I would favor the WAR
approach over the Mongrel approach too, but if you??™re unfamiliar with the Java platform, that
might make it hard to handle. In this situation, starting a pack of Mongrels in the same JVM is
a handy substitute to mongrel_cluster.
A Pack of JVM Mongrels
As you saw in the introduction to different approaches, you can use Mongrel in standalone
mode for smaller applications, but where it shines is when you start several and use a real load
balancer in front of them. The problem with this approach on the Java platform is that you
don??™t want to start several JVMs, because they are slow to start and resource heavy. JRuby
sports the option of starting a JRuby server and spinning off new runtimes for each request
that arrives on that port. By using that capability, you can start several Mongrel instances in
the same JVM. The Mongrel service uses a simple protocol, sending strings to the port in question.
For example, you invoke the mongrel_rails command by simply sending the string
mongrel_rails. Every parameter you can give to the standalone version of JRuby can be sent to
the jruby server (except for those that give parameters to the JVM).
Pages:
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309