Tomcat taking too much time to start

40,859

Solution 1

You can find out which library consumes the time. When the server is being started in a debug mode, pause its thread several times and examine stacktraces. There may be possibly some library that populates its Spring application context, weaves advised objects, initializes file storage, whatever. If so, you will see it from stacktraces.

Solution 2

Have you removed all the default web applications that comes with the tomcat installation ? Even though your webapp is a small one, there might be other applications that are taking time to be installed. You can check this from the server log files with the name catalina___.log files.

Solution 3

I know this post is old, even i wanted to share few check points on this because these are irrespective of tomcat version...

I was facing the same issue and i followed below steps and now my server is starting with in 130 ms.

  1. First verify the console if you are using any IDE, there you can find time in milliseconds for each application. So you will come to know which one is taking long time.
  2. To make sure, your finding is correct just remove that app from 'webapps' folder and start tomcat again.
  3. Remove the default applications which you don't need. Usually we only use tomcat manager, so just keep manager app and remove other applications from 'webapps' folder
  4. Make sure 'temp' folder is empty
  5. Clean up the older log files. And don't write your application log files in server folder.
  6. Start the server first and deploy the file later. So that you don't face timeout error.

This is what i tried any succeed.

Solution 4

Possibly this is due to a lack of availability of random entropy, which Tomcat requires.

See https://cwiki.apache.org/confluence/display/TOMCAT/HowTo+FasterStartUp#HowToFasterStartUp-EntropySource and Slow startup on Tomcat 7.0.57 because of SecureRandom

(Edit: first link updated)

Share:
40,859
NIVESH SENGAR
Author by

NIVESH SENGAR

I m a funluving person working as a Software developer. This is my learning phase and hope I'll learn sumthing from u guys...:)

Updated on July 09, 2022

Comments

  • NIVESH SENGAR
    NIVESH SENGAR almost 2 years

    I am currently using tomcat 6 as my Web Server.
    I have a very small application which should not take long to deploy on server, but my tomcat is taking too long start.

    It is taking most of its time in following step.

    INFO: Starting Servlet Engine: Apache Tomcat/6.0.16

    I don't know why it is taking much time. Same is the case with stopping the server. I tried almost everything I know. I also tried to delete server from the workspace and started from scratch. I don't know what is the problem.

  • NiranjanBhat
    NiranjanBhat about 12 years
    In the default tomcat installation it will be in <apache-tomcat-base-direction>\logs
  • N00b Pr0grammer
    N00b Pr0grammer over 4 years
    the first link is broken. Can you please update your answer with the link that works?