tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Mikusa <dmik...@pivotal.io>
Subject Re: Re: Startup of tomcat 8 takes twice as long as startup of tomcat 6
Date Mon, 15 Dec 2014 17:12:54 GMT
On Mon, Dec 15, 2014 at 11:54 AM, gchris@gmx.de <gchris@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" <dmikusa@pivotal.io>
> > An: "Tomcat Users List" <users@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 <gchris@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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message