You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dilshad Shahid <di...@gmail.com> on 2012/11/05 16:28:19 UTC

Re: How do I get Tomcat 7 to start up faster in Linux CentOS kernel version 2.6.18?

Thank you for all your responses and apologies for my late reply. I
got pulled off of this project last week and was assigned back to java
coding (my preferred state in any case). I have forwarded your replies
to the manager in charge of the project and someone in his team has
been looking into it so I don't have any feedback just yet.

I appreciate all the suggestions from this list and am hopeful they
will help us pinpoint the cause of the slow start up times. We are
using Tomcat 7 to load up our application written in struts. On
production sites, the startup time can be as slow as 20 minutes. When
I was testing on our QA environments, I saw much faster times, around
9 to 40 seconds, so there is a disconnect there. Our QA environment is
not an exact duplicate of our production site so there could be
variables in there to investigate as well.

Regards,
Dilshad


On Wed, Oct 31, 2012 at 12:19 PM, Mark Thomas <ma...@apache.org> wrote:
> On 30/10/2012 21:55, Dilshad Shahid wrote:
>> I am experiencing a problem with slow start up times for Tomcat 7. I
>> have done some testing by tweaking configuration parameters both on
>> Linux CentOS kernel version 2.6.18 and on Windows 7 using this link as
>> my primary guide: http://wiki.apache.org/tomcat/HowTo/FasterStartUp
>> and managed only a modest improvement.
>>
>> The improvements seemed to result when I added
>> metadata-complete="true" attribute to the element of my
>> WEB-INF/web.xml file and when I added the names of almost all the jars
>> we use for our application to the
>> tomcat.util.scan.DefaultJarScanner.jarsToSkip property in
>> conf/catalina.properties file.
>
> Use a servlet 3.0 web.xml, set metadata-complete="true" and include an
> empty absolute ordering section and that will disable all of the Servlet
> 3.0 Jar scanning.
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>



-- 
dilshad.shahid@gmail.com

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


Re: How do I get Tomcat 7 to start up faster in Linux CentOS kernel version 2.6.18?

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

Dilshad,

On 11/5/12 10:28 AM, Dilshad Shahid wrote:
> We are using Tomcat 7 to load up our application written in
> struts. On production sites, the startup time can be as slow as 20
> minutes. When I was testing on our QA environments, I saw much
> faster times, around 9 to 40 seconds, so there is a disconnect
> there. Our QA environment is not an exact duplicate of our
> production site so there could be variables in there to investigate
> as well.

I think we can all agree that 20 minutes is unreasonable. Given that, I
have two suggestions for possible problems and their solutions:

1. Lack of entropy for randomness. If you are using SSL connectors or
your application uses sessions that are configured to use a SecureRandom
object for session id generation (which might actually be the default
these days), then your Tomcat process will need sufficient entropy to
launch. This is easily identified via a thread dump.

Solutions: use /dev/urandom (not recommended) or something like an
Entropy Key (http://www.entropykey.co.uk/).

2. Long DNS lookup timeouts coupled with huge numbers of URL lookups.
This can happen if you have lots of XML files being parsed and validated
against remote DTDs or Schemas. This is easily identified via a series
of thread dumps (you may be noticing a pattern, here).

Solutions: fix your DNS and/or use something like XML Catalog
(http://en.wikipedia.org/wiki/XML_Catalog).

> I have forwarded your replies to the manager in charge of the
> project and someone in his team has been looking into it so I don't
> have any feedback just yet.

You could save everyone some time and spend 2 minutes investigating
this yourself: it doesn't take long to launch your app a few times and
then get a thread dump while it's stalled.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCYFhsACgkQ9CaO5/Lv0PDcFgCgpWhmixVMac3kN7YwkdDKvyws
NlAAmwbt8R49kF6VcjQTSHwJJYNFPYXz
=wE7G
-----END PGP SIGNATURE-----

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