LoginSignup
0
0

More than 5 years have passed since last update.

How to speed up starting up Tomcat

Last updated at Posted at 2018-01-19

Reference

How to speed up Tomcat launch

set startStopThreads="0" in conf/server.xml

  • before
sever.xml
    <Engine name="Catalina" defaultHost="localhost">
...
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
  • after
sever.xml
    <Engine name="Catalina" defaultHost="localhost" startStopThreads="0">
...
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" startStopThreads="0">

Before

StartStop-1 single thread

catalina.log

18-Jan-2018 17:36:50.808 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [/etc/tomcat/Catalina/localhost/examples.xml]
18-Jan-2018 17:36:51.698 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [/etc/tomcat/Catalina/localhost/examples.xml] has finished in [889] ms

18-Jan-2018 17:36:57.855 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [/etc/tomcat/Catalina/localhost/manager.xml]
18-Jan-2018 17:36:58.239 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [/etc/tomcat/Catalina/localhost/manager.xml] has finished in [384] ms

18-Jan-2018 17:36:58.239 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [/etc/tomcat/Catalina/localhost/host-manager.xml]
18-Jan-2018 17:36:58.531 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [/etc/tomcat/Catalina/localhost/host-manager.xml] has finished in [292] ms

After

StartStop-1,2,3,4 multiple threads = 4 CPUs

catalina.log

19-Jan-2018 14:37:39.768 INFO [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [/etc/tomcat/Catalina/localhost/manager.xml]
19-Jan-2018 14:37:39.768 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [/etc/tomcat/Catalina/localhost/examples.xml]
19-Jan-2018 14:37:39.769 INFO [localhost-startStop-4] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [/etc/tomcat/Catalina/localhost/host-manager.xml]

19-Jan-2018 14:37:41.130 INFO [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [/etc/tomcat/Catalina/localhost/manager.xml] has finished in [1,362] ms
19-Jan-2018 14:37:41.192 INFO [localhost-startStop-4] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [/etc/tomcat/Catalina/localhost/host-manager.xml] has finished in [1,423] ms
19-Jan-2018 14:37:41.282 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [/etc/tomcat/Catalina/localhost/examples.xml] has finished in [1,514] ms

Hummmm :confused:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0