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

2012-11-05 Thread Dilshad Shahid
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-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




-- 
dilshad.sha...@gmail.com

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



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

2012-11-05 Thread Christopher Schultz
-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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



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

2012-10-31 Thread Ognjen Blagojevic

Dilshad,

On 30.10.2012 22: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.


Tomcat 7 itself starts blazingly fast. Even on 
5-years-old-average-web-server, fresh Tomcat 7 install starts in less 
than 200 ms. What are your numbers?


If your FRESH Tomcat 7 installations starts fast, but Tomcat 7 with your 
webapp(s) deployed drags, then:


(a) Try setting entropy source to /dev/./urandom as the document you 
referenced suggest.


(b) If (a) does not work for you, you will have to find out why is your 
webapp slow. Use a profiler to find that out.


-Ognjen

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



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

2012-10-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dilshad,

On 10/30/12 5:55 PM, Dilshad Shahid wrote:
 I am experiencing a problem with slow start up times for Tomcat 7.

How slow is slow?

If it takes long enough to take a thread dump, please take one or more
thread dumps to see what the JVM is doing. Then we may be able to help
you.

- -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/

iEYEARECAAYFAlCRUVcACgkQ9CaO5/Lv0PDnVACfW+5RnIVWEVcgw/rNgN9HnRTN
sTIAn1SRl4O1oQYvHTG6Sf4YQw4rbVaX
=ucvL
-END PGP SIGNATURE-

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



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

2012-10-31 Thread Mark Thomas
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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



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

2012-10-30 Thread Dilshad Shahid
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.

I've also used this JAVA_OPTS in the setenv.sh file:

JAVA_OPTS=$JAVA_OPTS -server -Xms1536m -Xmx1536m -XX:MaxPermSize=256m
-XX:NewRatio=2 -XX:+UseParallelGC -XX:ParallelGCThreads=2
-Dsun.rmi.dgc.client.gcInterval=180
-Dsun.rmi.dgc.server.gcInterval=180
-Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true 

but actually saw my start up times increase slightly.

Our QA and production environments are on Linux CentOS so I'm hoping
to get more information on improving Tomcat 7 start up times in that
environment.

My primary role is java developer and I don't have much system
administration experience so I appreciate any input. Thank you for
your time and suggestions.

-- 
dilshad.sha...@gmail.com

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