Quantcast

Hardware demands of Grails?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Hardware demands of Grails?

John Moore
I'm trying to get to the bottom of why I'm finding it extremely
difficult to deploy a Grails war on Tomcat. Even after reinstalling
Tomcat and then upgrading Tomcat to 5.5.20 (on Linux), I'm still getting
the situation where Tomcat pretty well hangs as it starts up, in the
process of deploying the Grails war. I generally get to the point where
it says:

Attempting to load [13] core plugins

And then nothing happens, and the CPU utilization sticks at 98% or
thereabouts. Given that the app runs fine in development and under
Tomcat on a different machine, I'm wondering whether I have run into
some problem where Grails is just making more demands of the creaking
old hardware than it can handle. My 'production server' for these
purposes (just little webapps with minuscule traffic) is an old 400Mhz
PIII with 256Mb RAM. Now I know that it will run slowly on such a box,
but is it possible that Grails makes rather more demands than your
average webapp and thus will not run at all?

I tried with Jetty and it seems to work OK, but I'd rather not switch
over to using Jetty as my main app server just yet.

John

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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

John Moore
I should add to this that having installed Grails on the machine in
question, even doing something like 'grails help' is taking a geological
aeon to complete, with very high CPU utilization. Is it likely that
memory starvation is causing this? I.e., if I stuck more RAM in the
machine, would this problem go away and it would run normally, albeit at
400Mhz speed?

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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

Marc Palmer Local
In reply to this post by John Moore

On 9 Mar 2007, at 10:48, John Moore wrote:

> I'm trying to get to the bottom of why I'm finding it extremely  
> difficult to deploy a Grails war on Tomcat. Even after reinstalling  
> Tomcat and then upgrading Tomcat to 5.5.20 (on Linux), I'm still  
> getting the situation where Tomcat pretty well hangs as it starts  
> up, in the process of deploying the Grails war. I generally get to  
> the point where it says:
>
> Attempting to load [13] core plugins
>
> And then nothing happens, and the CPU utilization sticks at 98% or  
> thereabouts. Given that the app runs fine in development and under  
> Tomcat on a different machine, I'm wondering whether I have run  
> into some problem where Grails is just making more demands of the  
> creaking old hardware than it can handle. My 'production server'  
> for these purposes (just little webapps with minuscule traffic) is  
> an old 400Mhz PIII with 256Mb RAM. Now I know that it will run  
> slowly on such a box, but is it possible that Grails makes rather  
> more demands than your average webapp and thus will not run at all?
>
> I tried with Jetty and it seems to work OK, but I'd rather not  
> switch over to using Jetty as my main app server just yet.

I don't see why there should be a difference, unless Groovy  
classloading mechanisms are having a LOT more stuff to go through  
with Tomcat vs Jetty, i.e. presupplied jars + code base. Just a guess.

However your machine is very low spec indeed, and Groovy needs to  
compile a bunch of code at that point in the bootstrapping, and this  
is a slow process even on fast machines. I am guessing it may also be  
at a point when the VM RAM usage is spiking, so with a 256MB RAM  
machine and Tomcat loaded also, it could be swapping out big time.

Our commercial sites are running on the lowest spec machines that our  
ISP provides:

Single AMD Athlon / Single Core 3200+ (2.0 GHz)
Memory: 1 GB DDR

Grails apps under tomcat launches in a few seconds and is ready to  
run :)

Marc


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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

John Moore
Marc Palmer wrote:
>
> However your machine is very low spec indeed,
Can't argue with that! Low speed is acceptable for these webapps,
complete non-working isn't, though. I suspect it's most likely to be
memory related, isn't it?

John

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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

Jon Spalding

John Moore-11 wrote
Can't argue with that! Low speed is acceptable for these webapps,
complete non-working isn't, though. I suspect it's most likely to be
memory related, isn't it?
There's a problem on some Linux installs where it uses excessive memory when building the grails source code. I'm wondering if you've got the same problem but manifesting itself in another way. Can you test on a different platform?

Cheers,
Jon
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

Russel Winder
In reply to this post by Marc Palmer Local
On Fri, 2007-03-09 at 11:15 +0000, Marc Palmer wrote:
> On 9 Mar 2007, at 10:48, John Moore wrote:

> > an old 400Mhz PIII with 256Mb RAM. Now I know that it will run  

> at a point when the VM RAM usage is spiking, so with a 256MB RAM  
> machine and Tomcat loaded also, it could be swapping out big time.

I have not tried running Grails on it yet but I generally find that
running any Java application on my old laptop (that I have to use for
presentation because most projectors cannot handle 1400x1050 laptops)
causes problems.  It is an 850MHz machine with 256MB memory and 500MB
swap space.  Java applications generally start at 200MB these days and
just keep getting bigger. Of course a lot of this is mmap from the disc
so is not actual memory usage but still I end up with 150MB of memory
use and often 300MB of swap used.

I would suggest that memory/swap usage is the main issue and that some
tinkering with Server/Client JVM and the options might help.

--
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             [hidden email]

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

Marc Palmer Local
In reply to this post by John Moore

On 9 Mar 2007, at 11:19, John Moore wrote:

> Marc Palmer wrote:
>>
>> However your machine is very low spec indeed,
> Can't argue with that! Low speed is acceptable for these webapps,  
> complete non-working isn't, though. I suspect it's most likely to  
> be memory related, isn't it?

Probably yes... the app would run ok once you get past this bit I'm  
pretty sure.

Have you run "top" or similar in another terminal while tomcat loads  
up, to monitor RAM usage?

On our Copella site with 1GB RAM, I can see the java VM is using 13%  
of RAM while running. I can't restart it to see if it peaks higher  
than that during load time... 13% --> about 130MB for tomcat + the  
grails app. not bad :)

However this means memory may not be your problem, it could be a  
permgen size issue as someone else mentioned.

Marc


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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

John Moore
Marc Palmer wrote:
>
> Probably yes... the app would run ok once you get past this bit I'm
> pretty sure.
You're quite right, the app runs fine once we get past the awkward
startup bit. Performance is perfectly acceptable.
>
> Have you run "top" or similar in another terminal while tomcat loads
> up, to monitor RAM usage?
I have, but I haven't been skillful enough to interpret the information
that usefully. While running, if I do a 'ps aux | grep java' it reveals
around 66% memory usage and 38% CPU usage. I'll check it during startup
next time I have to restart (it's currently running and I don't want to
disturb it!).

The answer is obviously not to try and run modern Java webapps on such
minimal hardware. Nonetheless I was wondering why the startup made such
demands. It seems to be at the point when it's loading the core Grails
plugins. Why should this require such a large amount of memory?


John

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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

Marc Palmer Local

On 9 Mar 2007, at 11:48, John Moore wrote:

> Marc Palmer wrote:
>>
>> Probably yes... the app would run ok once you get past this bit  
>> I'm pretty sure.
> You're quite right, the app runs fine once we get past the awkward  
> startup bit. Performance is perfectly acceptable.
>>
>> Have you run "top" or similar in another terminal while tomcat  
>> loads up, to monitor RAM usage?
> I have, but I haven't been skillful enough to interpret the  
> information that usefully. While running, if I do a 'ps aux | grep  
> java' it reveals around 66% memory usage and 38% CPU usage. I'll  
> check it during startup next time I have to restart (it's currently  
> running and I don't want to disturb it!).
>
> The answer is obviously not to try and run modern Java webapps on  
> such minimal hardware. Nonetheless I was wondering why the startup  
> made such demands. It seems to be at the point when it's loading  
> the core Grails plugins. Why should this require such a large  
> amount of memory?

I'm not sure but there's all the resource loading and groovy  
compilation to do, which will certainly be part of it. Plugins are  
written in groovy and need to be compiled. They do a lot of metaclass  
stuff, which might be an issue but I can't see why.

Marc

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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

kate rhodes
In reply to this post by John Moore


On 3/9/07, John Moore <[hidden email]> wrote:
 My 'production server' for these
purposes (just little webapps with minuscule traffic) is an old 400Mhz
PIII with 256Mb RAM. Now I know that it will run slowly on such a box,
but is it possible that Grails makes rather more demands than your
average webapp and thus will not run at all?


I'd recommend booting up jconsole and  taking a look at exactly what's going on.

In our tests we find that we regularly have over 6000 classes loaded when running Grails under Tomcat. That's going to be pretty hard for a box that old to load up.

Basically though there seems to be a conceptual disconnect between your development practices and your deployment practices. If you're deploying to something with minimal specs you need to develop in a really slim minimal framework. Instead you're developing in a framework that goes out of it's way to wrap up lots of dynamic work for you. You need to either upgrade your hardware or get a much much much more minimal framework and probably forget about using an ORM tool.

--
- kate = masukomi
http://weblog.masukomi.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

John Moore
kate rhodes wrote:

>  
>
> Basically though there seems to be a conceptual disconnect between
> your development practices and your deployment practices. If you're
> deploying to something with minimal specs you need to develop in a
> really slim minimal framework. Instead you're developing in a
> framework that goes out of it's way to wrap up lots of dynamic work
> for you. You need to either upgrade your hardware or get a much much
> much more minimal framework and probably forget about using an ORM tool.
>
You're right, and I wouldn't be attempting to deploy a Grails app on
such hardware for real business purposes. The one I have is a 'toy' app,
done as a Grails learning exercise. I hope I didn't come across as
suggesting that Grails is at fault if it doesn't run on such
underpowered hardware. The point is, though, that it does run fine once
it gets past startup, so I was just curious as to what was happening at
startup which made such disproportionate demands on the hardware. Even
on a rather more substantial box (Athlon 2400, 768Mb RAM) the CPU runs
at nearly 100% for quite a while as it starts up.

John

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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Hardware demands of Grails?

kate rhodes


On 3/10/07, John Moore <[hidden email]> wrote:

[snip]

so I was just curious as to what was happening at
startup which made such disproportionate demands on the hardware. Even
on a rather more substantial box (Athlon 2400, 768Mb RAM) the CPU runs
at nearly 100% for quite a while as it starts up.


We went in with jconsole and turned on verbose output to explore that (although just dropping the log4j level may have the same result) ... do that and you'll start to see why it's as slow as it is. Groovy is doing A LOT of work under the cover wrapping up all those closures and inserting methods and and and...

But you're right. There is a real hit at startup and at the first load of every page. I believe we're moving, once again, into a new level of performance requirements when it comes to web frameworks. The price for making everything so easy for us is a requirement for better hardware, but this isn't just a Grails thing (although I think it's a bit more noticeable in Grails than most other current gen frameworks).



--
- kate = masukomi
http://weblog.masukomi.org/
Loading...