Memory Requirements for Glassfish vs. Tomcat vs. JMongrel vs. whatever

Hey Folks,

I’m currently working on getting my JRuby on Rails app live. I’ve got a
VPS
host with 512 MB memory. I assumed this would be enough (especially
since
this is not going to be a high-traffic website–it’s something I’m just
building myself for fun and as a little research project). Originally I
tried using Tomcat, but was getting some weird exceptions when system
commands were run via the backtick (`). It was suggested to me to try
Glassfish so I’ve installed that, and gotten it working. I saw this
post
[1] from Albert today discussing the memory needed for a JRuby on Rails
app
running on Glassfish–and he’s saying 2 GB isn’t enough. Now I don’t
know
if that much is needed because of a high volume of web site traffic or
other
specific requirements of his app, but there’s no way I’m going to
upgrade to
a 2 GB VPS package.

So this got me thinking: what are the memory requirements of the various
deployment options? I’m thinking that Tomcat has a much lighter memory
footprint than Glassfish. What about other options? Should I consider
JMongrel?

Keep in mind that of the 512 MB, I need to reserve a sizeable chunk (128
MB+) to run Lilypond [2] since my web app uses it to generate sheet
music.
Plus I need enough to run Apache, MySQL, etc.

My hosting provider allows me to add 64 MB of memory for an extra
$4/month
up to 768 MB if need be, but I’d like to fit in the 512 MB if possible.

Thanks,
Myron

[1]
http://groups.google.com/group/jruby-users/browse_thread/thread/3743800e1cfb77c3
[2] http://lilypond.org/web/

On Fri, Aug 29, 2008 at 11:56 AM, Myron M.
[email protected] wrote:

specific requirements of his app, but there’s no way I’m going to upgrade to

My hosting provider allows me to add 64 MB of memory for an extra $4/month
up to 768 MB if need be, but I’d like to fit in the 512 MB if possible.

I have a 1GB VPS, and I’m running my blog just fine on Glassfish. It’s
currently using 745MB RSS though the VM’s max heap is set to 512MB
(which I don’t quite understand).

Glassfish defaults to -Xmx512m, though I think you should still be
able to run it with -Xmx256m or -Xmx384m if you don’t expect a lot of
traffic. Give 256m a try and see if the app is useable.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I can’t get it to run at all with 256m. When I try to start it up
(using
“asadmin start-domain domain1”) it gives me this error message:

Error occurred during initialization of VM
Could not reserve enough space for object heap

This is very strange to me, because according to the linux free command,
only 60 MB are being used, and 460 MB are free. I can start it up with
192
MB heap if I first stop apache and mysql (I get the same error if they
are
running). The highest heap setting that works while apache and mysql
are
running is 128m.

This makes me wonder if maybe I’m configuring my jvm settings
incorrectly.
I’ve just been editing my domain.xml file, and editing the
element beginning with “-Xmx”.

Any suggestions?

And I’d still be interested to hear about minimum Tomcat and JMongrel
memory
requirements for a JRuby on Rails app, if anyone knows.

It could be that it’s setting a minimum memory heap to something larger
than you expect. You might try setting -Xms64M to make sure it’s not
allocating more than that right away.

Myron M. wrote:

mysql are running is 128m.
On Fri, Aug 29, 2008 at 11:02 AM, Nick S. <[email protected]
> building myself for fun and as a little research project).
> if that much is needed because of a high volume of web site
consider
> up to 768 MB if need be, but I’d like to fit in the 512 MB if
/Nick

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs