It appears that there is some kind of built-in thread pooling that you
get if you deploy a Rails app. into a JEE container using Goldspike or
Warbler and you have a couple of parameters to set the upper and lower
bounds of that thread pool.
If you deploy a Merb app. using Warbler, however, it appears that there
is no such built-in thread pool.
However, I found this on the JRuby wiki:
"Ruby scripts frequently take advantage of the C impl’s lightweight
(green) threading by spinning up hundreds or thousands of threads during
a run. Under JRuby, this can often mean that hundreds or thousands of
native threads are spun up and thrown away, which is inefficient in many
cases and on many platforms. As an alternative to straight-up 1:1
threading in JRuby, you may also enable thread pooling. When pooling is
enabled, JRuby starts up only as many threads as are needed for
concurrent tasks. Repeatedly launching short-lived Ruby threads then
will reuse native threads. This can improve performance in many cases,
especially when libraries like /timeout/ are employed that spin up a
To enable pooling, set the Java system property “jruby.thread.pooling”
jruby -J-Djruby.thread.pooling=true myscript.rb
which would appear to give me some kind of thread pooling ability in the
Is this worth trying to set up for my Merb Web app.? Will it help?
If it will help, then how would I pass the -J-Djruby.thread.pooling=true
flag into the jruby process running inside of my Web app. though? I’m
not sure I understand where the JRuby process is invoked in that case.
To unsubscribe from this list, please visit: