Configuring JRuby runtime pool

While jruby is able to take advantage of Java's native threading, if you are running Rails ver < 2.2 which is not thread-safe, and thus cannot benefit from it. Glassfish provides a jruby runtime pool to allow servicing of multiple concurrent requests. Each runtime runs a single instance of Rails, and requests are handed off to whichever one happens to be available at the time of the request.

The dynamic pool will maintain itself with the minimum number of runtimes possible to allow consistent, fast runtime access for the requesting application between its min and max. It also may take an initial number of runtimes, but that value is not used after pool creation in any way.

Configure JRuby runtime pool on GlassFish v2

GlassFish v3 Prelude

GlassFish v3

GlassFish gem