You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "gchris@gmx.de" <gc...@gmx.de> on 2014/12/15 14:33:41 UTC

Startup of tomcat 8 takes twice as long as startup of tomcat 6


Hi,

we used to deploy our webapp in a tomcat 6.0.35 and want to upgrade to tomcat 8.0.9.
During testing we discovered, that the startup process of tomcat 8 is twice as long as the startup process of tomcat 6 (with the same single webapp deployed)

My test system is as follows:
Windows 7, JRE 1.7.0, Tomcat 6.0.35/8.0.9

Inspection of the log files revealed, that the additional time is used for class loading:

Log of tomcat 6:
...
Nov 28, 2014 5:07:59 PM org.apache.tomcat.util.digester.Digester endDocument
Fein: endDocument()
Nov 28, 2014 5:07:59 PM org.apache.catalina.loader.WebappClassLoader loadClass
Fein: loadClass(org.springframework.web.util.Log4jConfigListener, false)
...
Fein: Parent class loader is: WebappClassLoader
context:
delegate: false
repositories:
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@189ff97
Nov 28, 2014 5:08:08 PM org.apache.jasper.compiler.JspRuntimeContext initClassPath
Fein: Compilation classpath initialized: ...
Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
Fein: Scratch dir for the JSP engine is: ...
Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
Fein: IMPORTANT: Do not modify the generated servlets
Nov 28, 2014 5:08:08 PM org.apache.catalina.core.StandardContext start
Fein: Starting completed
...
Nov 28, 2014 5:08:09 PM org.apache.catalina.startup.Catalina start
Information: Server startup in 10861 ms

Log of tomcat 8:
...
28-Nov-2014 16:09:09.128 FINER [localhost-startStop-1] org.apache.tomcat.util.scan.StandardJarScanner.scan Not scanning JAR [file:/C:/Program%20Files/tomcat%208/tolina_webserver-3.0.0-SNAPSHOT-20141103-130423/bin/tomcat-juli.jar] from classpath
28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoader.loadClass loadClass(org.apache.jasper.servlet.JasperInitializer, false)
28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoader.loadClass Delegating to parent classloader1 java.net.URLClassLoader@1c47dd5
28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoader.loadClass Loading class from parent
...
28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1] org.apache.jasper.compiler.JspRuntimeContext.<init> Parent class loader is: WebappClassLoader
context: /manager
delegate: false
----------> Parent Classloader:
java.net.URLClassLoader@1c47dd5
28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1] org.apache.jasper.compiler.JspRuntimeContext.initClassPath Compilation classpath initialized: ...
28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1] org.apache.jasper.servlet.JspServlet.init Scratch dir for the JSP engine is: ...
28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1] org.apache.jasper.servlet.JspServlet.init IMPORTANT: Do not modify the generated servlets
28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1] org.apache.tomcat.util.modeler.Registry.registerComponent Managed= Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1] org.apache.tomcat.util.modeler.BaseModelMBean.preRegister preRegister org.apache.jasper.servlet.JspServlet@1067d4c Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Starting completed
28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1] org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]] to [STARTING]
28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1] org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]] to [STARTED]
...
28-Nov-2014 16:09:28.377 FINE [main] org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for [StandardServer[8005]] to [STARTED]
28-Nov-2014 16:09:28.377 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 21443 ms

Searching the web and the mail archives resulted in quite a few hints how to improve performance generally.
I followed the instructions on wiki.apache.org/tomcat/HowTo/FasterStartUp, in particular:
- Disabling JAR scanning (metadata-complete="true", <absolute-ordering/> in the <web-app>.
- in catalina.properties:
tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\*.jar
org.apache.catalina.startup.ContextConfig.jarsToSkip=\*.jar
org.apache.catalina.startup.TldConfig.jarsToSkip=\*.jar
- Removing the web socket API and implementation JARs
- Changing the entropy source (-Djava.security.egd=file:/dev/./urandom)

These changes were in effect when the above logs were written. While these changes resulted in a faster startup process (on both tomcats), I found no clue about why tomcat 8 takes longer in general to complete server startup.

I compared the jars loaded in both cases and tried to remove the two additional jars in tomcat 8.
I compared the configurations of both tomcats and aligned the registered listeners and disabled XMLValidation and XMLNameSpaceAware in server.xml. I reduced the bigger MIME-Mapping in web.xml of tomcat 8
to the MIME-Mapping of tomcat 6.
I compared the number of classes and ressources loaded and the number of ClassNotFound- or RessourceNotFound-Messages in the log files.

None of these actions resulted in new insights to the problem.

Any advice on this subject or any hint to additional ressources that could help would be appreciated very much.

Best regards,
Gero

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


Re: Startup of tomcat 8 takes twice as long as startup of tomcat 6

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

Gero,

On 12/15/14 8:33 AM, gchris@gmx.de wrote:
> we used to deploy our webapp in a tomcat 6.0.35 and want to upgrade
> to tomcat 8.0.9. During testing we discovered, that the startup
> process of tomcat 8 is twice as long as the startup process of
> tomcat 6 (with the same single webapp deployed)
> 
> My test system is as follows: Windows 7, JRE 1.7.0, Tomcat
> 6.0.35/8.0.9
> 
> Inspection of the log files revealed, that the additional time is
> used for class loading:
> 
> Log of tomcat 6: ... Nov 28, 2014 5:07:59 PM
> org.apache.tomcat.util.digester.Digester endDocument Fein:
> endDocument() Nov 28, 2014 5:07:59 PM
> org.apache.catalina.loader.WebappClassLoader loadClass Fein:
> loadClass(org.springframework.web.util.Log4jConfigListener, false) 
> ... Fein: Parent class loader is: WebappClassLoader context: 
> delegate: false repositories: ----------> Parent Classloader: 
> org.apache.catalina.loader.StandardClassLoader@189ff97 Nov 28, 2014
> 5:08:08 PM org.apache.jasper.compiler.JspRuntimeContext
> initClassPath Fein: Compilation classpath initialized: ... Nov 28,
> 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init Fein:
> Scratch dir for the JSP engine is: ... Nov 28, 2014 5:08:08 PM
> org.apache.jasper.servlet.JspServlet init Fein: IMPORTANT: Do not
> modify the generated servlets Nov 28, 2014 5:08:08 PM
> org.apache.catalina.core.StandardContext start Fein: Starting
> completed ... Nov 28, 2014 5:08:09 PM
> org.apache.catalina.startup.Catalina start Information: Server
> startup in 10861 ms
> 
> Log of tomcat 8: ... 28-Nov-2014 16:09:09.128 FINER
> [localhost-startStop-1]
> org.apache.tomcat.util.scan.StandardJarScanner.scan Not scanning
> JAR
> [file:/C:/Program%20Files/tomcat%208/tolina_webserver-3.0.0-SNAPSHOT-20141103-130423/bin/tomcat-juli.jar]
> from classpath 28-Nov-2014 16:09:09.128 FINE
> [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoader.loadClass
> loadClass(org.apache.jasper.servlet.JasperInitializer, false) 
> 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoader.loadClass Delegating
> to parent classloader1 java.net.URLClassLoader@1c47dd5 28-Nov-2014
> 16:09:09.128 FINE [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoader.loadClass Loading
> class from parent ... 28-Nov-2014 16:09:28.362 FINE
> [localhost-startStop-1]
> org.apache.jasper.compiler.JspRuntimeContext.<init> Parent class
> loader is: WebappClassLoader context: /manager delegate: false 
> ----------> Parent Classloader: java.net.URLClassLoader@1c47dd5 
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.jasper.compiler.JspRuntimeContext.initClassPath
> Compilation classpath initialized: ... 28-Nov-2014 16:09:28.362
> FINE [localhost-startStop-1]
> org.apache.jasper.servlet.JspServlet.init Scratch dir for the JSP
> engine is: ... 28-Nov-2014 16:09:28.362 FINE
> [localhost-startStop-1] org.apache.jasper.servlet.JspServlet.init
> IMPORTANT: Do not modify the generated servlets 28-Nov-2014
> 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.tomcat.util.modeler.Registry.registerComponent Managed=
> Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
>
> 
28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
org.apache.tomcat.util.modeler.BaseModelMBean.preRegister preRegister
org.apache.jasper.servlet.JspServlet@1067d4c
Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.catalina.core.StandardContext.startInternal Starting
> completed 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.catalina.util.LifecycleBase.setStateInternal Setting
> state for
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> to [STARTING] 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.catalina.util.LifecycleBase.setStateInternal Setting
> state for
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> to [STARTED] ... 28-Nov-2014 16:09:28.377 FINE [main]
> org.apache.catalina.util.LifecycleBase.setStateInternal Setting
> state for [StandardServer[8005]] to [STARTED] 28-Nov-2014
> 16:09:28.377 INFO [main] org.apache.catalina.startup.Catalina.start
> Server startup in 21443 ms
> 
> Searching the web and the mail archives resulted in quite a few
> hints how to improve performance generally. I followed the
> instructions on wiki.apache.org/tomcat/HowTo/FasterStartUp, in
> particular: - Disabling JAR scanning (metadata-complete="true",
> <absolute-ordering/> in the <web-app>. - in catalina.properties: 
> tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\*.jar 
> org.apache.catalina.startup.ContextConfig.jarsToSkip=\*.jar 
> org.apache.catalina.startup.TldConfig.jarsToSkip=\*.jar

Why did you add those back-slashes?

> - Removing the web socket API and implementation JARs - Changing
> the entropy source (-Djava.security.egd=file:/dev/./urandom)
> 
> These changes were in effect when the above logs were written.
> While these changes resulted in a faster startup process (on both
> tomcats), I found no clue about why tomcat 8 takes longer in
> general to complete server startup.
> 
> I compared the jars loaded in both cases and tried to remove the
> two additional jars in tomcat 8. I compared the configurations of
> both tomcats and aligned the registered listeners and disabled
> XMLValidation and XMLNameSpaceAware in server.xml. I reduced the
> bigger MIME-Mapping in web.xml of tomcat 8 to the MIME-Mapping of
> tomcat 6. I compared the number of classes and ressources loaded
> and the number of ClassNotFound- or RessourceNotFound-Messages in
> the log files.
> 
> None of these actions resulted in new insights to the problem.
> 
> Any advice on this subject or any hint to additional ressources
> that could help would be appreciated very much.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUj5RwAAoJEBzwKT+lPKRYmDgP/AgYIDozfN95+kixqvdHhbve
xXqpNhkziQO9Z4eGm8hhD1iHPSpY2BOxYhkgYA7K+dhKnYHVQ2eFw/PwksoEaPTW
9F+7urk7mpl6eKkKOf3nqkOoDeS3ZsE8oh4YAH/9GQO0ZgOfL0HWS5/kx4s0mMwA
GDPMkVAgzLZa1kt2DmD1P+D2o3Vh4ZuhYqmeZvMhlxWvYTBZcMJ+5iYmlNOYjR7L
U5584IRRtH4FK6necwevE9cw2PON5P0Svee0aXtvMprEcnMAOWAkiL6dTTeakq5P
KyWraYkbYJz4zrdPstktNFb2e7iZDdUefbRbciEFI4CdIIoF7cX5ny6/179G3vnN
knE9GjgMWEoqQ1J3erJba2BmYWmtaNiGjqvX+T32HW0QGyoZbhaf4P4ghXKCHtCr
+BCRdPrWXBPbUaDWXC7zuvXcfhbAXE9ap0/dvMrD+iyBspy6EzZfKrzxYt7vE1Aw
qni9vCp0xtoYDvjmABDUfZBYd9RSzt4W5WD1iuYVxu25To16sSoJD+shoC9ZJVkX
ujzP1K3jwRbKHUI+JuHmrAXjJyPUrDVJIzgv9OIEbCfSWTLTsWXDrvdaWtxQ/aLy
gdtcV3pFmQgck45OQzx06S9QrZCofojtOk3WhRrm1/s21PIl/NR/97M1YGV6mzGY
I5z/UE7mtcWoulkYT4L6
=jXJw
-----END PGP SIGNATURE-----

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


Re: Re: Startup of tomcat 8 takes twice as long as startup of tomcat 6

Posted by Daniel Mikusa <dm...@pivotal.io>.
On Mon, Dec 15, 2014 at 11:54 AM, gchris@gmx.de <gc...@gmx.de> wrote:
>
> Hello Daniel,
>
> thank you very much for your quick reply.
>

Sure, np.  One quick note, on this list we prefer posters to not top post.
Either reply inline like me or at the bottom.  It's convention we've landed
on to help make reading threads easier.


>
> Comparing the startup times for Tomcat 6.0.35 and Tomcat 8.0.15 without
> any apps deployed
> (and without any tuning, such as disabling jar scanning) shows me
> that Tomcat 8.0.15 is much faster than Tomcat 6.0.35 (53 ms opposed to 933
> ms).
>
> Therefore, the problem has to come from the app, as you assumed.
>
> I also deployed our app to both tomcats and got the following startup
> times:
> Tomcat 6.0.35: 11675 ms
> Tomcat 8.0.15: 21964 ms


> Since the very same app was deployed to both tomcats, there still has to
> be some difference in
> the startup process which results in a slower startup in Tomcat 8.0.15.
>

My thought for the difference would be this:
http://wiki.apache.org/tomcat/HowTo/FasterStartUp#JAR_scanning

You mentioned that you had tried the fixes listed here, right?  Can you
talk a little more about what you tried and what if any impact those
changes had on the startup time?


>
> I will try a profiler to describe the problem more precisely.
>

Excellent!  That should help to pinpoint the problem.

Dan


>
> Gero
>
> > Gesendet: Montag, 15. Dezember 2014 um 16:04 Uhr
> > Von: "Daniel Mikusa" <dm...@pivotal.io>
> > An: "Tomcat Users List" <us...@tomcat.apache.org>
> > Betreff: Re: Startup of tomcat 8 takes twice as long as startup of
> tomcat 6
> >
> > On Mon, Dec 15, 2014 at 8:33 AM, gchris@gmx.de <gc...@gmx.de> wrote:
> > >
> > >
> > >
> > > Hi,
> > >
> > > we used to deploy our webapp in a tomcat 6.0.35 and want to upgrade to
> > > tomcat 8.0.9.
> > >
> >
> > Try the latest Tomcat 8 release, 8.0.15, and see if that helps.
> >
> >
> > > During testing we discovered, that the startup process of tomcat 8 is
> > > twice as long as the startup process of tomcat 6 (with the same single
> > > webapp deployed)
> > >
> >
> > How long does Tomcat 8 take to start without any apps deployed?
> >
> >
> > >
> > > My test system is as follows:
> > > Windows 7, JRE 1.7.0, Tomcat 6.0.35/8.0.9
> > >
> > > Inspection of the log files revealed, that the additional time is used
> for
> > > class loading:
> > >
> > > Log of tomcat 6:
> > > ...
> > > Nov 28, 2014 5:07:59 PM org.apache.tomcat.util.digester.Digester
> > > endDocument
> > > Fein: endDocument()
> > > Nov 28, 2014 5:07:59 PM org.apache.catalina.loader.WebappClassLoader
> > > loadClass
> > > Fein: loadClass(org.springframework.web.util.Log4jConfigListener,
> false)
> > > ...
> > > Fein: Parent class loader is: WebappClassLoader
> > > context:
> > > delegate: false
> > > repositories:
> > > ----------> Parent Classloader:
> > > org.apache.catalina.loader.StandardClassLoader@189ff97
> > > Nov 28, 2014 5:08:08 PM org.apache.jasper.compiler.JspRuntimeContext
> > > initClassPath
> > > Fein: Compilation classpath initialized: ...
> > > Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> > > Fein: Scratch dir for the JSP engine is: ...
> > > Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> > > Fein: IMPORTANT: Do not modify the generated servlets
> > > Nov 28, 2014 5:08:08 PM org.apache.catalina.core.StandardContext start
> > > Fein: Starting completed
> > > ...
> > > Nov 28, 2014 5:08:09 PM org.apache.catalina.startup.Catalina start
> > > Information: Server startup in 10861 ms
> > >
> > > Log of tomcat 8:
> > > ...
> > > 28-Nov-2014 16:09:09.128 FINER [localhost-startStop-1]
> > > org.apache.tomcat.util.scan.StandardJarScanner.scan Not scanning JAR
> > >
> [file:/C:/Program%20Files/tomcat%208/tolina_webserver-3.0.0-SNAPSHOT-20141103-130423/bin/tomcat-juli.jar]
> > > from classpath
> > > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > > org.apache.catalina.loader.WebappClassLoader.loadClass
> > > loadClass(org.apache.jasper.servlet.JasperInitializer, false)
> > > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > > org.apache.catalina.loader.WebappClassLoader.loadClass Delegating to
> parent
> > > classloader1 java.net.URLClassLoader@1c47dd5
> > > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > > org.apache.catalina.loader.WebappClassLoader.loadClass Loading class
> from
> > > parent
> > > ...
> > > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > > org.apache.jasper.compiler.JspRuntimeContext.<init> Parent class
> loader is:
> > > WebappClassLoader
> > > context: /manager
> > > delegate: false
> > > ----------> Parent Classloader:
> > > java.net.URLClassLoader@1c47dd5
> > > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > > org.apache.jasper.compiler.JspRuntimeContext.initClassPath Compilation
> > > classpath initialized: ...
> > > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > > org.apache.jasper.servlet.JspServlet.init Scratch dir for the JSP
> engine
> > > is: ...
> > > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > > org.apache.jasper.servlet.JspServlet.init IMPORTANT: Do not modify the
> > > generated servlets
> > > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > > org.apache.tomcat.util.modeler.Registry.registerComponent Managed=
> > >
> Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> > > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > > org.apache.tomcat.util.modeler.BaseModelMBean.preRegister preRegister
> > > org.apache.jasper.servlet.JspServlet@1067d4c
> > >
> Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> > > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > > org.apache.catalina.core.StandardContext.startInternal Starting
> completed
> > > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state
> for
> > >
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> > > to [STARTING]
> > > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state
> for
> > >
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> > > to [STARTED]
> > > ...
> > > 28-Nov-2014 16:09:28.377 FINE [main]
> > > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state
> for
> > > [StandardServer[8005]] to [STARTED]
> > > 28-Nov-2014 16:09:28.377 INFO [main]
> > > org.apache.catalina.startup.Catalina.start Server startup in 21443 ms
> > >
> > > Searching the web and the mail archives resulted in quite a few hints
> how
> > > to improve performance generally.
> > > I followed the instructions on
> wiki.apache.org/tomcat/HowTo/FasterStartUp,
> > > in particular:
> > > - Disabling JAR scanning (metadata-complete="true",
> <absolute-ordering/>
> > > in the <web-app>.
> > > - in catalina.properties:
> > > tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\*.jar
> > > org.apache.catalina.startup.ContextConfig.jarsToSkip=\*.jar
> > > org.apache.catalina.startup.TldConfig.jarsToSkip=\*.jar
> > > - Removing the web socket API and implementation JARs
> > > - Changing the entropy source (-Djava.security.egd=file:/dev/./urandom)
> > >
> > > These changes were in effect when the above logs were written. While
> these
> > > changes resulted in a faster startup process (on both tomcats),
> >
> > I found no clue about why tomcat 8 takes longer in general to complete
> > > server startup.
> > >
> >
> > Which one of these changes helped?  They affect different things, so it
> > really depends on which one or ones helped.
> >
> > The wiki page does explain each one separately though.  Do you have
> > questions about a specific change and why that helps with performance?
> >
> >
> > >
> > > I compared the jars loaded in both cases and tried to remove the two
> > > additional jars in tomcat 8.
> > > I compared the configurations of both tomcats and aligned the
> registered
> > > listeners and disabled XMLValidation and XMLNameSpaceAware in
> server.xml. I
> > > reduced the bigger MIME-Mapping in web.xml of tomcat 8
> > > to the MIME-Mapping of tomcat 6.
> > > I compared the number of classes and ressources loaded and the number
> of
> > > ClassNotFound- or RessourceNotFound-Messages in the log files.
> > >
> > > None of these actions resulted in new insights to the problem.
> > >
> > > Any advice on this subject or any hint to additional ressources that
> could
> > > help would be appreciated very much.
> > >
> >
> > Run a profiler and see what's taking up so much time.  In most cases,
> it's
> > the application.  If it's Tomcat, let us know the results.
> >
> > Dan
> >
> >
> > >
> > > Best regards,
> > > Gero
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Aw: Re: Startup of tomcat 8 takes twice as long as startup of tomcat 6

Posted by "gchris@gmx.de" <gc...@gmx.de>.
Hello Daniel,

thank you very much for your quick reply.

Comparing the startup times for Tomcat 6.0.35 and Tomcat 8.0.15 without any apps deployed 
(and without any tuning, such as disabling jar scanning) shows me
that Tomcat 8.0.15 is much faster than Tomcat 6.0.35 (53 ms opposed to 933 ms).

Therefore, the problem has to come from the app, as you assumed.

I also deployed our app to both tomcats and got the following startup times:
Tomcat 6.0.35: 11675 ms
Tomcat 8.0.15: 21964 ms

Since the very same app was deployed to both tomcats, there still has to be some difference in 
the startup process which results in a slower startup in Tomcat 8.0.15.

I will try a profiler to describe the problem more precisely.

Gero

> Gesendet: Montag, 15. Dezember 2014 um 16:04 Uhr
> Von: "Daniel Mikusa" <dm...@pivotal.io>
> An: "Tomcat Users List" <us...@tomcat.apache.org>
> Betreff: Re: Startup of tomcat 8 takes twice as long as startup of tomcat 6
>
> On Mon, Dec 15, 2014 at 8:33 AM, gchris@gmx.de <gc...@gmx.de> wrote:
> >
> >
> >
> > Hi,
> >
> > we used to deploy our webapp in a tomcat 6.0.35 and want to upgrade to
> > tomcat 8.0.9.
> >
> 
> Try the latest Tomcat 8 release, 8.0.15, and see if that helps.
> 
> 
> > During testing we discovered, that the startup process of tomcat 8 is
> > twice as long as the startup process of tomcat 6 (with the same single
> > webapp deployed)
> >
> 
> How long does Tomcat 8 take to start without any apps deployed?
> 
> 
> >
> > My test system is as follows:
> > Windows 7, JRE 1.7.0, Tomcat 6.0.35/8.0.9
> >
> > Inspection of the log files revealed, that the additional time is used for
> > class loading:
> >
> > Log of tomcat 6:
> > ...
> > Nov 28, 2014 5:07:59 PM org.apache.tomcat.util.digester.Digester
> > endDocument
> > Fein: endDocument()
> > Nov 28, 2014 5:07:59 PM org.apache.catalina.loader.WebappClassLoader
> > loadClass
> > Fein: loadClass(org.springframework.web.util.Log4jConfigListener, false)
> > ...
> > Fein: Parent class loader is: WebappClassLoader
> > context:
> > delegate: false
> > repositories:
> > ----------> Parent Classloader:
> > org.apache.catalina.loader.StandardClassLoader@189ff97
> > Nov 28, 2014 5:08:08 PM org.apache.jasper.compiler.JspRuntimeContext
> > initClassPath
> > Fein: Compilation classpath initialized: ...
> > Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> > Fein: Scratch dir for the JSP engine is: ...
> > Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> > Fein: IMPORTANT: Do not modify the generated servlets
> > Nov 28, 2014 5:08:08 PM org.apache.catalina.core.StandardContext start
> > Fein: Starting completed
> > ...
> > Nov 28, 2014 5:08:09 PM org.apache.catalina.startup.Catalina start
> > Information: Server startup in 10861 ms
> >
> > Log of tomcat 8:
> > ...
> > 28-Nov-2014 16:09:09.128 FINER [localhost-startStop-1]
> > org.apache.tomcat.util.scan.StandardJarScanner.scan Not scanning JAR
> > [file:/C:/Program%20Files/tomcat%208/tolina_webserver-3.0.0-SNAPSHOT-20141103-130423/bin/tomcat-juli.jar]
> > from classpath
> > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > org.apache.catalina.loader.WebappClassLoader.loadClass
> > loadClass(org.apache.jasper.servlet.JasperInitializer, false)
> > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > org.apache.catalina.loader.WebappClassLoader.loadClass Delegating to parent
> > classloader1 java.net.URLClassLoader@1c47dd5
> > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > org.apache.catalina.loader.WebappClassLoader.loadClass Loading class from
> > parent
> > ...
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.compiler.JspRuntimeContext.<init> Parent class loader is:
> > WebappClassLoader
> > context: /manager
> > delegate: false
> > ----------> Parent Classloader:
> > java.net.URLClassLoader@1c47dd5
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.compiler.JspRuntimeContext.initClassPath Compilation
> > classpath initialized: ...
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.servlet.JspServlet.init Scratch dir for the JSP engine
> > is: ...
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.servlet.JspServlet.init IMPORTANT: Do not modify the
> > generated servlets
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.tomcat.util.modeler.Registry.registerComponent Managed=
> > Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.tomcat.util.modeler.BaseModelMBean.preRegister preRegister
> > org.apache.jasper.servlet.JspServlet@1067d4c
> > Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.catalina.core.StandardContext.startInternal Starting completed
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> > [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> > to [STARTING]
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> > [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> > to [STARTED]
> > ...
> > 28-Nov-2014 16:09:28.377 FINE [main]
> > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> > [StandardServer[8005]] to [STARTED]
> > 28-Nov-2014 16:09:28.377 INFO [main]
> > org.apache.catalina.startup.Catalina.start Server startup in 21443 ms
> >
> > Searching the web and the mail archives resulted in quite a few hints how
> > to improve performance generally.
> > I followed the instructions on wiki.apache.org/tomcat/HowTo/FasterStartUp,
> > in particular:
> > - Disabling JAR scanning (metadata-complete="true", <absolute-ordering/>
> > in the <web-app>.
> > - in catalina.properties:
> > tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\*.jar
> > org.apache.catalina.startup.ContextConfig.jarsToSkip=\*.jar
> > org.apache.catalina.startup.TldConfig.jarsToSkip=\*.jar
> > - Removing the web socket API and implementation JARs
> > - Changing the entropy source (-Djava.security.egd=file:/dev/./urandom)
> >
> > These changes were in effect when the above logs were written. While these
> > changes resulted in a faster startup process (on both tomcats),
> 
> I found no clue about why tomcat 8 takes longer in general to complete
> > server startup.
> >
> 
> Which one of these changes helped?  They affect different things, so it
> really depends on which one or ones helped.
> 
> The wiki page does explain each one separately though.  Do you have
> questions about a specific change and why that helps with performance?
> 
> 
> >
> > I compared the jars loaded in both cases and tried to remove the two
> > additional jars in tomcat 8.
> > I compared the configurations of both tomcats and aligned the registered
> > listeners and disabled XMLValidation and XMLNameSpaceAware in server.xml. I
> > reduced the bigger MIME-Mapping in web.xml of tomcat 8
> > to the MIME-Mapping of tomcat 6.
> > I compared the number of classes and ressources loaded and the number of
> > ClassNotFound- or RessourceNotFound-Messages in the log files.
> >
> > None of these actions resulted in new insights to the problem.
> >
> > Any advice on this subject or any hint to additional ressources that could
> > help would be appreciated very much.
> >
> 
> Run a profiler and see what's taking up so much time.  In most cases, it's
> the application.  If it's Tomcat, let us know the results.
> 
> Dan
> 
> 
> >
> > Best regards,
> > Gero
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
> 

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


Re: Startup of tomcat 8 takes twice as long as startup of tomcat 6

Posted by Daniel Mikusa <dm...@pivotal.io>.
On Mon, Dec 15, 2014 at 8:33 AM, gchris@gmx.de <gc...@gmx.de> wrote:
>
>
>
> Hi,
>
> we used to deploy our webapp in a tomcat 6.0.35 and want to upgrade to
> tomcat 8.0.9.
>

Try the latest Tomcat 8 release, 8.0.15, and see if that helps.


> During testing we discovered, that the startup process of tomcat 8 is
> twice as long as the startup process of tomcat 6 (with the same single
> webapp deployed)
>

How long does Tomcat 8 take to start without any apps deployed?


>
> My test system is as follows:
> Windows 7, JRE 1.7.0, Tomcat 6.0.35/8.0.9
>
> Inspection of the log files revealed, that the additional time is used for
> class loading:
>
> Log of tomcat 6:
> ...
> Nov 28, 2014 5:07:59 PM org.apache.tomcat.util.digester.Digester
> endDocument
> Fein: endDocument()
> Nov 28, 2014 5:07:59 PM org.apache.catalina.loader.WebappClassLoader
> loadClass
> Fein: loadClass(org.springframework.web.util.Log4jConfigListener, false)
> ...
> Fein: Parent class loader is: WebappClassLoader
> context:
> delegate: false
> repositories:
> ----------> Parent Classloader:
> org.apache.catalina.loader.StandardClassLoader@189ff97
> Nov 28, 2014 5:08:08 PM org.apache.jasper.compiler.JspRuntimeContext
> initClassPath
> Fein: Compilation classpath initialized: ...
> Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> Fein: Scratch dir for the JSP engine is: ...
> Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> Fein: IMPORTANT: Do not modify the generated servlets
> Nov 28, 2014 5:08:08 PM org.apache.catalina.core.StandardContext start
> Fein: Starting completed
> ...
> Nov 28, 2014 5:08:09 PM org.apache.catalina.startup.Catalina start
> Information: Server startup in 10861 ms
>
> Log of tomcat 8:
> ...
> 28-Nov-2014 16:09:09.128 FINER [localhost-startStop-1]
> org.apache.tomcat.util.scan.StandardJarScanner.scan Not scanning JAR
> [file:/C:/Program%20Files/tomcat%208/tolina_webserver-3.0.0-SNAPSHOT-20141103-130423/bin/tomcat-juli.jar]
> from classpath
> 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoader.loadClass
> loadClass(org.apache.jasper.servlet.JasperInitializer, false)
> 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoader.loadClass Delegating to parent
> classloader1 java.net.URLClassLoader@1c47dd5
> 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoader.loadClass Loading class from
> parent
> ...
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.jasper.compiler.JspRuntimeContext.<init> Parent class loader is:
> WebappClassLoader
> context: /manager
> delegate: false
> ----------> Parent Classloader:
> java.net.URLClassLoader@1c47dd5
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.jasper.compiler.JspRuntimeContext.initClassPath Compilation
> classpath initialized: ...
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.jasper.servlet.JspServlet.init Scratch dir for the JSP engine
> is: ...
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.jasper.servlet.JspServlet.init IMPORTANT: Do not modify the
> generated servlets
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.tomcat.util.modeler.Registry.registerComponent Managed=
> Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.tomcat.util.modeler.BaseModelMBean.preRegister preRegister
> org.apache.jasper.servlet.JspServlet@1067d4c
> Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.catalina.core.StandardContext.startInternal Starting completed
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> to [STARTING]
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> to [STARTED]
> ...
> 28-Nov-2014 16:09:28.377 FINE [main]
> org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> [StandardServer[8005]] to [STARTED]
> 28-Nov-2014 16:09:28.377 INFO [main]
> org.apache.catalina.startup.Catalina.start Server startup in 21443 ms
>
> Searching the web and the mail archives resulted in quite a few hints how
> to improve performance generally.
> I followed the instructions on wiki.apache.org/tomcat/HowTo/FasterStartUp,
> in particular:
> - Disabling JAR scanning (metadata-complete="true", <absolute-ordering/>
> in the <web-app>.
> - in catalina.properties:
> tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\*.jar
> org.apache.catalina.startup.ContextConfig.jarsToSkip=\*.jar
> org.apache.catalina.startup.TldConfig.jarsToSkip=\*.jar
> - Removing the web socket API and implementation JARs
> - Changing the entropy source (-Djava.security.egd=file:/dev/./urandom)
>
> These changes were in effect when the above logs were written. While these
> changes resulted in a faster startup process (on both tomcats),

I found no clue about why tomcat 8 takes longer in general to complete
> server startup.
>

Which one of these changes helped?  They affect different things, so it
really depends on which one or ones helped.

The wiki page does explain each one separately though.  Do you have
questions about a specific change and why that helps with performance?


>
> I compared the jars loaded in both cases and tried to remove the two
> additional jars in tomcat 8.
> I compared the configurations of both tomcats and aligned the registered
> listeners and disabled XMLValidation and XMLNameSpaceAware in server.xml. I
> reduced the bigger MIME-Mapping in web.xml of tomcat 8
> to the MIME-Mapping of tomcat 6.
> I compared the number of classes and ressources loaded and the number of
> ClassNotFound- or RessourceNotFound-Messages in the log files.
>
> None of these actions resulted in new insights to the problem.
>
> Any advice on this subject or any hint to additional ressources that could
> help would be appreciated very much.
>

Run a profiler and see what's taking up so much time.  In most cases, it's
the application.  If it's Tomcat, let us know the results.

Dan


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

Aw: Re: Startup of tomcat 8 takes twice as long as startup of tomcat 6

Posted by "gchris@gmx.de" <gc...@gmx.de>.
Hello Muralidhar,

thank you for your quick reply.

I realize that the absolute startup time in my test is not very long. What concerns me is the difference 
between the startup times of tomcat 6 and tomcat 8 with the very same application.

I wonder, if the longer startup time could be the result of some misconfiguration or misuse I do not see.

> Gesendet: Montag, 15. Dezember 2014 um 14:40 Uhr
> Von: "Yaragalla Muralidhar" <ya...@gmail.com>
> An: "Tomcat Users List" <us...@tomcat.apache.org>
> Betreff: Re: Startup of tomcat 8 takes twice as long as startup of tomcat 6
>
> for me it is taking more than that. I have deployed a simple war file. It
> took so long to deploy it.
> 
> omcat-8.0.15\webapps\ROOT has finished in 240 ms
> 15-Dec-2014 19:08:32.348 INFO [main]
> org.apache.coyote.AbstractProtocol.start St
> arting ProtocolHandler ["http-nio-8080"]
> 15-Dec-2014 19:08:32.357 INFO [main]
> org.apache.coyote.AbstractProtocol.start St
> arting ProtocolHandler ["ajp-nio-8009"]
> 15-Dec-2014 19:08:32.360 INFO [main]
> org.apache.catalina.startup.Catalina.start
> Server startup in 336069 ms
> 
> 
> *Thanks and Regards,*
> Muralidhar Yaragalla.
> 
> *http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>*
> 
> On Mon, Dec 15, 2014 at 7:03 PM, gchris@gmx.de <gc...@gmx.de> wrote:
> >
> >
> >
> > Hi,
> >
> > we used to deploy our webapp in a tomcat 6.0.35 and want to upgrade to
> > tomcat 8.0.9.
> > During testing we discovered, that the startup process of tomcat 8 is
> > twice as long as the startup process of tomcat 6 (with the same single
> > webapp deployed)
> >
> > My test system is as follows:
> > Windows 7, JRE 1.7.0, Tomcat 6.0.35/8.0.9
> >
> > Inspection of the log files revealed, that the additional time is used for
> > class loading:
> >
> > Log of tomcat 6:
> > ...
> > Nov 28, 2014 5:07:59 PM org.apache.tomcat.util.digester.Digester
> > endDocument
> > Fein: endDocument()
> > Nov 28, 2014 5:07:59 PM org.apache.catalina.loader.WebappClassLoader
> > loadClass
> > Fein: loadClass(org.springframework.web.util.Log4jConfigListener, false)
> > ...
> > Fein: Parent class loader is: WebappClassLoader
> > context:
> > delegate: false
> > repositories:
> > ----------> Parent Classloader:
> > org.apache.catalina.loader.StandardClassLoader@189ff97
> > Nov 28, 2014 5:08:08 PM org.apache.jasper.compiler.JspRuntimeContext
> > initClassPath
> > Fein: Compilation classpath initialized: ...
> > Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> > Fein: Scratch dir for the JSP engine is: ...
> > Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> > Fein: IMPORTANT: Do not modify the generated servlets
> > Nov 28, 2014 5:08:08 PM org.apache.catalina.core.StandardContext start
> > Fein: Starting completed
> > ...
> > Nov 28, 2014 5:08:09 PM org.apache.catalina.startup.Catalina start
> > Information: Server startup in 10861 ms
> >
> > Log of tomcat 8:
> > ...
> > 28-Nov-2014 16:09:09.128 FINER [localhost-startStop-1]
> > org.apache.tomcat.util.scan.StandardJarScanner.scan Not scanning JAR
> > [file:/C:/Program%20Files/tomcat%208/tolina_webserver-3.0.0-SNAPSHOT-20141103-130423/bin/tomcat-juli.jar]
> > from classpath
> > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > org.apache.catalina.loader.WebappClassLoader.loadClass
> > loadClass(org.apache.jasper.servlet.JasperInitializer, false)
> > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > org.apache.catalina.loader.WebappClassLoader.loadClass Delegating to parent
> > classloader1 java.net.URLClassLoader@1c47dd5
> > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > org.apache.catalina.loader.WebappClassLoader.loadClass Loading class from
> > parent
> > ...
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.compiler.JspRuntimeContext.<init> Parent class loader is:
> > WebappClassLoader
> > context: /manager
> > delegate: false
> > ----------> Parent Classloader:
> > java.net.URLClassLoader@1c47dd5
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.compiler.JspRuntimeContext.initClassPath Compilation
> > classpath initialized: ...
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.servlet.JspServlet.init Scratch dir for the JSP engine
> > is: ...
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.servlet.JspServlet.init IMPORTANT: Do not modify the
> > generated servlets
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.tomcat.util.modeler.Registry.registerComponent Managed=
> > Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.tomcat.util.modeler.BaseModelMBean.preRegister preRegister
> > org.apache.jasper.servlet.JspServlet@1067d4c
> > Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.catalina.core.StandardContext.startInternal Starting completed
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> > [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> > to [STARTING]
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> > [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> > to [STARTED]
> > ...
> > 28-Nov-2014 16:09:28.377 FINE [main]
> > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> > [StandardServer[8005]] to [STARTED]
> > 28-Nov-2014 16:09:28.377 INFO [main]
> > org.apache.catalina.startup.Catalina.start Server startup in 21443 ms
> >
> > Searching the web and the mail archives resulted in quite a few hints how
> > to improve performance generally.
> > I followed the instructions on wiki.apache.org/tomcat/HowTo/FasterStartUp,
> > in particular:
> > - Disabling JAR scanning (metadata-complete="true", <absolute-ordering/>
> > in the <web-app>.
> > - in catalina.properties:
> > tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\*.jar
> > org.apache.catalina.startup.ContextConfig.jarsToSkip=\*.jar
> > org.apache.catalina.startup.TldConfig.jarsToSkip=\*.jar
> > - Removing the web socket API and implementation JARs
> > - Changing the entropy source (-Djava.security.egd=file:/dev/./urandom)
> >
> > These changes were in effect when the above logs were written. While these
> > changes resulted in a faster startup process (on both tomcats), I found no
> > clue about why tomcat 8 takes longer in general to complete server startup.
> >
> > I compared the jars loaded in both cases and tried to remove the two
> > additional jars in tomcat 8.
> > I compared the configurations of both tomcats and aligned the registered
> > listeners and disabled XMLValidation and XMLNameSpaceAware in server.xml. I
> > reduced the bigger MIME-Mapping in web.xml of tomcat 8
> > to the MIME-Mapping of tomcat 6.
> > I compared the number of classes and ressources loaded and the number of
> > ClassNotFound- or RessourceNotFound-Messages in the log files.
> >
> > None of these actions resulted in new insights to the problem.
> >
> > Any advice on this subject or any hint to additional ressources that could
> > help would be appreciated very much.
> >
> > Best regards,
> > Gero
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
> 

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


Re: Startup of tomcat 8 takes twice as long as startup of tomcat 6

Posted by Daniel Mikusa <dm...@pivotal.io>.
On Mon, Dec 15, 2014 at 8:40 AM, Yaragalla Muralidhar <
yaragallamurali@gmail.com> wrote:
>
> for me it is taking more than that. I have deployed a simple war file.


How simple?  What about when you run it without any apps deployed?  How
fast does it startup then?


> It took so long to deploy it.
>
> omcat-8.0.15\webapps\ROOT has finished in 240 ms
> 15-Dec-2014 19:08:32.348 INFO [main]
> org.apache.coyote.AbstractProtocol.start St
> arting ProtocolHandler ["http-nio-8080"]
> 15-Dec-2014 19:08:32.357 INFO [main]
> org.apache.coyote.AbstractProtocol.start St
> arting ProtocolHandler ["ajp-nio-8009"]
> 15-Dec-2014 19:08:32.360 INFO [main]
> org.apache.catalina.startup.Catalina.start
> Server startup in 336069 ms
>

Have you tried anything listed here?

   http://wiki.apache.org/tomcat/HowTo/FasterStartUp

If so, what were the results?

Dan

PS.  If you have a profiler, hook it up to Tomcat and see what's taking so
long.  Most of the time it's the app, unless you're hitting one of the
issues on the wiki page I listed above.


>
> *Thanks and Regards,*
> Muralidhar Yaragalla.
>
> *http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>*
>
> On Mon, Dec 15, 2014 at 7:03 PM, gchris@gmx.de <gc...@gmx.de> wrote:
> >
> >
> >
> > Hi,
> >
> > we used to deploy our webapp in a tomcat 6.0.35 and want to upgrade to
> > tomcat 8.0.9.
> > During testing we discovered, that the startup process of tomcat 8 is
> > twice as long as the startup process of tomcat 6 (with the same single
> > webapp deployed)
> >
> > My test system is as follows:
> > Windows 7, JRE 1.7.0, Tomcat 6.0.35/8.0.9
> >
> > Inspection of the log files revealed, that the additional time is used
> for
> > class loading:
> >
> > Log of tomcat 6:
> > ...
> > Nov 28, 2014 5:07:59 PM org.apache.tomcat.util.digester.Digester
> > endDocument
> > Fein: endDocument()
> > Nov 28, 2014 5:07:59 PM org.apache.catalina.loader.WebappClassLoader
> > loadClass
> > Fein: loadClass(org.springframework.web.util.Log4jConfigListener, false)
> > ...
> > Fein: Parent class loader is: WebappClassLoader
> > context:
> > delegate: false
> > repositories:
> > ----------> Parent Classloader:
> > org.apache.catalina.loader.StandardClassLoader@189ff97
> > Nov 28, 2014 5:08:08 PM org.apache.jasper.compiler.JspRuntimeContext
> > initClassPath
> > Fein: Compilation classpath initialized: ...
> > Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> > Fein: Scratch dir for the JSP engine is: ...
> > Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> > Fein: IMPORTANT: Do not modify the generated servlets
> > Nov 28, 2014 5:08:08 PM org.apache.catalina.core.StandardContext start
> > Fein: Starting completed
> > ...
> > Nov 28, 2014 5:08:09 PM org.apache.catalina.startup.Catalina start
> > Information: Server startup in 10861 ms
> >
> > Log of tomcat 8:
> > ...
> > 28-Nov-2014 16:09:09.128 FINER [localhost-startStop-1]
> > org.apache.tomcat.util.scan.StandardJarScanner.scan Not scanning JAR
> >
> [file:/C:/Program%20Files/tomcat%208/tolina_webserver-3.0.0-SNAPSHOT-20141103-130423/bin/tomcat-juli.jar]
> > from classpath
> > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > org.apache.catalina.loader.WebappClassLoader.loadClass
> > loadClass(org.apache.jasper.servlet.JasperInitializer, false)
> > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > org.apache.catalina.loader.WebappClassLoader.loadClass Delegating to
> parent
> > classloader1 java.net.URLClassLoader@1c47dd5
> > 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> > org.apache.catalina.loader.WebappClassLoader.loadClass Loading class from
> > parent
> > ...
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.compiler.JspRuntimeContext.<init> Parent class loader
> is:
> > WebappClassLoader
> > context: /manager
> > delegate: false
> > ----------> Parent Classloader:
> > java.net.URLClassLoader@1c47dd5
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.compiler.JspRuntimeContext.initClassPath Compilation
> > classpath initialized: ...
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.servlet.JspServlet.init Scratch dir for the JSP engine
> > is: ...
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.jasper.servlet.JspServlet.init IMPORTANT: Do not modify the
> > generated servlets
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.tomcat.util.modeler.Registry.registerComponent Managed=
> >
> Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.tomcat.util.modeler.BaseModelMBean.preRegister preRegister
> > org.apache.jasper.servlet.JspServlet@1067d4c
> >
> Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.catalina.core.StandardContext.startInternal Starting completed
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> >
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> > to [STARTING]
> > 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> >
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> > to [STARTED]
> > ...
> > 28-Nov-2014 16:09:28.377 FINE [main]
> > org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> > [StandardServer[8005]] to [STARTED]
> > 28-Nov-2014 16:09:28.377 INFO [main]
> > org.apache.catalina.startup.Catalina.start Server startup in 21443 ms
> >
> > Searching the web and the mail archives resulted in quite a few hints how
> > to improve performance generally.
> > I followed the instructions on
> wiki.apache.org/tomcat/HowTo/FasterStartUp,
> > in particular:
> > - Disabling JAR scanning (metadata-complete="true", <absolute-ordering/>
> > in the <web-app>.
> > - in catalina.properties:
> > tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\*.jar
> > org.apache.catalina.startup.ContextConfig.jarsToSkip=\*.jar
> > org.apache.catalina.startup.TldConfig.jarsToSkip=\*.jar
> > - Removing the web socket API and implementation JARs
> > - Changing the entropy source (-Djava.security.egd=file:/dev/./urandom)
> >
> > These changes were in effect when the above logs were written. While
> these
> > changes resulted in a faster startup process (on both tomcats), I found
> no
> > clue about why tomcat 8 takes longer in general to complete server
> startup.
> >
> > I compared the jars loaded in both cases and tried to remove the two
> > additional jars in tomcat 8.
> > I compared the configurations of both tomcats and aligned the registered
> > listeners and disabled XMLValidation and XMLNameSpaceAware in
> server.xml. I
> > reduced the bigger MIME-Mapping in web.xml of tomcat 8
> > to the MIME-Mapping of tomcat 6.
> > I compared the number of classes and ressources loaded and the number of
> > ClassNotFound- or RessourceNotFound-Messages in the log files.
> >
> > None of these actions resulted in new insights to the problem.
> >
> > Any advice on this subject or any hint to additional ressources that
> could
> > help would be appreciated very much.
> >
> > Best regards,
> > Gero
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>

Re: Startup of tomcat 8 takes twice as long as startup of tomcat 6

Posted by Yaragalla Muralidhar <ya...@gmail.com>.
for me it is taking more than that. I have deployed a simple war file. It
took so long to deploy it.

omcat-8.0.15\webapps\ROOT has finished in 240 ms
15-Dec-2014 19:08:32.348 INFO [main]
org.apache.coyote.AbstractProtocol.start St
arting ProtocolHandler ["http-nio-8080"]
15-Dec-2014 19:08:32.357 INFO [main]
org.apache.coyote.AbstractProtocol.start St
arting ProtocolHandler ["ajp-nio-8009"]
15-Dec-2014 19:08:32.360 INFO [main]
org.apache.catalina.startup.Catalina.start
Server startup in 336069 ms


*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>*

On Mon, Dec 15, 2014 at 7:03 PM, gchris@gmx.de <gc...@gmx.de> wrote:
>
>
>
> Hi,
>
> we used to deploy our webapp in a tomcat 6.0.35 and want to upgrade to
> tomcat 8.0.9.
> During testing we discovered, that the startup process of tomcat 8 is
> twice as long as the startup process of tomcat 6 (with the same single
> webapp deployed)
>
> My test system is as follows:
> Windows 7, JRE 1.7.0, Tomcat 6.0.35/8.0.9
>
> Inspection of the log files revealed, that the additional time is used for
> class loading:
>
> Log of tomcat 6:
> ...
> Nov 28, 2014 5:07:59 PM org.apache.tomcat.util.digester.Digester
> endDocument
> Fein: endDocument()
> Nov 28, 2014 5:07:59 PM org.apache.catalina.loader.WebappClassLoader
> loadClass
> Fein: loadClass(org.springframework.web.util.Log4jConfigListener, false)
> ...
> Fein: Parent class loader is: WebappClassLoader
> context:
> delegate: false
> repositories:
> ----------> Parent Classloader:
> org.apache.catalina.loader.StandardClassLoader@189ff97
> Nov 28, 2014 5:08:08 PM org.apache.jasper.compiler.JspRuntimeContext
> initClassPath
> Fein: Compilation classpath initialized: ...
> Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> Fein: Scratch dir for the JSP engine is: ...
> Nov 28, 2014 5:08:08 PM org.apache.jasper.servlet.JspServlet init
> Fein: IMPORTANT: Do not modify the generated servlets
> Nov 28, 2014 5:08:08 PM org.apache.catalina.core.StandardContext start
> Fein: Starting completed
> ...
> Nov 28, 2014 5:08:09 PM org.apache.catalina.startup.Catalina start
> Information: Server startup in 10861 ms
>
> Log of tomcat 8:
> ...
> 28-Nov-2014 16:09:09.128 FINER [localhost-startStop-1]
> org.apache.tomcat.util.scan.StandardJarScanner.scan Not scanning JAR
> [file:/C:/Program%20Files/tomcat%208/tolina_webserver-3.0.0-SNAPSHOT-20141103-130423/bin/tomcat-juli.jar]
> from classpath
> 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoader.loadClass
> loadClass(org.apache.jasper.servlet.JasperInitializer, false)
> 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoader.loadClass Delegating to parent
> classloader1 java.net.URLClassLoader@1c47dd5
> 28-Nov-2014 16:09:09.128 FINE [localhost-startStop-1]
> org.apache.catalina.loader.WebappClassLoader.loadClass Loading class from
> parent
> ...
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.jasper.compiler.JspRuntimeContext.<init> Parent class loader is:
> WebappClassLoader
> context: /manager
> delegate: false
> ----------> Parent Classloader:
> java.net.URLClassLoader@1c47dd5
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.jasper.compiler.JspRuntimeContext.initClassPath Compilation
> classpath initialized: ...
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.jasper.servlet.JspServlet.init Scratch dir for the JSP engine
> is: ...
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.jasper.servlet.JspServlet.init IMPORTANT: Do not modify the
> generated servlets
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.tomcat.util.modeler.Registry.registerComponent Managed=
> Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.tomcat.util.modeler.BaseModelMBean.preRegister preRegister
> org.apache.jasper.servlet.JspServlet@1067d4c
> Catalina:type=JspMonitor,WebModule=//localhost/manager,name=jsp,J2EEApplication=none,J2EEServer=none
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.catalina.core.StandardContext.startInternal Starting completed
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> to [STARTING]
> 28-Nov-2014 16:09:28.362 FINE [localhost-startStop-1]
> org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/manager]]
> to [STARTED]
> ...
> 28-Nov-2014 16:09:28.377 FINE [main]
> org.apache.catalina.util.LifecycleBase.setStateInternal Setting state for
> [StandardServer[8005]] to [STARTED]
> 28-Nov-2014 16:09:28.377 INFO [main]
> org.apache.catalina.startup.Catalina.start Server startup in 21443 ms
>
> Searching the web and the mail archives resulted in quite a few hints how
> to improve performance generally.
> I followed the instructions on wiki.apache.org/tomcat/HowTo/FasterStartUp,
> in particular:
> - Disabling JAR scanning (metadata-complete="true", <absolute-ordering/>
> in the <web-app>.
> - in catalina.properties:
> tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\*.jar
> org.apache.catalina.startup.ContextConfig.jarsToSkip=\*.jar
> org.apache.catalina.startup.TldConfig.jarsToSkip=\*.jar
> - Removing the web socket API and implementation JARs
> - Changing the entropy source (-Djava.security.egd=file:/dev/./urandom)
>
> These changes were in effect when the above logs were written. While these
> changes resulted in a faster startup process (on both tomcats), I found no
> clue about why tomcat 8 takes longer in general to complete server startup.
>
> I compared the jars loaded in both cases and tried to remove the two
> additional jars in tomcat 8.
> I compared the configurations of both tomcats and aligned the registered
> listeners and disabled XMLValidation and XMLNameSpaceAware in server.xml. I
> reduced the bigger MIME-Mapping in web.xml of tomcat 8
> to the MIME-Mapping of tomcat 6.
> I compared the number of classes and ressources loaded and the number of
> ClassNotFound- or RessourceNotFound-Messages in the log files.
>
> None of these actions resulted in new insights to the problem.
>
> Any advice on this subject or any hint to additional ressources that could
> help would be appreciated very much.
>
> Best regards,
> Gero
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>