Optimizing runtimes in Rails

Hello,
Is there a recommended way to determine how many JRuby runtimes to
configure for a tomcat app running rails under JRuby? I know that the
equivalent of multiple mongrels with JRuby under Tomcat is the JRuby
runtimes (min/max) but trying to figure out the best way to
monitor/benchmark this number. Anything outside of looking at an SNMP
graph
of concurrent connections or request/sec would be helpful.

I have a Redhat ES 5 box running Tomcat 5.5 with 8Gb of RAM and 4 CPUs
if
that helps

Thx
Adam

AD wrote:

Hello,

Is there a recommended way to determine how many JRuby runtimes to
configure for a tomcat app running rails under JRuby? I know that the
equivalent of multiple mongrels with JRuby under Tomcat is the JRuby
runtimes (min/max) but trying to figure out the best way to
monitor/benchmark this number. Anything outside of looking at an SNMP
graph of concurrent connections or request/sec would be helpful.

This is what we did on a recently-deployed project. I don’t know if it’s
the generally recommended way to do it, though.

We figured out how big we could make our heap, how big our app might
get, how big our app would normally get, and did the math.

We had 8GB RAM, but were using a 32-bit JDK, so max heap was ~ 2GB. We
figured 250 MB - 1 GB was as large as a runtime was likely to get (it
would have been reduced if we had gotten rails to stream data to the
servlet response stream via “render :data => Proc.new { }”), and we
ended up with 6 runtimes as max.

I have a Redhat ES 5 box running Tomcat 5.5 with 8Gb of RAM and 4 CPUs
if that helps

Thx
Adam


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

so 256 Mb - 1Gb per runtime is a good estimation ? Thats higher than i
thought. I am on 64 bit Linux with 8Gb or ram so was gonna dedicate 6Gb
of
RAM to the heap and use somewhere between 8-16 runtimes after some
discussion here. based on your estimates it seems like 6 runtimes is
as
big as I would want to go without upping the RAM.
Adam

Can I ask you guys what kind of JVM memory settings you guys use for
those kind of setups?

On Tue, Aug 5, 2008 at 1:14 AM, AD [email protected] wrote:

the generally recommended way to do it, though.

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

i had to increase Permgen to 128Mb , and on a 4Gb box i have a max heap
of
2048M (dev box) and on the prod box with 8Gb RAM I plan on setting max
heap
to 6GB

Adam

On Tue, Aug 5, 2008 at 3:39 AM, Albert R.

Albert R. wrote:

Can I ask you guys what kind of JVM memory settings you guys use for
those kind of setups?

We’re using WebSphere’s defaults, except for heap size. It looks like
these are the JVM memory-related args:
-Xmx2048m
-Xms50m
-Xscmx50M

We’re using the default permgen size, and haven’t had any issues (so
far; we’re about 2 months into our live deployment).

On Tue, Aug 5, 2008 at 1:14 AM, AD [email protected] wrote:

so 256 Mb - 1Gb per runtime is a good estimation ? Thats higher than i

For our application, 250 MB - 1 GB was appropriate. A warmed up jruby
with rails in it seemed to sit around 50 - 100 MB, IIRC. The 1 GB case
was if a PHB clicked the “download all locations” link, which would load
about 40,000 active record objects and generate a CSV with about 40,000
rows x 15 columns. (Like I said, if we had gotten response streaming to
work, this memory requirement would have gone down dramatically.) We had
a daily job that used a pretty variable amount of memory, depending on
the amount of traffic the site had received in the previous 24-hours.
Worst-case estimates for that were around 1 GB as well.

Also, the application was written by us for another company, and is
being hosted by a third company on a different continent, so stability
(i.e. avoiding OutOfMemoryExceptions) was an /extremely/ important
factor in sizing the application. If we were hosting it, we probably
would have used 8 runtimes rather than 6.

thought. I am on 64 bit Linux with 8Gb or ram so was gonna dedicate 6Gb of

We’re running on 64-bit linux with 8GB ram as well, but we’re stuck
using WebSphere with a 32-bit JVM, so we can only use about 2 GB for the
heap.

RAM to the heap and use somewhere between 8-16 runtimes after some
discussion here. based on your estimates it seems like 6 runtimes is as
big as I would want to go without upping the RAM.

It depends on your application. If you’re not ever trying to load your
entire database into memory, 8 - 16 is probably appropriate.


Matt


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

is there a way through Jconsole to monitor how much memory each runtime
is
using ?

do you know where in Jconsole this would be ?

Yes, at least if you’re using sun’s JVM. I recall that it was pretty
easy to do. I have tried getting it to work with WebSphere and IBM’s
JVM, and not had as much success.

AD wrote:

which would load about 40,000 active record objects and generate a
important factor in sizing the application. If we were hosting it,

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email