Configure JRuby runtime pool on GlassFish v3 server JRuby runtime pool can be configured at the container level (the settings will apply to all the deployed Ruby applications) or per deployment. Per deployment seeting will override the container settings. JRuby container level runtime pool setting
asadmin configure-jruby-container --jruby-runtime=2 --jruby-runtime-min=1 --jruby-runtime-max=3
The above command will create JRuby runtime pool for each deployed application with initial number of runtimes 2, the hard minimum of the pool will be 1 and max will be 3. Deploy time runtime pool configuration There are three deploy time properties that can be used while deploying your Ruby on Rails or Merb application on GlassFish v3 Server.
asadmin deploy --property jruby.runtime=3:jruby.runtime.min=2:jruby.runtime.max=4 myRailsApp/
The above deployment command will deploy myRailsApp application directory with 3 JRuby runtimes, the hard minimum of the pool will be 2 and that hard maximum will be 4. Here are the explanations of these properties
- jruby.runtime=X will set the initial number of jruby runtimes that Glassfish starts with. It defaults to one. It also represents the lowest value that Glassfish will use for the maximum and the highest value that Glassfish will accept for the minimum. As of this time, setting this number too high may cause undesirable behavior.
- jruby.runtime.max=X will set the maximum number of jruby runtimes that may be available in the pool. It defaults to two. The pool will not neccessarily be this large. Values that are too high may result in OutOfMemory errors, either in the heap or in the PermGen.
- jruby.runtime.min=X will set the minimum number of jruby runtimes that will be available in the pool. It defaults to one. The pool will always be at least this large, but may well be larger than this.
As mentioned above, use asadmin deploy --property name=value:name=value* to specify the above properties. Note: At present creation of JRuby runtime is an expensive and resource consuming operation so care should be taken. In production its recommended to set all min, max and initial values to be the same so that the runtime pool does not auto grow or shrinks.
It would be nice if you would mention how to overcome the fact that the configure-jruby-container command does not exist. When I attempt to execute asadmin configure-jruby-container (as you describe), I get a message saying the command is not valid. There are absolutely no references on the internet to this problem. I'm about ready to give up.
 Posted by mkelly1495 at Nov 23, 2011 09:54
|
|