You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gavan Hood <oo...@yahoo.com> on 2008/01/16 01:24:45 UTC

How can I speed up and reduce load of initialization

I am running embedded debian linux on an xscale processor, I am running tomcat 5.5 on java 1.4.2 as thats all that is supported. Tomcat runs fine as expected.
   
  My problem is the initialization. 
  When I start tomcat it takes about two minutes to complete initialization and pegs my little processor at times, often it keeps it around 80% untilized... This is not good for the rest of the system as it has work to do.
   
  I have used the minimalist server config file and only need to run http / servlets and file upload to clients.  Consequently apart from some simple virtual directory settings and mappings for urls everything is out of the box tomcat.
   
  Thanks for you help..
   

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: How can I speed up and reduce load of initialization

Posted by Len Popp <le...@gmail.com>.
On Jan 16, 2008 4:21 AM, Peter Crowther <Pe...@melandra.com> wrote:
> > From: Gavan Hood [mailto:oohogwash@yahoo.com]
> >   My problem is the initialization.
> >   When I start tomcat it takes about two minutes to complete
> > initialization and pegs my little processor at times, often
> > it keeps it around 80% untilized...
>
> Yeah, that's not good in an embedded device!

Well, that depends on the device. If it's embedded in the Space
Shuttle, countdown takes 2 days so they can probably spare 2 minutes
to boot Tomcat. :-)

Seriously, how big is the Java heap and how much memory does your app
use? It could be spending a lot of time in garbage collection.  If you
can test the app on a "real" computer, try different heap sizes to see
if that makes a difference.
-- 
Len

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How can I speed up and reduce load of initialization

Posted by Len Popp <le...@gmail.com>.
How big is your Java heap? And how much of your 64MB is used by other
(non-Tomcat) processes? If Tomcat is causing a lot of virtual memory
swapping, it *may* help to decrease the size of the heap so it fits
into main memory. But that may make the heap too small, so garbage
collection becomes a problem or Tomcat runs out of memory entirely. It
depends on how much free memory you have and how much Tomcat + your
app needs.
-- 
Len

On Jan 17, 2008 5:12 AM, Gavan Hood <oo...@yahoo.com> wrote:
> I agree it will take time, i have 64MB of ram. I guess dotnets ability to compile on install would be useful here... i don't think there is an equivalent for java especially 1.4.2 that I am running. Has there been any progress on that in recent times ? If there is that would be great...
>
>   I notice that on running it is causing a lot of swapping to occur, my swapping process is using a lot of time.
>
>   I really want to get this to work as functionaly it is great, is there any way to trim back what is included / compiled / swapped beyond the server config file that I am using.
>
>
>
>
>
> Jonadan <jo...@yahoo.com> wrote:
>
> How big is your main memory? Compiling (both source & JIT) consumes lots of
> memory. If your main memory is small, it can take a lot of initialization
> time!
>
>
> Gavan Hood wrote:
> >
> > My web app is very simple, two servlets already installed so no war file.
> > Once it finally gets going it is very responsive, the initialization
> > just takes forever...
> >
>
> --
> View this message in context: http://www.nabble.com/How-can-I-speed-up-and-reduce-load-of-initialization-tp14857523p14914576.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>
> ---------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How can I speed up and reduce load of initialization

Posted by Jonadan <jo...@yahoo.com>.
Normally compilers are the memory hogs! A few things you can do is that;

1. If you use JSP, convert to servlets to avoid initialization phase
compiling.
2. If your JDk is JIT (Just in time) compiler enable, disable it. You may
have a bit slow execution. But should have satisfactory speed.
3. Increase memory size! I use 512MB and dual CPU. Still initialization
taking significant time!



Gavan Hood wrote:
> 
> I agree it will take time, i have 64MB of ram. ...  I notice that on
> running it is causing a lot of swapping to occur, my swapping process is
> using a lot of time.
> 

-- 
View this message in context: http://www.nabble.com/How-can-I-speed-up-and-reduce-load-of-initialization-tp14857523p14934889.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How can I speed up and reduce load of initialization

Posted by Gavan Hood <oo...@yahoo.com>.
I agree it will take time, i have 64MB of ram. I guess dotnets ability to compile on install would be useful here... i don't think there is an equivalent for java especially 1.4.2 that I am running. Has there been any progress on that in recent times ? If there is that would be great... 
   
  I notice that on running it is causing a lot of swapping to occur, my swapping process is using a lot of time.
   
  I really want to get this to work as functionaly it is great, is there any way to trim back what is included / compiled / swapped beyond the server config file that I am using.
   
   
  

Jonadan <jo...@yahoo.com> wrote:
  
How big is your main memory? Compiling (both source & JIT) consumes lots of
memory. If your main memory is small, it can take a lot of initialization
time!


Gavan Hood wrote:
> 
> My web app is very simple, two servlets already installed so no war file. 
> Once it finally gets going it is very responsive, the initialization
> just takes forever...
> 

-- 
View this message in context: http://www.nabble.com/How-can-I-speed-up-and-reduce-load-of-initialization-tp14857523p14914576.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

RE: How can I speed up and reduce load of initialization

Posted by Jonadan <jo...@yahoo.com>.
How big is your main memory? Compiling (both source & JIT) consumes lots of
memory. If your main memory is small, it can take a lot of initialization
time!


Gavan Hood wrote:
> 
> My web app is very simple, two servlets already installed so no war file. 
>   Once it finally gets going it is very responsive, the initialization
> just takes forever...
>  

-- 
View this message in context: http://www.nabble.com/How-can-I-speed-up-and-reduce-load-of-initialization-tp14857523p14914576.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How can I speed up and reduce load of initialization

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gavin,

Er, forget my ravings about SSL initialization. I forgot that you said
you were seeing very high CPU utilization. Waiting for randomness would
not behave that way.

- -chris

Christopher Schultz wrote:
| Gavan,
|
| Gavan Hood wrote:
| | My web app is very simple, two servlets already installed so no war
| | file. Once it finally gets going it is very responsive, the
| | initialization just takes forever...
|
| A few quick questions:
|
| Do your servlets perform any of their own initialization? I'm guessing
| that you would have looked here, first, but I figured I'd just
| double-check.
|
| Are you using an SSL connector? If so, the server may require a lot of
| random data from your random device, which might not be delivering it
| fast enough. You might be able to configure the JVM to use a different
| source of randomness.
|
| Are you running with APR? This also has to do with the entropy
| requirements of SSL, since you can configure APR's source of randomness
| separately from the JVM.
|
| -chris
|
| |
| | I have some war files coming, but I figure if I cannt get this basic
| | initialization to work theres not much point.
| |
| | Is tomcat supposed to work in embedded environments like this, is it
| | something others are trying / have working , Is it part of the
| | roadmap ?
| |
| |
| |
| | Peter Crowther <Pe...@melandra.com> wrote:
| |> From: Gavan Hood [mailto:oohogwash@yahoo.com] My problem is the
| |> initialization. When I start tomcat it takes about two minutes to
| |> complete initialization and pegs my little processor at times,
| |> often it keeps it around 80% untilized...
| |
| | Yeah, that's not good in an embedded device!
| |
| | 2 minutes with or without your application deployed? i.e. how much of
| | that time is Tomcat startup, and how much is Tomcat deploying your
| | webapp / your webapp startup?
| |
| | How is your application packaged? Are you unpacking it from a WAR, or
| | is it already unpacked?
| |
| | - Peter
| |
| | ---------------------------------------------------------------------
| |  To start a new topic, e-mail: users@tomcat.apache.org To
| | unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For
| | additional commands, e-mail: users-help@tomcat.apache.org
| |
| |
| |
| |
| | --------------------------------- Be a better friend, newshound, and
| | know-it-all with Yahoo! Mobile.  Try it now.

- ---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkePdf0ACgkQ9CaO5/Lv0PAo9QCeL7zvzRgY7jmaQD1VVef5N1oR
WXYAnRhEsrQcrru9EQVaMiycdd7l1VZI
=G6Mm
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How can I speed up and reduce load of initialization

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gavan,

Gavan Hood wrote:
| My web app is very simple, two servlets already installed so no war
| file. Once it finally gets going it is very responsive, the
| initialization just takes forever...

A few quick questions:

Do your servlets perform any of their own initialization? I'm guessing
that you would have looked here, first, but I figured I'd just double-check.

Are you using an SSL connector? If so, the server may require a lot of
random data from your random device, which might not be delivering it
fast enough. You might be able to configure the JVM to use a different
source of randomness.

Are you running with APR? This also has to do with the entropy
requirements of SSL, since you can configure APR's source of randomness
separately from the JVM.

- -chris

|
| I have some war files coming, but I figure if I cannt get this basic
| initialization to work theres not much point.
|
| Is tomcat supposed to work in embedded environments like this, is it
| something others are trying / have working , Is it part of the
| roadmap ?
|
|
|
| Peter Crowther <Pe...@melandra.com> wrote:
|> From: Gavan Hood [mailto:oohogwash@yahoo.com] My problem is the
|> initialization. When I start tomcat it takes about two minutes to
|> complete initialization and pegs my little processor at times,
|> often it keeps it around 80% untilized...
|
| Yeah, that's not good in an embedded device!
|
| 2 minutes with or without your application deployed? i.e. how much of
| that time is Tomcat startup, and how much is Tomcat deploying your
| webapp / your webapp startup?
|
| How is your application packaged? Are you unpacking it from a WAR, or
| is it already unpacked?
|
| - Peter
|
| ---------------------------------------------------------------------
|  To start a new topic, e-mail: users@tomcat.apache.org To
| unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For
| additional commands, e-mail: users-help@tomcat.apache.org
|
|
|
|
| --------------------------------- Be a better friend, newshound, and
| know-it-all with Yahoo! Mobile.  Try it now.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkePdQcACgkQ9CaO5/Lv0PDeHQCdEYzVWXyLxVbW5A6nIWGXhqXj
8MIAniN4hMeSrLHhxe9wEa1KWt3EFjjV
=R5uK
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How can I speed up and reduce load of initialization

Posted by Gavan Hood <oo...@yahoo.com>.
My web app is very simple, two servlets already installed so no war file. 
  Once it finally gets going it is very responsive, the initialization just takes forever...
   
  I have some war files coming, but I figure if I cannt get this basic initialization to work theres not much point.
   
  Is tomcat supposed to work in embedded environments like this, is it something others are trying / have working , Is it part of the roadmap ?
   
  

Peter Crowther <Pe...@melandra.com> wrote:
  > From: Gavan Hood [mailto:oohogwash@yahoo.com]
> My problem is the initialization.
> When I start tomcat it takes about two minutes to complete
> initialization and pegs my little processor at times, often
> it keeps it around 80% untilized...

Yeah, that's not good in an embedded device!

2 minutes with or without your application deployed? i.e. how much of that time is Tomcat startup, and how much is Tomcat deploying your webapp / your webapp startup?

How is your application packaged? Are you unpacking it from a WAR, or is it already unpacked?

- Peter

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

RE: How can I speed up and reduce load of initialization

Posted by Peter Crowther <Pe...@melandra.com>.
> From: Gavan Hood [mailto:oohogwash@yahoo.com]
>   My problem is the initialization.
>   When I start tomcat it takes about two minutes to complete
> initialization and pegs my little processor at times, often
> it keeps it around 80% untilized...

Yeah, that's not good in an embedded device!

2 minutes with or without your application deployed?  i.e. how much of that time is Tomcat startup, and how much is Tomcat deploying your webapp / your webapp startup?

How is your application packaged?  Are you unpacking it from a WAR, or is it already unpacked?

                - Peter

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org